* [PATCH 0/3] remoteproc checkpatch fixes
@ 2015-02-27 23:18 Suman Anna
2015-02-27 23:18 ` [PATCH 1/3] remoteproc/ste: add blank lines after declarations Suman Anna
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Suman Anna @ 2015-02-27 23:18 UTC (permalink / raw)
To: Ohad Ben-Cohen; +Cc: linux-kernel, Suman Anna
Hi Ohad,
Please find couple of patches to fix a number of checkpatch
warnings that have crept back into the remoteproc code. Note
that I haven't fixed the warnings thrown with --strict option.
regards
Suman
Suman Anna (3):
remoteproc/ste: add blank lines after declarations
remoteproc/davinci: fix quoted split string checkpatch warning
remoteproc: fix various checkpatch warnings
drivers/remoteproc/da8xx_remoteproc.c | 3 +--
drivers/remoteproc/remoteproc_core.c | 27 +++++++++------------------
drivers/remoteproc/remoteproc_internal.h | 2 +-
drivers/remoteproc/ste_modem_rproc.c | 4 ++--
4 files changed, 13 insertions(+), 23 deletions(-)
--
2.3.0
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 1/3] remoteproc/ste: add blank lines after declarations 2015-02-27 23:18 [PATCH 0/3] remoteproc checkpatch fixes Suman Anna @ 2015-02-27 23:18 ` Suman Anna 2015-02-27 23:26 ` Joe Perches 2015-02-27 23:18 ` [PATCH 2/3] remoteproc/davinci: fix quoted split string checkpatch warning Suman Anna ` (2 subsequent siblings) 3 siblings, 1 reply; 9+ messages in thread From: Suman Anna @ 2015-02-27 23:18 UTC (permalink / raw) To: Ohad Ben-Cohen; +Cc: linux-kernel, Suman Anna Fix couple of checkpatch warnings of the type, "WARNING: Missing a blank line after declarations" Signed-off-by: Suman Anna <s-anna@ti.com> --- drivers/remoteproc/ste_modem_rproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/ste_modem_rproc.c b/drivers/remoteproc/ste_modem_rproc.c index 16b7b7bd805b..cdfcb3f84b3b 100644 --- a/drivers/remoteproc/ste_modem_rproc.c +++ b/drivers/remoteproc/ste_modem_rproc.c @@ -67,8 +67,7 @@ static int sproc_load_segments(struct rproc *rproc, const struct firmware *fw) static const struct ste_toc_entry *sproc_find_rsc_entry(const void *data) { int i; - const struct ste_toc *toc; - toc = data; + const struct ste_toc *toc = data; /* Search the table for the resource table */ for (i = 0; i < SPROC_MAX_TOC_ENTRIES && @@ -230,6 +229,7 @@ static int sproc_start(struct rproc *rproc) static int sproc_stop(struct rproc *rproc) { struct sproc *sproc = rproc->priv; + sproc_dbg(sproc, "stop ste-modem\n"); return sproc->mdev->ops.power(sproc->mdev, false); -- 2.3.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] remoteproc/ste: add blank lines after declarations 2015-02-27 23:18 ` [PATCH 1/3] remoteproc/ste: add blank lines after declarations Suman Anna @ 2015-02-27 23:26 ` Joe Perches 2015-03-02 16:50 ` Suman Anna 0 siblings, 1 reply; 9+ messages in thread From: Joe Perches @ 2015-02-27 23:26 UTC (permalink / raw) To: Suman Anna; +Cc: Ohad Ben-Cohen, linux-kernel On Fri, 2015-02-27 at 17:18 -0600, Suman Anna wrote: > Fix couple of checkpatch warnings of the type, > "WARNING: Missing a blank line after declarations" [] > diff --git a/drivers/remoteproc/ste_modem_rproc.c b/drivers/remoteproc/ste_modem_rproc.c [] > @@ -230,6 +229,7 @@ static int sproc_start(struct rproc *rproc) > static int sproc_stop(struct rproc *rproc) > { > struct sproc *sproc = rproc->priv; > + > sproc_dbg(sproc, "stop ste-modem\n"); You could probably delete this sproc_dbg statement too as it duplicates function tracing. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] remoteproc/ste: add blank lines after declarations 2015-02-27 23:26 ` Joe Perches @ 2015-03-02 16:50 ` Suman Anna 0 siblings, 0 replies; 9+ messages in thread From: Suman Anna @ 2015-03-02 16:50 UTC (permalink / raw) To: Joe Perches; +Cc: Ohad Ben-Cohen, linux-kernel On 02/27/2015 05:26 PM, Joe Perches wrote: > On Fri, 2015-02-27 at 17:18 -0600, Suman Anna wrote: >> Fix couple of checkpatch warnings of the type, >> "WARNING: Missing a blank line after declarations" > [] >> diff --git a/drivers/remoteproc/ste_modem_rproc.c b/drivers/remoteproc/ste_modem_rproc.c > [] >> @@ -230,6 +229,7 @@ static int sproc_start(struct rproc *rproc) >> static int sproc_stop(struct rproc *rproc) >> { >> struct sproc *sproc = rproc->priv; >> + >> sproc_dbg(sproc, "stop ste-modem\n"); > > You could probably delete this sproc_dbg > statement too as it duplicates function tracing. Thanks for the comment, I will leave that to be done in a different cleanup patch. regards Suman ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] remoteproc/davinci: fix quoted split string checkpatch warning 2015-02-27 23:18 [PATCH 0/3] remoteproc checkpatch fixes Suman Anna 2015-02-27 23:18 ` [PATCH 1/3] remoteproc/ste: add blank lines after declarations Suman Anna @ 2015-02-27 23:18 ` Suman Anna 2015-02-27 23:27 ` Joe Perches 2015-02-27 23:18 ` [PATCH 3/3] remoteproc: fix various checkpatch warnings Suman Anna 2015-05-02 8:16 ` [PATCH 0/3] remoteproc checkpatch fixes Ohad Ben-Cohen 3 siblings, 1 reply; 9+ messages in thread From: Suman Anna @ 2015-02-27 23:18 UTC (permalink / raw) To: Ohad Ben-Cohen; +Cc: linux-kernel, Suman Anna Fix the following checkpatch warning, WARNING: quoted string split across lines + "\n\t\tName of DSP firmware file in /lib/firmware" + " (if not specified defaults to 'rproc-dsp-fw')"); Signed-off-by: Suman Anna <s-anna@ti.com> --- drivers/remoteproc/da8xx_remoteproc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c index 89fd057e5f1d..71a65175cbac 100644 --- a/drivers/remoteproc/da8xx_remoteproc.c +++ b/drivers/remoteproc/da8xx_remoteproc.c @@ -26,8 +26,7 @@ static char *da8xx_fw_name; module_param(da8xx_fw_name, charp, S_IRUGO); MODULE_PARM_DESC(da8xx_fw_name, - "\n\t\tName of DSP firmware file in /lib/firmware" - " (if not specified defaults to 'rproc-dsp-fw')"); + "\n\t\tName of DSP firmware file in /lib/firmware (if not specified defaults to 'rproc-dsp-fw')"); /* * OMAP-L138 Technical References: -- 2.3.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] remoteproc/davinci: fix quoted split string checkpatch warning 2015-02-27 23:18 ` [PATCH 2/3] remoteproc/davinci: fix quoted split string checkpatch warning Suman Anna @ 2015-02-27 23:27 ` Joe Perches 2015-03-02 16:52 ` Suman Anna 0 siblings, 1 reply; 9+ messages in thread From: Joe Perches @ 2015-02-27 23:27 UTC (permalink / raw) To: Suman Anna; +Cc: Ohad Ben-Cohen, linux-kernel On Fri, 2015-02-27 at 17:18 -0600, Suman Anna wrote: > Fix the following checkpatch warning, > WARNING: quoted string split across lines > + "\n\t\tName of DSP firmware file in /lib/firmware" > + " (if not specified defaults to 'rproc-dsp-fw')"); [] > diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c [] > @@ -26,8 +26,7 @@ > static char *da8xx_fw_name; > module_param(da8xx_fw_name, charp, S_IRUGO); > MODULE_PARM_DESC(da8xx_fw_name, > - "\n\t\tName of DSP firmware file in /lib/firmware" > - " (if not specified defaults to 'rproc-dsp-fw')"); > + "\n\t\tName of DSP firmware file in /lib/firmware (if not specified defaults to 'rproc-dsp-fw')"); There's probably no value in the leading "\n\t\t" ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] remoteproc/davinci: fix quoted split string checkpatch warning 2015-02-27 23:27 ` Joe Perches @ 2015-03-02 16:52 ` Suman Anna 0 siblings, 0 replies; 9+ messages in thread From: Suman Anna @ 2015-03-02 16:52 UTC (permalink / raw) To: Joe Perches; +Cc: Ohad Ben-Cohen, linux-kernel On 02/27/2015 05:27 PM, Joe Perches wrote: > On Fri, 2015-02-27 at 17:18 -0600, Suman Anna wrote: >> Fix the following checkpatch warning, >> WARNING: quoted string split across lines >> + "\n\t\tName of DSP firmware file in /lib/firmware" >> + " (if not specified defaults to 'rproc-dsp-fw')"); > [] >> diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c > [] >> @@ -26,8 +26,7 @@ >> static char *da8xx_fw_name; >> module_param(da8xx_fw_name, charp, S_IRUGO); >> MODULE_PARM_DESC(da8xx_fw_name, >> - "\n\t\tName of DSP firmware file in /lib/firmware" >> - " (if not specified defaults to 'rproc-dsp-fw')"); >> + "\n\t\tName of DSP firmware file in /lib/firmware (if not specified defaults to 'rproc-dsp-fw')"); > > There's probably no value in the leading "\n\t\t" Agreed. Ohad, Let me know if you want that in a different patch, otherwise, you can probably fix this up when applying. regards Suman ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] remoteproc: fix various checkpatch warnings 2015-02-27 23:18 [PATCH 0/3] remoteproc checkpatch fixes Suman Anna 2015-02-27 23:18 ` [PATCH 1/3] remoteproc/ste: add blank lines after declarations Suman Anna 2015-02-27 23:18 ` [PATCH 2/3] remoteproc/davinci: fix quoted split string checkpatch warning Suman Anna @ 2015-02-27 23:18 ` Suman Anna 2015-05-02 8:16 ` [PATCH 0/3] remoteproc checkpatch fixes Ohad Ben-Cohen 3 siblings, 0 replies; 9+ messages in thread From: Suman Anna @ 2015-02-27 23:18 UTC (permalink / raw) To: Ohad Ben-Cohen; +Cc: linux-kernel, Suman Anna 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> --- drivers/remoteproc/remoteproc_core.c | 27 +++++++++------------------ drivers/remoteproc/remoteproc_internal.h | 2 +- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 3cd85a638afa..fd824fc2fc45 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -143,8 +143,6 @@ static void rproc_disable_iommu(struct rproc *rproc) iommu_detach_device(domain, dev); iommu_domain_free(domain); - - return; } /* @@ -422,10 +420,8 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, } trace = kzalloc(sizeof(*trace), GFP_KERNEL); - if (!trace) { - dev_err(dev, "kzalloc trace failed\n"); + if (!trace) return -ENOMEM; - } /* set the trace buffer dma properties */ trace->len = rsc->len; @@ -500,10 +496,8 @@ static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc, } mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); - if (!mapping) { - dev_err(dev, "kzalloc mapping failed\n"); + if (!mapping) return -ENOMEM; - } ret = iommu_map(rproc->domain, rsc->da, rsc->pa, rsc->len, rsc->flags); if (ret) { @@ -576,10 +570,8 @@ static int rproc_handle_carveout(struct rproc *rproc, rsc->da, rsc->pa, rsc->len, rsc->flags); carveout = kzalloc(sizeof(*carveout), GFP_KERNEL); - if (!carveout) { - dev_err(dev, "kzalloc carveout failed\n"); + if (!carveout) return -ENOMEM; - } va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL); if (!va) { @@ -779,7 +771,8 @@ static void rproc_resource_cleanup(struct rproc *rproc) /* clean up carveout allocations */ 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); kfree(entry); } @@ -819,9 +812,8 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw) /* look for the resource table */ table = rproc_find_rsc_table(rproc, fw, &tablesz); - if (!table) { + if (!table) goto clean_up; - } /* Verify that resource table in loaded fw is unchanged */ if (rproc->table_csum != crc32(0, table, tablesz)) { @@ -922,7 +914,8 @@ static void rproc_fw_config_virtio(const struct firmware *fw, void *context) /* count the number of notify-ids */ 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) goto out; @@ -1279,10 +1272,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, name_len = strlen(name) + strlen(template) - 2 + 1; rproc = kzalloc(sizeof(struct rproc) + len + name_len, GFP_KERNEL); - if (!rproc) { - dev_err(dev, "%s: kzalloc failed\n", __func__); + if (!rproc) return NULL; - } if (!firmware) { p = (char *)rproc + sizeof(struct rproc) + len; diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index 70701a50ddfa..8041b95cb058 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -35,7 +35,7 @@ struct rproc; * @get_boot_addr: get boot address to entry point specified in firmware */ 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, int *tablesz); struct resource_table *(*find_loaded_rsc_table)(struct rproc *rproc, -- 2.3.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] remoteproc checkpatch fixes 2015-02-27 23:18 [PATCH 0/3] remoteproc checkpatch fixes Suman Anna ` (2 preceding siblings ...) 2015-02-27 23:18 ` [PATCH 3/3] remoteproc: fix various checkpatch warnings Suman Anna @ 2015-05-02 8:16 ` Ohad Ben-Cohen 3 siblings, 0 replies; 9+ messages in thread From: Ohad Ben-Cohen @ 2015-05-02 8:16 UTC (permalink / raw) To: Suman Anna; +Cc: linux-kernel@vger.kernel.org On Sat, Feb 28, 2015 at 1:18 AM, Suman Anna <s-anna@ti.com> wrote: > Suman Anna (3): > remoteproc/ste: add blank lines after declarations > remoteproc/davinci: fix quoted split string checkpatch warning > remoteproc: fix various checkpatch warnings Applied, thanks! ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-05-02 8:17 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-02-27 23:18 [PATCH 0/3] remoteproc checkpatch fixes Suman Anna 2015-02-27 23:18 ` [PATCH 1/3] remoteproc/ste: add blank lines after declarations Suman Anna 2015-02-27 23:26 ` Joe Perches 2015-03-02 16:50 ` Suman Anna 2015-02-27 23:18 ` [PATCH 2/3] remoteproc/davinci: fix quoted split string checkpatch warning Suman Anna 2015-02-27 23:27 ` Joe Perches 2015-03-02 16:52 ` Suman Anna 2015-02-27 23:18 ` [PATCH 3/3] remoteproc: fix various checkpatch warnings Suman Anna 2015-05-02 8:16 ` [PATCH 0/3] remoteproc checkpatch fixes Ohad Ben-Cohen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).