Re: [PATCH 1/3] USB: usbtest - Add tests to ensure HCDs can accept byte aligned buffers.

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

 



On Sun, 16 Jan 2011 19:17:11 +0100
Martin Fuzzey <mfuzzey@xxxxxxxxx> wrote:

> Add a set of new tests similar to the existing ones but using
> transfer buffers at an "odd" address [ie offset of +1 from
> the buffer obtained by kmalloc() or usb_alloc_coherent()]
> 
> The new tests are:
> #17 : bulk out (like #1) using kmalloc and DMA mapping by USB core.
> #18 : bulk in (like #2) using kmalloc and DMA mapping by USB core.
> #19 : bulk out (like #1) using usb_alloc_coherent()
> #20 : bulk in (like #2) using usb_alloc_coherent()
> #21 : control write (like #14)
> #22 : isochonous out (like #15)
> #23 : isochonous in (like #16)
> 
> Signed-off-by: Martin Fuzzey <mfuzzey@xxxxxxxxx>
> 
> ...
>
> -static inline int simple_check_buf(struct usbtest_dev *tdev, struct urb *urb)
> +static inline unsigned buffer_offset(void *buf)
> +{
> +	return (unsigned)buf & (ARCH_KMALLOC_MINALIGN - 1);
> +}

drivers/usb/misc/usbtest.c: In function 'buffer_offset':
drivers/usb/misc/usbtest.c:273: warning: cast from pointer to integer of different size

That's easily enough fixed, but this is the only site in the kernel
outside the core slab implementation which uses ARCH_KMALLOC_MINALIGN. 
This is a good hint that the code is doing something wrong.

I can't advise as to what the code _should_ be doing because you didn't
bother documenting it, and I can't be bothered reverse-engineering it.
--
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