linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch: sh: drivers: dma: dma-api.c: Changed preferred function strscpy over strlcpy issue arch: sh: drivers: dma: dma-sysfs.c: Changed preferred function simple_strtoul over kstrtout issue arch: sh: drivers: dma: dmabrg.c: Fixed pointer declaration code issue arch: sh: drivers: heartbeat.c: Fixed preferred unsigned int over unsigned issue
@ 2021-09-10 17:17 Siddhartha Das
  0 siblings, 0 replies; only message in thread
From: Siddhartha Das @ 2021-09-10 17:17 UTC (permalink / raw)
  To: ysato; +Cc: linux-sh, linux-kernel, Siddhartha Das

Fixed Code style issues and prefer cases

Signed-off-by: Siddhartha Das <siddhartha.das.min19@itbhu.ac.in>
---
 arch/sh/drivers/dma/dma-api.c   | 2 +-
 arch/sh/drivers/dma/dma-sysfs.c | 2 +-
 arch/sh/drivers/dma/dmabrg.c    | 2 +-
 arch/sh/drivers/heartbeat.c     | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c
index ab9170494dcc..89cd4a3b4cca 100644
--- a/arch/sh/drivers/dma/dma-api.c
+++ b/arch/sh/drivers/dma/dma-api.c
@@ -198,7 +198,7 @@ int request_dma(unsigned int chan, const char *dev_id)
 	if (atomic_xchg(&channel->busy, 1))
 		return -EBUSY;
 
-	strlcpy(channel->dev_id, dev_id, sizeof(channel->dev_id));
+	strscpy(channel->dev_id, dev_id, sizeof(channel->dev_id));
 
 	if (info->ops->request) {
 		result = info->ops->request(channel);
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c
index 8ef318150f84..6d20f2ed3b7a 100644
--- a/arch/sh/drivers/dma/dma-sysfs.c
+++ b/arch/sh/drivers/dma/dma-sysfs.c
@@ -80,7 +80,7 @@ static ssize_t dma_store_config(struct device *dev,
 	struct dma_channel *channel = to_dma_channel(dev);
 	unsigned long config;
 
-	config = simple_strtoul(buf, NULL, 0);
+	config = kstrtoul(buf, NULL, 0);
 	dma_configure_channel(channel->vchan, config);
 
 	return count;
diff --git a/arch/sh/drivers/dma/dmabrg.c b/arch/sh/drivers/dma/dmabrg.c
index 5b2c1fd254d7..04c66a8d893f 100644
--- a/arch/sh/drivers/dma/dmabrg.c
+++ b/arch/sh/drivers/dma/dmabrg.c
@@ -122,7 +122,7 @@ static void dmabrg_enable_irq(unsigned int dmairq)
 	__raw_writel(dcr, DMABRGCR);
 }
 
-int dmabrg_request_irq(unsigned int dmairq, void(*handler)(void*),
+int dmabrg_request_irq(unsigned int dmairq, void(*handler)(void *),
 		       void *data)
 {
 	if ((dmairq > 9) || !handler)
diff --git a/arch/sh/drivers/heartbeat.c b/arch/sh/drivers/heartbeat.c
index 24391b444b28..07f04ed0d517 100644
--- a/arch/sh/drivers/heartbeat.c
+++ b/arch/sh/drivers/heartbeat.c
@@ -30,7 +30,7 @@
 static unsigned char default_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
 
 static inline void heartbeat_toggle_bit(struct heartbeat_data *hd,
-					unsigned bit, unsigned int inverted)
+					unsigned int bit, unsigned int inverted)
 {
 	unsigned int new;
 
@@ -59,7 +59,7 @@ static inline void heartbeat_toggle_bit(struct heartbeat_data *hd,
 static void heartbeat_timer(struct timer_list *t)
 {
 	struct heartbeat_data *hd = from_timer(hd, t, timer);
-	static unsigned bit = 0, up = 1;
+	static unsigned int bit = 0, up = 1;
 
 	heartbeat_toggle_bit(hd, bit, hd->flags & HEARTBEAT_INVERTED);
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-10 17:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 17:17 [PATCH] arch: sh: drivers: dma: dma-api.c: Changed preferred function strscpy over strlcpy issue arch: sh: drivers: dma: dma-sysfs.c: Changed preferred function simple_strtoul over kstrtout issue arch: sh: drivers: dma: dmabrg.c: Fixed pointer declaration code issue arch: sh: drivers: heartbeat.c: Fixed preferred unsigned int over unsigned issue Siddhartha Das

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).