linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] drivers: w1: drop unnecessary memset() in w1_master_release()
@ 2022-05-18  8:01 Yang Yingliang
  2022-05-18  8:45 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2022-05-18  8:01 UTC (permalink / raw)
  To: linux-kernel, linux-hwmon; +Cc: zbr, jdelvare, linux, gregkh

It's unnecessary to use memset() in w1_master_release() before
the memory is freed, so remove it.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/w1/w1.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index f2ae2e563dc5..f4d1499bb853 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -73,7 +73,6 @@ static void w1_master_release(struct device *dev)
 	struct w1_master *md = dev_to_w1_master(dev);
 
 	dev_dbg(dev, "%s: Releasing %s.\n", __func__, md->name);
-	memset(md, 0, sizeof(struct w1_master) + sizeof(struct w1_bus_master));
 	kfree(md);
 }
 
-- 
2.25.1


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

* Re: [PATCH -next] drivers: w1: drop unnecessary memset() in w1_master_release()
  2022-05-18  8:01 [PATCH -next] drivers: w1: drop unnecessary memset() in w1_master_release() Yang Yingliang
@ 2022-05-18  8:45 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-05-18  8:45 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, linux-hwmon, zbr, jdelvare, linux

On Wed, May 18, 2022 at 04:01:36PM +0800, Yang Yingliang wrote:
> It's unnecessary to use memset() in w1_master_release() before
> the memory is freed, so remove it.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/w1/w1.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index f2ae2e563dc5..f4d1499bb853 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -73,7 +73,6 @@ static void w1_master_release(struct device *dev)
>  	struct w1_master *md = dev_to_w1_master(dev);
>  
>  	dev_dbg(dev, "%s: Releasing %s.\n", __func__, md->name);
> -	memset(md, 0, sizeof(struct w1_master) + sizeof(struct w1_bus_master));
>  	kfree(md);
>  }
>  
> -- 
> 2.25.1
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/SubmittingPatches for what needs to be done
  here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

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

end of thread, other threads:[~2022-05-18  8:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-18  8:01 [PATCH -next] drivers: w1: drop unnecessary memset() in w1_master_release() Yang Yingliang
2022-05-18  8:45 ` Greg KH

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).