All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.2-rc1-mm3] drivers/usb/storage/dpcm.c
@ 2004-01-25  5:03 Bryan Whitehead
  2004-01-25  8:41 ` Matthew Dharm
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Whitehead @ 2004-01-25  5:03 UTC (permalink / raw)
  To: mdharm-usb; +Cc: linux-kernel


In function dpcm_transport the compiler complains about ret not being used:
drivers/usb/storage/dpcm.c: In function `dpcm_transport':
drivers/usb/storage/dpcm.c:46: warning: unused variable `ret'

ret is not used if CONFIG_USB_STORAGE_SDDR09 is not set. Instead of adding
more ifdef's to the code this patch puts ret to use for the other 2 cases in
the switch statement (case 0 and default).

--- drivers/usb/storage/dpcm.c.orig     2004-01-24 20:51:40.631038904 -0800
+++ drivers/usb/storage/dpcm.c  2004-01-24 20:50:05.155553384 -0800
@@ -56,7 +56,8 @@ int dpcm_transport(Scsi_Cmnd *srb, struc
     /*
      * LUN 0 corresponds to the CompactFlash card reader.
      */
-    return usb_stor_CB_transport(srb, us);
+    ret = usb_stor_CB_transport(srb, us);
+    break;
  
 #ifdef CONFIG_USB_STORAGE_SDDR09
   case 1:
@@ -72,11 +73,12 @@ int dpcm_transport(Scsi_Cmnd *srb, struc
     ret = sddr09_transport(srb, us);
     srb->device->lun = 1; us->srb->device->lun = 1;
  
-    return ret;
+    break;
 #endif
  
   default:
     US_DEBUGP("dpcm_transport: Invalid LUN %d\n", srb->device->lun);
-    return USB_STOR_TRANSPORT_ERROR;
+    ret = USB_STOR_TRANSPORT_ERROR;
   }
+  return ret;
 }

--
Bryan Whitehead
driver@megahappy.net

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

* Re: [PATCH 2.6.2-rc1-mm3] drivers/usb/storage/dpcm.c
  2004-01-25  5:03 [PATCH 2.6.2-rc1-mm3] drivers/usb/storage/dpcm.c Bryan Whitehead
@ 2004-01-25  8:41 ` Matthew Dharm
  2004-01-25  9:00   ` Bryan Whitehead
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Dharm @ 2004-01-25  8:41 UTC (permalink / raw)
  To: Bryan Whitehead; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1904 bytes --]

One message a day to report a particular bug is really enough.... :)

That said, I think it would be better to add the ifdef's instead of more
substantial code changes.

Matt

On Sat, Jan 24, 2004 at 09:03:42PM -0800, Bryan Whitehead wrote:
> 
> In function dpcm_transport the compiler complains about ret not being used:
> drivers/usb/storage/dpcm.c: In function `dpcm_transport':
> drivers/usb/storage/dpcm.c:46: warning: unused variable `ret'
> 
> ret is not used if CONFIG_USB_STORAGE_SDDR09 is not set. Instead of adding
> more ifdef's to the code this patch puts ret to use for the other 2 cases in
> the switch statement (case 0 and default).
> 
> --- drivers/usb/storage/dpcm.c.orig     2004-01-24 20:51:40.631038904 -0800
> +++ drivers/usb/storage/dpcm.c  2004-01-24 20:50:05.155553384 -0800
> @@ -56,7 +56,8 @@ int dpcm_transport(Scsi_Cmnd *srb, struc
>      /*
>       * LUN 0 corresponds to the CompactFlash card reader.
>       */
> -    return usb_stor_CB_transport(srb, us);
> +    ret = usb_stor_CB_transport(srb, us);
> +    break;
>   
>  #ifdef CONFIG_USB_STORAGE_SDDR09
>    case 1:
> @@ -72,11 +73,12 @@ int dpcm_transport(Scsi_Cmnd *srb, struc
>      ret = sddr09_transport(srb, us);
>      srb->device->lun = 1; us->srb->device->lun = 1;
>   
> -    return ret;
> +    break;
>  #endif
>   
>    default:
>      US_DEBUGP("dpcm_transport: Invalid LUN %d\n", srb->device->lun);
> -    return USB_STOR_TRANSPORT_ERROR;
> +    ret = USB_STOR_TRANSPORT_ERROR;
>    }
> +  return ret;
>  }
> 
> --
> Bryan Whitehead
> driver@megahappy.net
> 

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

E:  You run this ship with Windows?!  YOU IDIOT!
L:  Give me a break, it came bundled with the computer!
					-- ESR and Lan Solaris
User Friendly, 12/8/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH 2.6.2-rc1-mm3] drivers/usb/storage/dpcm.c
  2004-01-25  8:41 ` Matthew Dharm
@ 2004-01-25  9:00   ` Bryan Whitehead
  2004-01-26 18:12     ` Randy.Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Whitehead @ 2004-01-25  9:00 UTC (permalink / raw)
  To: Matthew Dharm; +Cc: linux-kernel

Matthew Dharm wrote:
> One message a day to report a particular bug is really enough.... :)
> 
> That said, I think it would be better to add the ifdef's instead of more
> substantial code changes.

No problemo, I was just getting my feet wet on small compiler warning 
fixes and the SubmitingPatches doc said ifdefs were from the devil. ;)

I'll sent a patch later sunday...

