Re: [PATCH net-next 1/5] r8152: use generic USB macros to define product table

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

 



On Wed, Nov 04, 2020 at 01:57:10AM +0000, Hayes Wang wrote:
> Marek Behún <kabel@xxxxxxxxxx>
> > Sent: Wednesday, November 4, 2020 3:22 AM
> > diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> > index b1770489aca5..85dda591c838 100644
> > --- a/drivers/net/usb/r8152.c
> > +++ b/drivers/net/usb/r8152.c
> > @@ -6862,20 +6862,12 @@ static void rtl8152_disconnect(struct
> > usb_interface *intf)
> >  }
> > 
> >  #define REALTEK_USB_DEVICE(vend, prod)	\
> > -	.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
> > -		       USB_DEVICE_ID_MATCH_INT_CLASS, \
> > -	.idVendor = (vend), \
> > -	.idProduct = (prod), \
> > -	.bInterfaceClass = USB_CLASS_VENDOR_SPEC \
> > +	USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC)
> > \
> >  }, \
> >  { \
> > -	.match_flags = USB_DEVICE_ID_MATCH_INT_INFO | \
> > -		       USB_DEVICE_ID_MATCH_DEVICE, \
> > -	.idVendor = (vend), \
> > -	.idProduct = (prod), \
> > -	.bInterfaceClass = USB_CLASS_COMM, \
> > -	.bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
> > -	.bInterfaceProtocol = USB_CDC_PROTO_NONE
> > +	USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \
> > +				      USB_CDC_SUBCLASS_ETHERNET, \
> > +				      USB_CDC_PROTO_NONE)
> > 
> >  /* table of devices that work with this driver */
> >  static const struct usb_device_id rtl8152_table[] = {
> 
> I don't use these, because checkpatch.pl would show error.
> 
> 	$ scripts/checkpatch.pl --file --terse drivers/net/usb/r8152.c
> 	ERROR: Macros with complex values should be enclosed in parentheses

checkpatch is wrong.



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

  Powered by Linux