Re: [PATCH 4/5] driver core: class: remove struct class_interface * from callbacks

From: Logan Gunthorpe
Date: Mon Apr 03 2023 - 11:43:37 EST




On 2023-04-02 11:58, Greg Kroah-Hartman wrote:
> The add_dev and remove_dev callbacks in struct class_interface currently
> pass in a pointer back to the class_interface structure that is calling
> them, but none of the callback implementations actually use this pointer
> as it is pointless (the structure is known, the driver passed it in in
> the first place if it is really needed again.)
>
> So clean this up and just remove the pointer from the callbacks and fix
> up all callback functions.
>
> Cc: Jean Delvare <jdelvare@xxxxxxxx>
> Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
> Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
> Cc: Paolo Abeni <pabeni@xxxxxxxxxx>
> Cc: Kurt Schwemmer <kurt.schwemmer@xxxxxxxxxxxxx>
> Cc: Logan Gunthorpe <logang@xxxxxxxxxxxx>
> Cc: Jon Mason <jdmason@xxxxxxxx>
> Cc: Dave Jiang <dave.jiang@xxxxxxxxx>
> Cc: Allen Hubbe <allenbh@xxxxxxxxx>
> Cc: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>
> Cc: Matt Porter <mporter@xxxxxxxxxxxxxxxxxxx>
> Cc: Alexandre Bounine <alex.bou9@xxxxxxxxx>
> Cc: "James E.J. Bottomley" <jejb@xxxxxxxxxxxxx>
> Cc: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>
> Cc: Doug Gilbert <dgilbert@xxxxxxxxxxxx>
> Cc: John Stultz <jstultz@xxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Stephen Boyd <sboyd@xxxxxxxxxx>
> Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Wang Weiyang <wangweiyang2@xxxxxxxxxx>
> Cc: Yang Yingliang <yangyingliang@xxxxxxxxxx>
> Cc: Jakob Koschel <jakobkoschel@xxxxxxxxx>
> Cc: Cai Xinchen <caixinchen1@xxxxxxxxxx>
> Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
> Note, subsystem maintainers, this should go through my driver-core tree
> as it's part of a larger cleanup of 'struct class' handling. I'm cc:ing
> you all to get reviews to verify I didn't do something foolish, but it
> has passed 0-day bot build testing already (which caught many foolish
> mistakes of mine...)
>
>
> drivers/base/class.c | 4 ++--
> drivers/base/core.c | 10 ++++------
> drivers/hwmon/drivetemp.c | 4 ++--
> drivers/net/rionet.c | 3 +--
> drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 6 ++----

For the switchtec changes:

Acked-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>

Thanks!

Logan