All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bluetooth: bt3c_cs: clean up obsolete functions
@ 2015-09-11 15:02 Mutharaju, Prasanna (P.)
  2015-09-12  8:47 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Mutharaju, Prasanna (P.) @ 2015-09-11 15:02 UTC (permalink / raw)
  To: marcel@holtmann.org, gustavo@padovan.org, johan.hedberg@gmail.com
  Cc: linux-bluetooth@vger.kernel.org

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bluetooth: bt3c_cs: clean up obsolete functions
  2015-09-11 15:02 [PATCH] bluetooth: bt3c_cs: clean up obsolete functions Mutharaju, Prasanna (P.)
@ 2015-09-12  8:47 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2015-09-12  8:47 UTC (permalink / raw)
  To: Mutharaju, Prasanna (P.)
  Cc: Gustavo F. Padovan, Johan Hedberg,
	linux-bluetooth@vger.kernel.org

Hi Prasanna,

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

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-12  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11 15:02 [PATCH] bluetooth: bt3c_cs: clean up obsolete functions Mutharaju, Prasanna (P.)
2015-09-12  8:47 ` Marcel Holtmann

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.