Re: [PATCH 7/8] drivers/usb: Use FIELD_SIZEOF

Alexey Dobriyan <[email protected]> Mon, 11 Feb 2008 00:12:03 +0300
Newsgroups gmane.linux.kernel,gmane.linux.usb.devel,gmane.linux.kernel.janitors
Message-ID <[email protected]>
On Sun, Feb 10, 2008 at 09:15:09PM +0100, Julia Lawall wrote:
> --- a/drivers/usb/atm/usbatm.c
> +++ b/drivers/usb/atm/usbatm.c
> @@ -1349,7 +1349,7 @@ static int __init usbatm_usb_init(void)
>  {
>  	dbg("%s: driver version %s", __func__, DRIVER_VERSION);
>  
> -	if (sizeof(struct usbatm_control) > sizeof(((struct sk_buff *) 0)->cb)) {
> +	if (sizeof(struct usbatm_control) > FIELD_SIZEOF(struct sk_buff, cb)) {

NAK. Driver should BUILD_BUG_ON instead.

>  		printk(KERN_ERR "%s unusable with this kernel!\n", usbatm_driver_name);
>  		return -EIO;
>  	}