mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [media] netup_unidvb: Remove a useless memset
@ 2016-01-10  7:20 Christophe JAILLET
  2016-01-10  7:29 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2016-01-10  7:20 UTC (permalink / raw)
  To: serjk, mchehab
  Cc: linux-media, linux-kernel, kernel-janitors, Christophe JAILLET

This memory is allocated using kzalloc so there is no need to call
memset(..., 0, ...)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
index 525ebfe..d919080 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -774,7 +774,6 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
 
 	if (!ndev)
 		goto dev_alloc_err;
-	memset(ndev, 0, sizeof(*ndev));
 	ndev->old_fw = old_firmware;
 	ndev->wq = create_singlethread_workqueue(NETUP_UNIDVB_NAME);
 	if (!ndev->wq) {
-- 
2.5.0

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

* Re: [PATCH] [media] netup_unidvb: Remove a useless memset
  2016-01-10  7:20 [PATCH] [media] netup_unidvb: Remove a useless memset Christophe JAILLET
@ 2016-01-10  7:29 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2016-01-10  7:29 UTC (permalink / raw)
  To: Christophe JAILLET, serjk, mchehab
  Cc: linux-media, linux-kernel, kernel-janitors

On Sun, 2016-01-10 at 08:20 +0100, Christophe JAILLET wrote:
> This memory is allocated using kzalloc so there is no need to call
> memset(..., 0, ...)
[]
> diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
[]
> @@ -774,7 +774,6 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
>  
>  	if (!ndev)
>  		goto dev_alloc_err;
> -	memset(ndev, 0, sizeof(*ndev));
>  	ndev->old_fw = old_firmware;
>  	ndev->wq = create_singlethread_workqueue(NETUP_UNIDVB_NAME);
>  	if (!ndev->wq) {

It's unusual to not see the alloc above the if

Perhaps it'd be more standard to do something like:
---
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
index 525ebfe..c94cecd 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -771,10 +771,9 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
 
 	/* allocate device context */
 	ndev = kzalloc(sizeof(*ndev), GFP_KERNEL);
-
 	if (!ndev)
 		goto dev_alloc_err;
-	memset(ndev, 0, sizeof(*ndev));
+
 	ndev->old_fw = old_firmware;
 	ndev->wq = create_singlethread_workqueue(NETUP_UNIDVB_NAME);
 	if (!ndev->wq) {

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

end of thread, other threads:[~2016-01-10  7:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-10  7:20 [PATCH] [media] netup_unidvb: Remove a useless memset Christophe JAILLET
2016-01-10  7:29 ` Joe Perches

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

all inboxes | Powered by JetHome®