Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Suman Anna <s-anna@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>

authored by

Suman Anna and committed by
Ohad Ben-Cohen
172e6ab1 e17aee37

+10 -19
+9 -18
drivers/remoteproc/remoteproc_core.c
··· 132 132 133 133 iommu_detach_device(domain, dev); 134 134 iommu_domain_free(domain); 135 - 136 - return; 137 135 } 138 136 139 137 /* ··· 409 411 } 410 412 411 413 trace = kzalloc(sizeof(*trace), GFP_KERNEL); 412 - if (!trace) { 413 - dev_err(dev, "kzalloc trace failed\n"); 414 + if (!trace) 414 415 return -ENOMEM; 415 - } 416 416 417 417 /* set the trace buffer dma properties */ 418 418 trace->len = rsc->len; ··· 485 489 } 486 490 487 491 mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); 488 - if (!mapping) { 489 - dev_err(dev, "kzalloc mapping failed\n"); 492 + if (!mapping) 490 493 return -ENOMEM; 491 - } 492 494 493 495 ret = iommu_map(rproc->domain, rsc->da, rsc->pa, rsc->len, rsc->flags); 494 496 if (ret) { ··· 559 565 rsc->da, rsc->pa, rsc->len, rsc->flags); 560 566 561 567 carveout = kzalloc(sizeof(*carveout), GFP_KERNEL); 562 - if (!carveout) { 563 - dev_err(dev, "kzalloc carveout failed\n"); 568 + if (!carveout) 564 569 return -ENOMEM; 565 - } 566 570 567 571 va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL); 568 572 if (!va) { ··· 760 768 761 769 /* clean up carveout allocations */ 762 770 list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) { 763 - dma_free_coherent(dev->parent, entry->len, entry->va, entry->dma); 771 + dma_free_coherent(dev->parent, entry->len, entry->va, 772 + entry->dma); 764 773 list_del(&entry->node); 765 774 kfree(entry); 766 775 } ··· 801 808 802 809 /* look for the resource table */ 803 810 table = rproc_find_rsc_table(rproc, fw, &tablesz); 804 - if (!table) { 811 + if (!table) 805 812 goto clean_up; 806 - } 807 813 808 814 /* Verify that resource table in loaded fw is unchanged */ 809 815 if (rproc->table_csum != crc32(0, table, tablesz)) { ··· 903 911 904 912 /* count the number of notify-ids */ 905 913 rproc->max_notifyid = -1; 906 - ret = rproc_handle_resources(rproc, tablesz, rproc_count_vrings_handler); 914 + ret = rproc_handle_resources(rproc, tablesz, 915 + rproc_count_vrings_handler); 907 916 if (ret) 908 917 goto out; 909 918 ··· 1261 1268 name_len = strlen(name) + strlen(template) - 2 + 1; 1262 1269 1263 1270 rproc = kzalloc(sizeof(struct rproc) + len + name_len, GFP_KERNEL); 1264 - if (!rproc) { 1265 - dev_err(dev, "%s: kzalloc failed\n", __func__); 1271 + if (!rproc) 1266 1272 return NULL; 1267 - } 1268 1273 1269 1274 if (!firmware) { 1270 1275 p = (char *)rproc + sizeof(struct rproc) + len;
+1 -1
drivers/remoteproc/remoteproc_internal.h
··· 35 35 * @get_boot_addr: get boot address to entry point specified in firmware 36 36 */ 37 37 struct rproc_fw_ops { 38 - struct resource_table *(*find_rsc_table) (struct rproc *rproc, 38 + struct resource_table *(*find_rsc_table)(struct rproc *rproc, 39 39 const struct firmware *fw, 40 40 int *tablesz); 41 41 struct resource_table *(*find_loaded_rsc_table)(struct rproc *rproc,