lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 15 Dec 2023 21:23:12 +0800
From: Yajun Deng <yajun.deng@...ux.dev>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: marcel@...tmann.org, johan.hedberg@...il.com, luiz.dentz@...il.com,
 wg@...ndegger.com, mkl@...gutronix.de, aspriel@...il.com,
 franky.lin@...adcom.com, hante.meuleman@...adcom.com, kvalo@...nel.org,
 briannorris@...omium.org, mka@...omium.org, johan@...nel.org,
 oneukum@...e.com, stern@...land.harvard.edu, valentina.manea.m@...il.com,
 shuah@...nel.org, linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] USB: core: Use device_driver directly in struct
 usb_driver and usb_device_driver


On 2023/12/15 20:40, Greg KH wrote:
> On Fri, Dec 15, 2023 at 02:31:01PM +0800, Yajun Deng wrote:
>> There is usbdrv_wrap in struct usb_driver and usb_device_driver,
>> it contains device_driver and for_devices. for_devices is used to
>> distinguish between device drivers and interface drivers.
> Yes.
>
>> We can compare that if 'drv->probe' is equal to usb_probe_device instead
>> of using for_devices in is_usb_device_driver().
> Why?


For remove struct usbdrv_wrap. As we can see,  other structs use 
device_driver directly.

struct sdio_driver {

... ...

         struct device_driver drv;
};


struct pcie_port_service_driver {

... ...

         struct device_driver driver;
};

and so on ...

So there is no need a wrapper for device_driver if we can implement 
is_usb_device_driver().

>
>> Remove struct usbdrv_wrap, use device_driver directly in struct usb_driver
>> and usb_device_driver. This makes the code more concise.
> Really?  What does this help out with?  Are there future changes that
> require this?


No, just for cleanups and consistency with other structs.

> I'm all for cleanups, but I don't see what this helps with.
>
> Also, you have a coding style issue in this patch, which means I
> couldn't take it anyway:
>
>> +extern int usb_probe_device(struct device *dev);
> We don't do that in .c files :(


It's in drivers/usb/core/usb.h, not in .c files.

>
> thanks,
>
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