Re: [PATCH 02/03] USB: make transfer_buffer_lengths in struct urb field u32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 7 Mar 2009, Roel Kluin wrote:

> After this the test below does no longer make sense.
> maybe more sense would make:
> 
> if (urb->transfer_buffer_length != 0)
> 
> Then ask and I'll send a different patch.
> ------------------------------>8-------------8<---------------------------------
> Now transfer_buffer_length has become unsigned, this test below will always
> fail, remove it.
> 
> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
> ---
> diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
> index 58bc5e3..e03cad1 100644
> --- a/drivers/usb/core/urb.c
> +++ b/drivers/usb/core/urb.c
> @@ -369,10 +369,6 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
>  		}
>  	}
>  
> -	/* the I/O buffer must be mapped/unmapped, except when length=0 */
> -	if (urb->transfer_buffer_length < 0)
> -		return -EMSGSIZE;
> -
>  #ifdef DEBUG
>  	/* stuff that drivers shouldn't do, but which shouldn't
>  	 * cause problems in HCDs if they get it wrong.

I agree, this test is now unnecessary.

There are a couple of other small things which should be changed as 
well:

	In hcd.c, rh_call_control() and rh_queue_status() contain
	a "len" variable which should now be unsigned rather than
	int.  The same is true for the "len" parameter of
	rh_string().

	In devio.c there's a dev_info() statement in which
	transfer_buffer_length is printed with a %d specification.
	It should now be %u.

All these changes could be wrapped up into a single patch.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux