Re: [PATCH v4] Staging: most: fix coding style issues

2019-07-02 Thread Greg KH
On Tue, Jul 02, 2019 at 05:24:03AM -0700, Gabriel Beauchamp wrote:
> This is a patch for the core.[ch] files that fixes up warnings
> found with the checkpatch.pl tool.
> 
> Signed-off-by: Gabriel Beauchamp 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch did many different things all at once, making it difficult
  to review.  All Linux kernel patches need to only do one thing at a
  time.  If you need to do multiple things (such as clean up all coding
  style issues in a file/driver), do it in a sequence of patches, each
  one doing only one thing.  This will make it easier to review the
  patches to ensure that they are correct, and to help alleviate any
  merge issues that larger patches can cause.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot


[PATCH v4] Staging: most: fix coding style issues

2019-07-02 Thread Gabriel Beauchamp
This is a patch for the core.[ch] files that fixes up warnings
found with the checkpatch.pl tool.

Signed-off-by: Gabriel Beauchamp 
---
Changes in v4:
- fix a warning by making '*type' const
Changes in v3:
- add a break statement to preserve the control flow
Changes in v2:
- use a single snprintf
---
 drivers/staging/most/core.c | 11 ---
 drivers/staging/most/core.h |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index 86a8545c8d97..6a50e3090178 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -299,13 +299,17 @@ static ssize_t set_datatype_show(struct device *dev,
 char *buf)
 {
int i;
+   const char *type = "unconfigured\n";
+
struct most_channel *c = to_channel(dev);
 
for (i = 0; i < ARRAY_SIZE(ch_data_type); i++) {
-   if (c->cfg.data_type & ch_data_type[i].most_ch_data_type)
-   return snprintf(buf, PAGE_SIZE, "%s", 
ch_data_type[i].name);
+   if (c->cfg.data_type & ch_data_type[i].most_ch_data_type) {
+   type = ch_data_type[i].name;
+   break;
+   }
}
-   return snprintf(buf, PAGE_SIZE, "unconfigured\n");
+   return snprintf(buf, PAGE_SIZE, "%s", type);
 }
 
 static ssize_t set_subbuffer_size_show(struct device *dev,
@@ -728,6 +732,7 @@ int most_add_link(char *mdev, char *mdev_ch, char 
*comp_name, char *link_name,
 
return link_channel_to_component(c, comp, link_name, comp_param);
 }
+
 /**
  * remove_link_store - store function for remove_link attribute
  * @drv: device driver
diff --git a/drivers/staging/most/core.h b/drivers/staging/most/core.h
index 652aaa771029..6ba7c2b34c1c 100644
--- a/drivers/staging/most/core.h
+++ b/drivers/staging/most/core.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * most.h - API for component and adapter drivers
  *
-- 
2.21.0