Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/6] use kzalloc
@ 2022-03-12 10:26 Julia Lawall
  2022-03-12 10:27 ` [PATCH 1/6] cifs: " Julia Lawall
  2022-03-14 20:30 ` [PATCH 0/6] " patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Julia Lawall @ 2022-03-12 10:26 UTC (permalink / raw)
  To: linux-wireless
  Cc: kernel-janitors, alsa-devel, samba-technical, linux-cifs,
	linux-kernel, netdev, linux-rdma, linux-scsi, Andrey Konovalov,
	linux-usb

Use kzalloc instead of kmalloc + memset.

---

 drivers/net/ethernet/mellanox/mlx4/en_rx.c |    3 +--
 drivers/net/wireless/zydas/zd1201.c        |    3 +--
 drivers/scsi/lpfc/lpfc_debugfs.c           |    9 ++-------
 drivers/usb/gadget/legacy/raw_gadget.c     |    3 +--
 fs/cifs/transport.c                        |    3 +--
 sound/core/seq/oss/seq_oss_init.c          |    3 +--
 6 files changed, 7 insertions(+), 17 deletions(-)

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

* [PATCH 1/6] cifs: use kzalloc
  2022-03-12 10:26 [PATCH 0/6] use kzalloc Julia Lawall
@ 2022-03-12 10:27 ` Julia Lawall
  2022-03-15  4:15   ` Steve French
  2022-03-14 20:30 ` [PATCH 0/6] " patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2022-03-12 10:27 UTC (permalink / raw)
  To: Steve French; +Cc: kernel-janitors, linux-cifs, samba-technical, linux-kernel

Use kzalloc instead of kmalloc + memset.

The semantic patch that makes this change is:
(https://coccinelle.gitlabpages.inria.fr/website/)

//<smpl>
@@
expression res, size, flag;
@@
- res = kmalloc(size, flag);
+ res = kzalloc(size, flag);
  ...
- memset(res, 0, size);
//</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 fs/cifs/transport.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index eeb1a699bd6f..4ff8e165a180 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -464,13 +464,12 @@ smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
 		return -EIO;
 	}
 
-	tr_hdr = kmalloc(sizeof(*tr_hdr), GFP_NOFS);
+	tr_hdr = kzalloc(sizeof(*tr_hdr), GFP_NOFS);
 	if (!tr_hdr)
 		return -ENOMEM;
 
 	memset(&cur_rqst[0], 0, sizeof(cur_rqst));
 	memset(&iov, 0, sizeof(iov));
-	memset(tr_hdr, 0, sizeof(*tr_hdr));
 
 	iov.iov_base = tr_hdr;
 	iov.iov_len = sizeof(*tr_hdr);


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

* Re: [PATCH 0/6] use kzalloc
  2022-03-12 10:26 [PATCH 0/6] use kzalloc Julia Lawall
  2022-03-12 10:27 ` [PATCH 1/6] cifs: " Julia Lawall
@ 2022-03-14 20:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-14 20:30 UTC (permalink / raw)
  To: Julia Lawall
  Cc: linux-wireless, kernel-janitors, alsa-devel, samba-technical,
	linux-cifs, linux-kernel, netdev, linux-rdma, linux-scsi,
	andreyknvl, linux-usb

Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 12 Mar 2022 11:26:59 +0100 you wrote:
> Use kzalloc instead of kmalloc + memset.
> 
> ---
> 
>  drivers/net/ethernet/mellanox/mlx4/en_rx.c |    3 +--
>  drivers/net/wireless/zydas/zd1201.c        |    3 +--
>  drivers/scsi/lpfc/lpfc_debugfs.c           |    9 ++-------
>  drivers/usb/gadget/legacy/raw_gadget.c     |    3 +--
>  fs/cifs/transport.c                        |    3 +--
>  sound/core/seq/oss/seq_oss_init.c          |    3 +--
>  6 files changed, 7 insertions(+), 17 deletions(-)

Here is the summary with links:
  - [2/6] net/mlx4_en: use kzalloc
    https://git.kernel.org/netdev/net-next/c/3c2dfb735b4a
  - [5/6] zd1201: use kzalloc
    (no matching commit)

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH 1/6] cifs: use kzalloc
  2022-03-12 10:27 ` [PATCH 1/6] cifs: " Julia Lawall
@ 2022-03-15  4:15   ` Steve French
  0 siblings, 0 replies; 4+ messages in thread
From: Steve French @ 2022-03-15  4:15 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, CIFS, samba-technical, LKML

Which tree should this be merged from?  cifs-2.6.git for-next ... or
do you prefer that these all go together through a different tree

On Sun, Mar 13, 2022 at 11:36 AM Julia Lawall <Julia.Lawall@inria.fr> wrote:
>
> Use kzalloc instead of kmalloc + memset.
>
> The semantic patch that makes this change is:
> (https://coccinelle.gitlabpages.inria.fr/website/)
>
> //<smpl>
> @@
> expression res, size, flag;
> @@
> - res = kmalloc(size, flag);
> + res = kzalloc(size, flag);
>   ...
> - memset(res, 0, size);
> //</smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
>
> ---
>  fs/cifs/transport.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
> index eeb1a699bd6f..4ff8e165a180 100644
> --- a/fs/cifs/transport.c
> +++ b/fs/cifs/transport.c
> @@ -464,13 +464,12 @@ smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
>                 return -EIO;
>         }
>
> -       tr_hdr = kmalloc(sizeof(*tr_hdr), GFP_NOFS);
> +       tr_hdr = kzalloc(sizeof(*tr_hdr), GFP_NOFS);
>         if (!tr_hdr)
>                 return -ENOMEM;
>
>         memset(&cur_rqst[0], 0, sizeof(cur_rqst));
>         memset(&iov, 0, sizeof(iov));
> -       memset(tr_hdr, 0, sizeof(*tr_hdr));
>
>         iov.iov_base = tr_hdr;
>         iov.iov_len = sizeof(*tr_hdr);
>


-- 
Thanks,

Steve

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

end of thread, other threads:[~2022-03-15  4:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-12 10:26 [PATCH 0/6] use kzalloc Julia Lawall
2022-03-12 10:27 ` [PATCH 1/6] cifs: " Julia Lawall
2022-03-15  4:15   ` Steve French
2022-03-14 20:30 ` [PATCH 0/6] " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox