netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mISDN: remove unneeded mISDN_class_release()
@ 2023-03-29  6:01 Greg Kroah-Hartman
  2023-03-29 19:39 ` Simon Horman
  2023-03-31  6:17 ` Jakub Kicinski
  0 siblings, 2 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2023-03-29  6:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Karsten Keil, netdev

The mISDN_class_release() is not needed at all, as the class structure
is static, and it does not actually do anything either, so it is safe to
remove as struct class does not require a release callback.

Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Note: I would like to take this through the driver-core tree as I have
later struct class cleanups that depend on this change being made to the
tree if that's ok with the maintainer of this file.

 drivers/isdn/mISDN/core.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
index f5989c9907ee..ab8513a7acd5 100644
--- a/drivers/isdn/mISDN/core.c
+++ b/drivers/isdn/mISDN/core.c
@@ -152,17 +152,11 @@ static int mISDN_uevent(const struct device *dev, struct kobj_uevent_env *env)
 	return 0;
 }
 
-static void mISDN_class_release(struct class *cls)
-{
-	/* do nothing, it's static */
-}
-
 static struct class mISDN_class = {
 	.name = "mISDN",
 	.dev_uevent = mISDN_uevent,
 	.dev_groups = mISDN_groups,
 	.dev_release = mISDN_dev_release,
-	.class_release = mISDN_class_release,
 };
 
 static int
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mISDN: remove unneeded mISDN_class_release()
  2023-03-29  6:01 [PATCH] mISDN: remove unneeded mISDN_class_release() Greg Kroah-Hartman
@ 2023-03-29 19:39 ` Simon Horman
  2023-03-30  6:01   ` Greg Kroah-Hartman
  2023-03-31  6:17 ` Jakub Kicinski
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Horman @ 2023-03-29 19:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Karsten Keil, netdev

On Wed, Mar 29, 2023 at 08:01:27AM +0200, Greg Kroah-Hartman wrote:
> The mISDN_class_release() is not needed at all, as the class structure
> is static, and it does not actually do anything either, so it is safe to
> remove as struct class does not require a release callback.
> 
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> Note: I would like to take this through the driver-core tree as I have
> later struct class cleanups that depend on this change being made to the
> tree if that's ok with the maintainer of this file.
> 
>  drivers/isdn/mISDN/core.c | 6 ------
>  1 file changed, 6 deletions(-)

I assume this will hit the following in drivers/base/class.c:class_release():

        if (class->class_release)
                class->class_release(class);
        else
		pr_debug("class '%s' does not have a release() function, "
		"be careful\n", class->name);

So I also assume that you are being careful :)

Reviewed-by: Simon Horman <simon.horman@corigine.com>

> diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
> index f5989c9907ee..ab8513a7acd5 100644
> --- a/drivers/isdn/mISDN/core.c
> +++ b/drivers/isdn/mISDN/core.c
> @@ -152,17 +152,11 @@ static int mISDN_uevent(const struct device *dev, struct kobj_uevent_env *env)
>  	return 0;
>  }
>  
> -static void mISDN_class_release(struct class *cls)
> -{
> -	/* do nothing, it's static */
> -}
> -
>  static struct class mISDN_class = {
>  	.name = "mISDN",
>  	.dev_uevent = mISDN_uevent,
>  	.dev_groups = mISDN_groups,
>  	.dev_release = mISDN_dev_release,
> -	.class_release = mISDN_class_release,
>  };
>  
>  static int
> -- 
> 2.40.0
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mISDN: remove unneeded mISDN_class_release()
  2023-03-29 19:39 ` Simon Horman
@ 2023-03-30  6:01   ` Greg Kroah-Hartman
  2023-03-30  7:19     ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2023-03-30  6:01 UTC (permalink / raw)
  To: Simon Horman; +Cc: linux-kernel, Karsten Keil, netdev

On Wed, Mar 29, 2023 at 09:39:30PM +0200, Simon Horman wrote:
> On Wed, Mar 29, 2023 at 08:01:27AM +0200, Greg Kroah-Hartman wrote:
> > The mISDN_class_release() is not needed at all, as the class structure
> > is static, and it does not actually do anything either, so it is safe to
> > remove as struct class does not require a release callback.
> > 
> > Cc: Karsten Keil <isdn@linux-pingi.de>
> > Cc: netdev@vger.kernel.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> > Note: I would like to take this through the driver-core tree as I have
> > later struct class cleanups that depend on this change being made to the
> > tree if that's ok with the maintainer of this file.
> > 
> >  drivers/isdn/mISDN/core.c | 6 ------
> >  1 file changed, 6 deletions(-)
> 
> I assume this will hit the following in drivers/base/class.c:class_release():
> 
>         if (class->class_release)
>                 class->class_release(class);
>         else
> 		pr_debug("class '%s' does not have a release() function, "
> 		"be careful\n", class->name);
> 
> So I also assume that you are being careful :)

Yes, I am :)

I need to remove that debug line soon as I'm moving all struct class
instances to be static and in read-only memory, which would mean that no
release function is needed at all for them.  Give me a few hundred more
commits to get there...

thanks for the review!

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mISDN: remove unneeded mISDN_class_release()
  2023-03-30  6:01   ` Greg Kroah-Hartman
@ 2023-03-30  7:19     ` Simon Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2023-03-30  7:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Karsten Keil, netdev

On Thu, Mar 30, 2023 at 08:01:07AM +0200, Greg Kroah-Hartman wrote:
> On Wed, Mar 29, 2023 at 09:39:30PM +0200, Simon Horman wrote:
> > On Wed, Mar 29, 2023 at 08:01:27AM +0200, Greg Kroah-Hartman wrote:
> > > The mISDN_class_release() is not needed at all, as the class structure
> > > is static, and it does not actually do anything either, so it is safe to
> > > remove as struct class does not require a release callback.
> > > 
> > > Cc: Karsten Keil <isdn@linux-pingi.de>
> > > Cc: netdev@vger.kernel.org
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > ---
> > > Note: I would like to take this through the driver-core tree as I have
> > > later struct class cleanups that depend on this change being made to the
> > > tree if that's ok with the maintainer of this file.
> > > 
> > >  drivers/isdn/mISDN/core.c | 6 ------
> > >  1 file changed, 6 deletions(-)
> > 
> > I assume this will hit the following in drivers/base/class.c:class_release():
> > 
> >         if (class->class_release)
> >                 class->class_release(class);
> >         else
> > 		pr_debug("class '%s' does not have a release() function, "
> > 		"be careful\n", class->name);
> > 
> > So I also assume that you are being careful :)
> 
> Yes, I am :)
> 
> I need to remove that debug line soon as I'm moving all struct class
> instances to be static and in read-only memory, which would mean that no
> release function is needed at all for them.  Give me a few hundred more
> commits to get there...

Excellent, good luck with your journey of a few hundred patches.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mISDN: remove unneeded mISDN_class_release()
  2023-03-29  6:01 [PATCH] mISDN: remove unneeded mISDN_class_release() Greg Kroah-Hartman
  2023-03-29 19:39 ` Simon Horman
@ 2023-03-31  6:17 ` Jakub Kicinski
  2023-03-31  7:04   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2023-03-31  6:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Karsten Keil, netdev

On Wed, 29 Mar 2023 08:01:27 +0200 Greg Kroah-Hartman wrote:
> Note: I would like to take this through the driver-core tree as I have
> later struct class cleanups that depend on this change being made to the
> tree if that's ok with the maintainer of this file.

It must be on top of .owner removal? Cause it doesn't apply for us:

Acked-by: Jakub Kicinski <kuba@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mISDN: remove unneeded mISDN_class_release()
  2023-03-31  6:17 ` Jakub Kicinski
@ 2023-03-31  7:04   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2023-03-31  7:04 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: linux-kernel, Karsten Keil, netdev

On Thu, Mar 30, 2023 at 11:17:39PM -0700, Jakub Kicinski wrote:
> On Wed, 29 Mar 2023 08:01:27 +0200 Greg Kroah-Hartman wrote:
> > Note: I would like to take this through the driver-core tree as I have
> > later struct class cleanups that depend on this change being made to the
> > tree if that's ok with the maintainer of this file.
> 
> It must be on top of .owner removal? Cause it doesn't apply for us:
> 
> Acked-by: Jakub Kicinski <kuba@kernel.org>

Ah, yeah, it is, that's in my tree already.

thanks for the ack!

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-31  7:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-29  6:01 [PATCH] mISDN: remove unneeded mISDN_class_release() Greg Kroah-Hartman
2023-03-29 19:39 ` Simon Horman
2023-03-30  6:01   ` Greg Kroah-Hartman
2023-03-30  7:19     ` Simon Horman
2023-03-31  6:17 ` Jakub Kicinski
2023-03-31  7:04   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).