* [PATCH] [SCSI] aic7xxx: use kstrdup()
@ 2011-08-06 15:32 Thomas Meyer
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Meyer @ 2011-08-06 15:32 UTC (permalink / raw)
To: linux-kernel, hare, linux-scsi
From: Thomas Meyer <thomas@m3y3r.de>
Use kstrdup rather than duplicating its implementation
The semantic patch that makes this output is available
in scripts/coccinelle/api/kstrdup.cocci.
More information about semantic patching is available at
http://coccinelle.lip6.fr/
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
diff -u -p a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c 2010-09-13 07:01:17.527194675 +0200
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c 2011-08-01 21:15:57.685101664 +0200
@@ -225,10 +225,9 @@ ahc_linux_pci_dev_probe(struct pci_dev *
ahc_get_pci_bus(pci),
ahc_get_pci_slot(pci),
ahc_get_pci_function(pci));
- name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
+ name = kstrdup(buf, GFP_ATOMIC);
if (name == NULL)
return (-ENOMEM);
- strcpy(name, buf);
ahc = ahc_alloc(NULL, name);
if (ahc == NULL)
return (-ENOMEM);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] [SCSI] aic7xxx: use kstrdup()
@ 2011-08-06 9:22 Thomas Meyer
2011-08-06 17:23 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Meyer @ 2011-08-06 9:22 UTC (permalink / raw)
To: hare, linux-kernel, linux-scsi
From: Thomas Meyer <thomas@m3y3r.de>
Use kstrdup rather than duplicating its implementation
The semantic patch that makes this output is available
in scripts/coccinelle/api/kstrdup.cocci.
More information about semantic patching is available at
http://coccinelle.lip6.fr/
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
diff -u -p a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
--- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2010-09-13 07:01:17.520528007 +0200
+++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2011-08-01 21:15:58.925094946 +0200
@@ -178,10 +178,9 @@ ahd_linux_pci_dev_probe(struct pci_dev *
ahd_get_pci_bus(pci),
ahd_get_pci_slot(pci),
ahd_get_pci_function(pci));
- name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
+ name = kstrdup(buf, GFP_ATOMIC);
if (name == NULL)
return (-ENOMEM);
- strcpy(name, buf);
ahd = ahd_alloc(NULL, name);
if (ahd == NULL)
return (-ENOMEM);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [SCSI] aic7xxx: use kstrdup()
2011-08-06 9:22 Thomas Meyer
@ 2011-08-06 17:23 ` James Bottomley
0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2011-08-06 17:23 UTC (permalink / raw)
To: Thomas Meyer; +Cc: hare, linux-kernel, linux-scsi
On Sat, 2011-08-06 at 11:22 +0200, Thomas Meyer wrote:
> From: Thomas Meyer <thomas@m3y3r.de>
>
> Use kstrdup rather than duplicating its implementation
>
> The semantic patch that makes this output is available
> in scripts/coccinelle/api/kstrdup.cocci.
>
> More information about semantic patching is available at
> http://coccinelle.lip6.fr/
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> ---
>
> diff -u -p a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
> --- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2010-09-13 07:01:17.520528007 +0200
> +++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2011-08-01 21:15:58.925094946 +0200
> @@ -178,10 +178,9 @@ ahd_linux_pci_dev_probe(struct pci_dev *
> ahd_get_pci_bus(pci),
> ahd_get_pci_slot(pci),
> ahd_get_pci_function(pci));
> - name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
> + name = kstrdup(buf, GFP_ATOMIC);
> if (name == NULL)
> return (-ENOMEM);
> - strcpy(name, buf);
All adaptec drivers are in deep maintenance mode because the hardware
isn't being produced any longer. The only things we really apply to
them now is essential bug fixes, which this isn't.
James
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-06 17:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-06 15:32 [PATCH] [SCSI] aic7xxx: use kstrdup() Thomas Meyer
-- strict thread matches above, loose matches on Subject: below --
2011-08-06 9:22 Thomas Meyer
2011-08-06 17:23 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox