lkml.org 
[lkml]   [2019]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] Staging: most: fix coding style issues
Date
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 v2:
- use a single snprintf
---
drivers/staging/most/core.c | 7 +++++--
drivers/staging/most/core.h | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index 86a8545c8d97..852f8788ce2e 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -299,13 +299,15 @@ 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);
+ type = ch_data_type[i].name;
}
- 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 +730,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
\
 
 \ /
  Last update: 2019-06-30 17:28    [W:0.100 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site