All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] scsi_register return code check
@ 2006-09-11 11:38 Amol Lad
  2006-09-11 13:40 ` Richard Knutsson
  0 siblings, 1 reply; 2+ messages in thread
From: Amol Lad @ 2006-09-11 11:38 UTC (permalink / raw)
  To: kernel-janitors

Audited return codes for scsi_register and found only 2 defaulters

Tested with
- allmodconfig
- Tweaking Kconfig to make sure the changes do not produce any
errors/warnings

Signed-off-by: Amol Lad <amol@verismonetworks.com>
---
 drivers/scsi/gdth.c        |    9 +++++++++
 drivers/scsi/mac_scsi.c    |    4 ++++
 include/linux/utsrelease.h |    1 +
 3 files changed, 14 insertions(+)
---
diff -uprN -X linux-2.6.18-rc6-orig/Documentation/dontdiff linux-2.6.18-rc6-orig/drivers/scsi/gdth.c linux-2.6.18-rc6/drivers/scsi/gdth.c
--- linux-2.6.18-rc6-orig/drivers/scsi/gdth.c	2006-09-11 11:07:25.000000000 +0530
+++ linux-2.6.18-rc6/drivers/scsi/gdth.c	2006-09-11 16:47:08.000000000 +0530
@@ -4440,6 +4440,9 @@ static int __init gdth_detect(Scsi_Host_
                     /* register addit. SCSI channels as virtual controllers */
                     for (b = 1; b < ha->bus_cnt + 1; ++b) {
                         shp = scsi_register(shtp,sizeof(gdth_num_str));
+                        if (shp = NULL)
+                            continue;
+
                         shp->unchecked_isa_dma = 1;
                         shp->irq = ha->irq;
                         shp->dma_channel = ha->drq;
@@ -4564,6 +4567,9 @@ static int __init gdth_detect(Scsi_Host_
                     /* register addit. SCSI channels as virtual controllers */
                     for (b = 1; b < ha->bus_cnt + 1; ++b) {
                         shp = scsi_register(shtp,sizeof(gdth_num_str));
+                        if (shp = NULL)
+                            continue;
+
                         shp->unchecked_isa_dma = 0;
                         shp->irq = ha->irq;
                         shp->dma_channel = 0xff;
@@ -4703,6 +4709,9 @@ static int __init gdth_detect(Scsi_Host_
             /* register addit. SCSI channels as virtual controllers */
             for (b = 1; b < ha->bus_cnt + 1; ++b) {
                 shp = scsi_register(shtp,sizeof(gdth_num_str));
+                if (shp = NULL)
+                    continue;
+
                 shp->unchecked_isa_dma = 0;
                 shp->irq = ha->irq;
                 shp->dma_channel = 0xff;
diff -uprN -X linux-2.6.18-rc6-orig/Documentation/dontdiff linux-2.6.18-rc6-orig/drivers/scsi/mac_scsi.c linux-2.6.18-rc6/drivers/scsi/mac_scsi.c
--- linux-2.6.18-rc6-orig/drivers/scsi/mac_scsi.c	2006-09-11 11:07:26.000000000 +0530
+++ linux-2.6.18-rc6/drivers/scsi/mac_scsi.c	2006-09-11 16:48:02.000000000 +0530
@@ -265,6 +265,10 @@ int macscsi_detect(struct scsi_host_temp
     /* Once we support multiple 5380s (e.g. DuoDock) we'll do
        something different here */
     instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
+    if (instance = NULL) {
+        printk(KERN_ERR "mac_scsi: scsi_register failed.\n");
+        return 0;
+    }
 #if NDEBUG
     default_instance = instance;
 #endif
diff -uprN -X linux-2.6.18-rc6-orig/Documentation/dontdiff linux-2.6.18-rc6-orig/include/linux/utsrelease.h linux-2.6.18-rc6/include/linux/utsrelease.h
--- linux-2.6.18-rc6-orig/include/linux/utsrelease.h	1970-01-01 05:30:00.000000000 +0530
+++ linux-2.6.18-rc6/include/linux/utsrelease.h	2006-09-11 15:57:19.000000000 +0530
@@ -0,0 +1 @@
+#define UTS_RELEASE "2.6.18-rc6"


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [PATCH] scsi_register return code check
  2006-09-11 11:38 [KJ] [PATCH] scsi_register return code check Amol Lad
@ 2006-09-11 13:40 ` Richard Knutsson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Knutsson @ 2006-09-11 13:40 UTC (permalink / raw)
  To: kernel-janitors

