aic7xxx: fix coccicheck warnings
Subsystems (2)
PATCH 1/1 aic7xxx: fix coccicheck warnings
This replaces a call to kmalloc() followed by memset() with just one call to kzalloc().
Signed-off-by Silviu-Mihai Popescu <[email protected]>
--- drivers/scsi/aic7xxx/aic79xx_osm.c | 3 +-- drivers/scsi/aic7xxx/aic7xxx_osm.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/aic7xxx/aic79xx_osm.c +1 -2
@@ -1324,10 +1324,9 @@ int ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg) { ahd->platform_data = -kmalloc (sizeof (struct ahd_platform_data ),GFP_ATOMIC ); +kzalloc (sizeof (struct ahd_platform_data ),GFP_ATOMIC );if (ahd->platform_data ==NULL )return (ENOMEM ); -memset (ahd->platform_data,0 ,sizeof (struct ahd_platform_data )); ahd->platform_data->irq =AHD_LINUX_NOIRQ ;ahd_lockinit (ahd); ahd->seltime = (aic79xx_seltime &0x3 ) <<4 ;
drivers/scsi/aic7xxx/aic7xxx_osm.c +1 -2
@@ -1222,10 +1222,9 @@ ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg) { ahc->platform_data = -kmalloc (sizeof (struct ahc_platform_data ),GFP_ATOMIC ); +kzalloc (sizeof (struct ahc_platform_data ),GFP_ATOMIC );if (ahc->platform_data ==NULL )return (ENOMEM ); -memset (ahc->platform_data,0 ,sizeof (struct ahc_platform_data )); ahc->platform_data->irq =AHC_LINUX_NOIRQ ;ahc_lockinit (ahc); ahc->seltime = (aic7xxx_seltime &0x3 ) <<4 ;
Signature · 1 line
1.7.9.5
Quoted 42 lines · Silviu-Mihai Popescu
This replaces a call to
kmalloc()followed bymemset()with just one call tokzalloc().Signed-off-by Silviu-Mihai Popescu <[email protected]>--- drivers/scsi/aic7xxx/aic79xx_osm.c | 3 +-- drivers/scsi/aic7xxx/aic7xxx_osm.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)drivers/scsi/aic7xxx/aic79xx_osm.c +1
-2@@ -1324,10 +1324,9 @@ int ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg) { ahd->platform_data = -kmalloc (sizeof (struct ahd_platform_data ),GFP_ATOMIC ); +kzalloc (sizeof (struct ahd_platform_data ),GFP_ATOMIC );if (ahd->platform_data ==NULL )return (ENOMEM ); -memset (ahd->platform_data,0 ,sizeof (struct ahd_platform_data )); ahd->platform_data->irq =AHD_LINUX_NOIRQ ;ahd_lockinit (ahd); ahd->seltime = (aic79xx_seltime &0x3 ) <<4 ;drivers/scsi/aic7xxx/aic7xxx_osm.c +1
-3@@ -1222,10 +1222,9 @@ ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg) { ahc->platform_data = -kmalloc (sizeof (struct ahc_platform_data ),GFP_ATOMIC ); +kzalloc (sizeof (struct ahc_platform_data ),GFP_ATOMIC );if (ahc->platform_data ==NULL )return (ENOMEM ); -memset (ahc->platform_data,0 ,sizeof (struct ahc_platform_data )); ahc->platform_data->irq =AHC_LINUX_NOIRQ ;ahc_lockinit (ahc); ahc->seltime = (aic7xxx_seltime &0x3 ) <<4 ; --
Quoted 2 lines
1.7.9.5
Hello,
Would anyone be so kind as to review this?
Thanks,
Silviu Popescu
James Bottomley
maintainerQuoted 49 lines · Silviu Popescu
Quoted 42 lines · Silviu-Mihai Popescu
This replaces a call to
kmalloc()followed bymemset()with just one call tokzalloc().Signed-off-by Silviu-Mihai Popescu <[email protected]>--- drivers/scsi/aic7xxx/aic79xx_osm.c | 3 +-- drivers/scsi/aic7xxx/aic7xxx_osm.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)drivers/scsi/aic7xxx/aic79xx_osm.c +1
-2@@ -1324,10 +1324,9 @@ int ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg) { ahd->platform_data = -kmalloc (sizeof (struct ahd_platform_data ),GFP_ATOMIC ); +kzalloc (sizeof (struct ahd_platform_data ),GFP_ATOMIC );if (ahd->platform_data ==NULL )return (ENOMEM ); -memset (ahd->platform_data,0 ,sizeof (struct ahd_platform_data )); ahd->platform_data->irq =AHD_LINUX_NOIRQ ;ahd_lockinit (ahd); ahd->seltime = (aic79xx_seltime &0x3 ) <<4 ;drivers/scsi/aic7xxx/aic7xxx_osm.c +1
-3@@ -1222,10 +1222,9 @@ ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg) { ahc->platform_data = -kmalloc (sizeof (struct ahc_platform_data ),GFP_ATOMIC ); +kzalloc (sizeof (struct ahc_platform_data ),GFP_ATOMIC );if (ahc->platform_data ==NULL )return (ENOMEM ); -memset (ahc->platform_data,0 ,sizeof (struct ahc_platform_data )); ahc->platform_data->irq =AHC_LINUX_NOIRQ ;ahc_lockinit (ahc); ahc->seltime = (aic7xxx_seltime &0x3 ) <<4 ; --Quoted 2 lines
1.7.9.5
Hello,
Quoted 1 line
Would anyone be so kind as to review this?
For the ancient drivers, like aic7xxx, we keep them in deep freeze maintenance, which means no cosmetic changes like this, I'm afraid.
Thanks,
James