> 
> Matt
> 
> On Sat, Jan 24, 2004 at 09:03:42PM -0800, Bryan Whitehead wrote:
> 
>>In function dpcm_transport the compiler complains about ret not being used:
>>drivers/usb/storage/dpcm.c: In function `dpcm_transport':
>>drivers/usb/storage/dpcm.c:46: warning: unused variable `ret'
>>
>>ret is not used if CONFIG_USB_STORAGE_SDDR09 is not set. Instead of adding
>>more ifdef's to the code this patch puts ret to use for the other 2 cases in
>>the switch statement (case 0 and default).
>>
>>--- drivers/usb/storage/dpcm.c.orig     2004-01-24 20:51:40.631038904 -0800
>>+++ drivers/usb/storage/dpcm.c  2004-01-24 20:50:05.155553384 -0800
>>@@ -56,7 +56,8 @@ int dpcm_transport(Scsi_Cmnd *srb, struc
>>     /*
>>      * LUN 0 corresponds to the CompactFlash card reader.
>>      */
>>-    return usb_stor_CB_transport(srb, us);
>>+    ret = usb_stor_CB_transport(srb, us);
>>+    break;
>>  
>> #ifdef CONFIG_USB_STORAGE_SDDR09
>>   case 1:
>>@@ -72,11 +73,12 @@ int dpcm_transport(Scsi_Cmnd *srb, struc
>>     ret = sddr09_transport(srb, us);
>>     srb->device->lun = 1; us->srb->device->lun = 1;
>>  
>>-    return ret;
>>+    break;
>> #endif
>>  
>>   default:
>>     US_DEBUGP("dpcm_transport: Invalid LUN %d\n", srb->device->lun);
>>-    return USB_STOR_TRANSPORT_ERROR;
>>+    ret = USB_STOR_TRANSPORT_ERROR;
>>   }
>>+  return ret;
>> }
>>
>>--
>>Bryan Whitehead
>>driver@megahappy.net
>>
> 
> 


-- 
Bryan Whitehead
Email:driver@megahappy.net
WorkE:driver@jpl.nasa.gov

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

* Re: [PATCH 2.6.2-rc1-mm3] drivers/usb/storage/dpcm.c
  2004-01-25  9:00   ` Bryan Whitehead
@ 2004-01-26 18:12     ` Randy.Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy.Dunlap @ 2004-01-26 18:12 UTC (permalink / raw)
  To: Bryan Whitehead; +Cc: mdharm-kernel, linux-kernel

On Sun, 25 Jan 2004 01:00:09 -0800 Bryan Whitehead <driver@jpl.nasa.gov> wrote:

| Matthew Dharm wrote:
| > One message a day to report a particular bug is really enough.... :)
| > 
| > That said, I think it would be better to add the ifdef's instead of more
| > substantial code changes.
| 
| No problemo, I was just getting my feet wet on small compiler warning 
| fixes and the SubmitingPatches doc said ifdefs were from the devil. ;)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FWIW, I prefer Bryan's patch instead of the #ifdefs.

--
~Randy


| I'll sent a patch later sunday...
| 
| > 
| > Matt
| > 
| > On Sat, Jan 24, 2004 at 09:03:42PM -0800, Bryan Whitehead wrote:
| > 
| >>In function dpcm_transport the compiler complains about ret not being used:
| >>drivers/usb/storage/dpcm.c: In function `dpcm_transport':
| >>drivers/usb/storage/dpcm.c:46: warning: unused variable `ret'
| >>
| >>ret is not used if CONFIG_USB_STORAGE_SDDR09 is not set. Instead of adding
| >>more ifdef's to the code this patch puts ret to use for the other 2 cases in
| >>the switch statement (case 0 and default).
| >>
| >>--- drivers/usb/storage/dpcm.c.orig     2004-01-24 20:51:40.631038904 -0800
| >>+++ drivers/usb/storage/dpcm.c  2004-01-24 20:50:05.155553384 -0800
| >>@@ -56,7 +56,8 @@ int dpcm_transport(Scsi_Cmnd *srb, struc
| >>     /*
| >>      * LUN 0 corresponds to the CompactFlash card reader.
| >>      */
| >>-    return usb_stor_CB_transport(srb, us);
| >>+    ret = usb_stor_CB_transport(srb, us);
| >>+    break;
| >>  
| >> #ifdef CONFIG_USB_STORAGE_SDDR09
| >>   case 1:
| >>@@ -72,11 +73,12 @@ int dpcm_transport(Scsi_Cmnd *srb, struc
| >>     ret = sddr09_transport(srb, us);
| >>     srb->device->lun = 1; us->srb->device->lun = 1;
| >>  
| >>-    return ret;
| >>+    break;
| >> #endif
| >>  
| >>   default:
| >>     US_DEBUGP("dpcm_transport: Invalid LUN %d\n", srb->device->lun);
| >>-    return USB_STOR_TRANSPORT_ERROR;
| >>+    ret = USB_STOR_TRANSPORT_ERROR;
| >>   }
| >>+  return ret;
| >> }
| >>
| >>--

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

end of thread, other threads:[~2004-01-26 18:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-25  5:03 [PATCH 2.6.2-rc1-mm3] drivers/usb/storage/dpcm.c Bryan Whitehead
2004-01-25  8:41 ` Matthew Dharm
2004-01-25  9:00   ` Bryan Whitehead
2004-01-26 18:12     ` Randy.Dunlap

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.