Skip to contentSkip to conversation

bluetooth: bt3c_cs: clean up obsolete functions

PATCH In review Mutharaju, Prasanna (P.) 2 participants 2 messages Sep 11, 2015 – Sep 12, 2015 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bluetooth: bt3c_cs: clean up obsolete functions

From: Prasanna Karthik <[email protected]>

simple_strtoul is obsolete, use kstrtoul instead reported by checkpatch.

---
 drivers/bluetooth/bt3c_cs.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/bluetooth/bt3c_cs.c +2 -1
index 7aab654..33b09be 100644
@@ -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

maintainer
#1 lore raw

Hi Prasanna,

Quoted 6 lines

simple_strtoul is obsolete, use kstrtoul instead reported by checkpatch.

---
drivers/bluetooth/bt3c_cs.c | 12 ++++++++----

1 files changed, 8 insertions(+), 4 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel