From: "Mutharaju, Prasanna (P.)" <mkarthi3@visteon.com>
To: "marcel@holtmann.org" <marcel@holtmann.org>,
"gustavo@padovan.org" <gustavo@padovan.org>,
"johan.hedberg@gmail.com" <johan.hedberg@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: [PATCH] bluetooth: bt3c_cs: clean up obsolete functions
Date: Fri, 11 Sep 2015 15:02:36 +0000 [thread overview]
Message-ID: <20150911150226.GA12951@ubuntu> (raw)
From: Prasanna Karthik <mkarthi3@visteon.com>
simple_strtoul is obsolete, use kstrtoul instead reported by checkpatch.
Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com>
---
drivers/bluetooth/bt3c_cs.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 7aab654..33b09be 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -453,7 +453,8 @@ static int bt3c_load_firmware(struct bt3c_info *info,
{
char *ptr =3D (char *) firmware;
char b[9];
- unsigned int iobase, size, addr, fcs, tmp;
+ unsigned int iobase, tmp;
+ unsigned long size, addr, fcs;
int i, err =3D 0;
=20
iobase =3D info->p_dev->resource[0]->start;
@@ -478,15 +479,18 @@ static int bt3c_load_firmware(struct bt3c_info *info,
=20
memset(b, 0, sizeof(b));
memcpy(b, ptr + 2, 2);
- size =3D simple_strtoul(b, NULL, 16);
+ if (kstrtoul(b, 16, &size) < 0)
+ return -EINVAL;
=20
memset(b, 0, sizeof(b));
memcpy(b, ptr + 4, 8);
- addr =3D simple_strtoul(b, NULL, 16);
+ if (kstrtoul(b, 16, &addr) < 0)
+ return -EINVAL;
=20
memset(b, 0, sizeof(b));
memcpy(b, ptr + (size * 2) + 2, 2);
- fcs =3D simple_strtoul(b, NULL, 16);
+ if (kstrtoul(b, 16, &fcs) < 0)
+ return -EINVAL;
=20
memset(b, 0, sizeof(b));
for (tmp =3D 0, i =3D 0; i < size; i++) {
--=20
1.7.0.4
next reply other threads:[~2015-09-11 15:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 15:02 Mutharaju, Prasanna (P.) [this message]
2015-09-12 8:47 ` [PATCH] bluetooth: bt3c_cs: clean up obsolete functions Marcel Holtmann
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=20150911150226.GA12951@ubuntu \
--to=mkarthi3@visteon.com \
--cc=gustavo@padovan.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.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 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.