From: Siddhartha Das <siddhartha.das.min19@itbhu.ac.in>
To: ysato@users.sourceforge.jp
Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org,
Siddhartha Das <siddhartha.das.min19@itbhu.ac.in>
Subject: [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
Date: Fri, 10 Sep 2021 22:47:33 +0530 [thread overview]
Message-ID: <20210910171733.105486-1-siddhartha.das.min19@itbhu.ac.in> (raw)
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
reply other threads:[~2021-09-10 17:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210910171733.105486-1-siddhartha.das.min19@itbhu.ac.in \
--to=siddhartha.das.min19@itbhu.ac.in \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=ysato@users.sourceforge.jp \
/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;
as well as URLs for NNTP newsgroup(s).