public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Beauchamp <beauchampgabriel@gmail.com>
To: gregkh@linuxfoundation.org, christian.gromm@microchip.com,
	colin.king@canonical.com, gustavo@embeddedor.com,
	joe@perches.com
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Gabriel Beauchamp <beauchampgabriel@gmail.com>
Subject: [PATCH v3] Staging: most: fix coding style issues
Date: Sun, 30 Jun 2019 09:56:04 -0700	[thread overview]
Message-ID: <20190630165604.2452-1-beauchampgabriel@gmail.com> (raw)
In-Reply-To: <20190630152726.21092-1-beauchampgabriel@gmail.com>

This is a patch for the core.[ch] files that fixes up warnings
found with the checkpatch.pl tool.

Signed-off-by: Gabriel Beauchamp <beauchampgabriel@gmail.com>
---
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..eb18d4df8ad1 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;
+	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


  reply	other threads:[~2019-06-30 16:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-29 23:44 [PATCH] Staging: most: fix coding style issues Gabriel Beauchamp
2019-06-29 23:58 ` Joe Perches
2019-06-30 15:27   ` [PATCH v2] " Gabriel Beauchamp
2019-06-30 16:56     ` Gabriel Beauchamp [this message]
2019-07-01 13:41       ` [PATCH v3] " kbuild test robot
2019-07-01 17:40       ` kbuild test robot
2019-07-02 12:24       ` [PATCH v4] " Gabriel Beauchamp
2019-07-02 12:28         ` Greg KH
2019-07-23 13:43       ` [PATCH v3] " kbuild test robot
2019-08-08 14:23       ` kbuild test robot
2019-07-01  6:48     ` [PATCH v2] " Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190630165604.2452-1-beauchampgabriel@gmail.com \
    --to=beauchampgabriel@gmail.com \
    --cc=christian.gromm@microchip.com \
    --cc=colin.king@canonical.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox