lkml.org 
[lkml]   [2023]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCHv5 2/4] wiegand: add Wiegand bus driver
    On Thu, Aug 24, 2023 at 01:10:13PM +0200, Martin Zaťovič wrote:
    > +static inline void wiegand_controller_put(void *ptr)

    Why is this a void *? It should be "struct wiegand_controller *"

    Please never use void * if at all possible.

    > +static inline void wiegand_unregister_driver(struct wiegand_driver *wdrv)
    > +{
    > + if (wdrv)

    How could this ever be true?

    > + driver_unregister(&wdrv->driver);
    > +}
    > +
    > +static inline struct wiegand_driver *to_wiegand_driver(struct device_driver *drv)
    > +{
    > + return drv ? container_of(drv, struct wiegand_driver, driver) : NULL;

    How could drv be NULL?

    And you should make this a const *, right?

    thanks,

    greg k-h

    \
     
     \ /
      Last update: 2023-08-24 13:42    [W:3.229 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site