Commit 172e6ab1 authored by Suman Anna's avatar Suman Anna Committed by Ohad Ben-Cohen

remoteproc: fix various checkpatch warnings

Fix all the checkpatch warnings in the core remoteproc
code. The fixes cover the following warnings:
  1. WARNING: void function return statements are not generally useful
  2. WARNING: Possible unnecessary 'out of memory' message
  3. WARNING: line over 80 characters
  4. WARNING: braces {} are not necessary for single statement blocks
  5. WARNING: Unnecessary space before function pointer arguments
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
Signed-off-by: default avatarOhad Ben-Cohen <ohad@wizery.com>
parent e17aee37
...@@ -132,8 +132,6 @@ static void rproc_disable_iommu(struct rproc *rproc) ...@@ -132,8 +132,6 @@ static void rproc_disable_iommu(struct rproc *rproc)
iommu_detach_device(domain, dev); iommu_detach_device(domain, dev);
iommu_domain_free(domain); iommu_domain_free(domain);
return;
} }
/* /*
...@@ -411,10 +409,8 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, ...@@ -411,10 +409,8 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc,
} }
trace = kzalloc(sizeof(*trace), GFP_KERNEL); trace = kzalloc(sizeof(*trace), GFP_KERNEL);
if (!trace) { if (!trace)
dev_err(dev, "kzalloc trace failed\n");
return -ENOMEM; return -ENOMEM;
}
/* set the trace buffer dma properties */ /* set the trace buffer dma properties */
trace->len = rsc->len; trace->len = rsc->len;
...@@ -489,10 +485,8 @@ static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc, ...@@ -489,10 +485,8 @@ static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc,
} }
mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
if (!mapping) { if (!mapping)
dev_err(dev, "kzalloc mapping failed\n");
return -ENOMEM; return -ENOMEM;
}
ret = iommu_map(rproc->domain, rsc->da, rsc->pa, rsc->len, rsc->flags); ret = iommu_map(rproc->domain, rsc->da, rsc->pa, rsc->len, rsc->flags);
if (ret) { if (ret) {
...@@ -565,10 +559,8 @@ static int rproc_handle_carveout(struct rproc *rproc, ...@@ -565,10 +559,8 @@ static int rproc_handle_carveout(struct rproc *rproc,
rsc->da, rsc->pa, rsc->len, rsc->flags); rsc->da, rsc->pa, rsc->len, rsc->flags);
carveout = kzalloc(sizeof(*carveout), GFP_KERNEL); carveout = kzalloc(sizeof(*carveout), GFP_KERNEL);
if (!carveout) { if (!carveout)
dev_err(dev, "kzalloc carveout failed\n");
return -ENOMEM; return -ENOMEM;
}
va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL); va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL);
if (!va) { if (!va) {
...@@ -768,7 +760,8 @@ static void rproc_resource_cleanup(struct rproc *rproc) ...@@ -768,7 +760,8 @@ static void rproc_resource_cleanup(struct rproc *rproc)
/* clean up carveout allocations */ /* clean up carveout allocations */
list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) { list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) {
dma_free_coherent(dev->parent, entry->len, entry->va, entry->dma); dma_free_coherent(dev->parent, entry->len, entry->va,
entry->dma);
list_del(&entry->node); list_del(&entry->node);
kfree(entry); kfree(entry);
} }
...@@ -808,9 +801,8 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw) ...@@ -808,9 +801,8 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
/* look for the resource table */ /* look for the resource table */
table = rproc_find_rsc_table(rproc, fw, &tablesz); table = rproc_find_rsc_table(rproc, fw, &tablesz);
if (!table) { if (!table)
goto clean_up; goto clean_up;
}
/* Verify that resource table in loaded fw is unchanged */ /* Verify that resource table in loaded fw is unchanged */
if (rproc->table_csum != crc32(0, table, tablesz)) { if (rproc->table_csum != crc32(0, table, tablesz)) {
...@@ -911,7 +903,8 @@ static void rproc_fw_config_virtio(const struct firmware *fw, void *context) ...@@ -911,7 +903,8 @@ static void rproc_fw_config_virtio(const struct firmware *fw, void *context)
/* count the number of notify-ids */ /* count the number of notify-ids */
rproc->max_notifyid = -1; rproc->max_notifyid = -1;
ret = rproc_handle_resources(rproc, tablesz, rproc_count_vrings_handler); ret = rproc_handle_resources(rproc, tablesz,
rproc_count_vrings_handler);
if (ret) if (ret)
goto out; goto out;
...@@ -1268,10 +1261,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, ...@@ -1268,10 +1261,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name,
name_len = strlen(name) + strlen(template) - 2 + 1; name_len = strlen(name) + strlen(template) - 2 + 1;
rproc = kzalloc(sizeof(struct rproc) + len + name_len, GFP_KERNEL); rproc = kzalloc(sizeof(struct rproc) + len + name_len, GFP_KERNEL);
if (!rproc) { if (!rproc)
dev_err(dev, "%s: kzalloc failed\n", __func__);
return NULL; return NULL;
}
if (!firmware) { if (!firmware) {
p = (char *)rproc + sizeof(struct rproc) + len; p = (char *)rproc + sizeof(struct rproc) + len;
......
...@@ -35,7 +35,7 @@ struct rproc; ...@@ -35,7 +35,7 @@ struct rproc;
* @get_boot_addr: get boot address to entry point specified in firmware * @get_boot_addr: get boot address to entry point specified in firmware
*/ */
struct rproc_fw_ops { struct rproc_fw_ops {
struct resource_table *(*find_rsc_table) (struct rproc *rproc, struct resource_table *(*find_rsc_table)(struct rproc *rproc,
const struct firmware *fw, const struct firmware *fw,
int *tablesz); int *tablesz);
struct resource_table *(*find_loaded_rsc_table)(struct rproc *rproc, struct resource_table *(*find_loaded_rsc_table)(struct rproc *rproc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment