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]
Message-ID: <ZCST8vuQDEo9GhsS@corigine.com>
Date:   Wed, 29 Mar 2023 21:39:30 +0200
From:   Simon Horman <simon.horman@...igine.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, Karsten Keil <isdn@...ux-pingi.de>,
        netdev@...r.kernel.org
Subject: Re: [PATCH] mISDN: remove unneeded mISDN_class_release()

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@...ux-pingi.de>
> Cc: netdev@...r.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.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@...igine.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