From: Navya Sri Nizamkari <navyasri.tech@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Subject: [PATCH v2] Convert simple_strtoul to kstrtoul
Date: Thu, 19 Feb 2015 23:04:59 +0530 [thread overview]
Message-ID: <1424367299-11953-1-git-send-email-navyasri.tech@gmail.com> (raw)
This patch fixes the checkpatch.pl warning:
simple_strtoul is obsolete, use kstrtoul instead.
When the string is not converted(parsing error),the strings pointed to by ep and parport[n] are the same.This parsing error results in kstrtoul returning a non-zero value.
Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
---
Changes in v2:
-Added a descriptive commit message.
drivers/staging/media/parport/bw-qcam.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/media/parport/bw-qcam.c b/drivers/staging/media/parport/bw-qcam.c
index 67b9da1..1b81244 100644
--- a/drivers/staging/media/parport/bw-qcam.c
+++ b/drivers/staging/media/parport/bw-qcam.c
@@ -1106,10 +1106,8 @@ static int accept_bwqcam(struct parport *port)
if (parport[0] && strncmp(parport[0], "auto", 4) != 0) {
/* user gave parport parameters */
for (n = 0; n < MAX_CAMS && parport[n]; n++) {
- char *ep;
unsigned long r;
- r = simple_strtoul(parport[n], &ep, 0);
- if (ep == parport[n]) {
+ if (kstrtoul(parport[n],0,&r)) {
printk(KERN_ERR
"bw-qcam: bad port specifier \"%s\"\n",
parport[n]);
--
1.9.1
next reply other threads:[~2015-02-19 17:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-19 17:34 Navya Sri Nizamkari [this message]
2015-02-19 17:39 ` [Outreachy kernel] [PATCH v2] Convert simple_strtoul to kstrtoul Laurent Pinchart
2015-02-19 17:42 ` navya sri nizamkari
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=1424367299-11953-1-git-send-email-navyasri.tech@gmail.com \
--to=navyasri.tech@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.