Amol Lad wrote:

>Audited return codes for scsi_register and found only 2 defaulters
>
>Tested with
>- allmodconfig
>- Tweaking Kconfig to make sure the changes do not produce any
>errors/warnings
>
>Signed-off-by: Amol Lad <amol@verismonetworks.com>
>---
> drivers/scsi/gdth.c        |    9 +++++++++
> drivers/scsi/mac_scsi.c    |    4 ++++
> include/linux/utsrelease.h |    1 +
> 3 files changed, 14 insertions(+)
>---
>diff -uprN -X linux-2.6.18-rc6-orig/Documentation/dontdiff linux-2.6.18-rc6-orig/drivers/scsi/gdth.c linux-2.6.18-rc6/drivers/scsi/gdth.c
>--- linux-2.6.18-rc6-orig/drivers/scsi/gdth.c	2006-09-11 11:07:25.000000000 +0530
>+++ linux-2.6.18-rc6/drivers/scsi/gdth.c	2006-09-11 16:47:08.000000000 +0530
>@@ -4440,6 +4440,9 @@ static int __init gdth_detect(Scsi_Host_
>                     /* register addit. SCSI channels as virtual controllers */
>                     for (b = 1; b < ha->bus_cnt + 1; ++b) {
>                         shp = scsi_register(shtp,sizeof(gdth_num_str));
>+                        if (shp = NULL)
>  
>
Think it should be "if (!shp)".

>+                            continue;
>+
>                         shp->unchecked_isa_dma = 1;
>                         shp->irq = ha->irq;
>                         shp->dma_channel = ha->drq;
>@@ -4564,6 +4567,9 @@ static int __init gdth_detect(Scsi_Host_
>                     /* register addit. SCSI channels as virtual controllers */
>                     for (b = 1; b < ha->bus_cnt + 1; ++b) {
>                         shp = scsi_register(shtp,sizeof(gdth_num_str));
>+                        if (shp = NULL)
>  
>
and here

>+                            continue;
>+
>                         shp->unchecked_isa_dma = 0;
>                         shp->irq = ha->irq;
>                         shp->dma_channel = 0xff;
>@@ -4703,6 +4709,9 @@ static int __init gdth_detect(Scsi_Host_
>             /* register addit. SCSI channels as virtual controllers */
>             for (b = 1; b < ha->bus_cnt + 1; ++b) {
>                 shp = scsi_register(shtp,sizeof(gdth_num_str));
>+                if (shp = NULL)
>  
>
and here

>+                    continue;
>+
>                 shp->unchecked_isa_dma = 0;
>                 shp->irq = ha->irq;
>                 shp->dma_channel = 0xff;
>diff -uprN -X linux-2.6.18-rc6-orig/Documentation/dontdiff linux-2.6.18-rc6-orig/drivers/scsi/mac_scsi.c linux-2.6.18-rc6/drivers/scsi/mac_scsi.c
>--- linux-2.6.18-rc6-orig/drivers/scsi/mac_scsi.c	2006-09-11 11:07:26.000000000 +0530
>+++ linux-2.6.18-rc6/drivers/scsi/mac_scsi.c	2006-09-11 16:48:02.000000000 +0530
>@@ -265,6 +265,10 @@ int macscsi_detect(struct scsi_host_temp
>     /* Once we support multiple 5380s (e.g. DuoDock) we'll do
>        something different here */
>     instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
>+    if (instance = NULL) {
>  
>
and "if (!instance) {"

>+        printk(KERN_ERR "mac_scsi: scsi_register failed.\n");
>+        return 0;
>+    }
> #if NDEBUG
>     default_instance = instance;
> #endif
>diff -uprN -X linux-2.6.18-rc6-orig/Documentation/dontdiff linux-2.6.18-rc6-orig/include/linux/utsrelease.h linux-2.6.18-rc6/include/linux/utsrelease.h
>--- linux-2.6.18-rc6-orig/include/linux/utsrelease.h	1970-01-01 05:30:00.000000000 +0530
>+++ linux-2.6.18-rc6/include/linux/utsrelease.h	2006-09-11 15:57:19.000000000 +0530
>@@ -0,0 +1 @@
>+#define UTS_RELEASE "2.6.18-rc6"
>  
>
This is an autogenerated file. For some reason it has not been included 
in the "dontdiff"-file.

cu
Richard Knutsson

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2006-09-11 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-11 11:38 [KJ] [PATCH] scsi_register return code check Amol Lad
2006-09-11 13:40 ` Richard Knutsson

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.