From patchwork Sun Jan 10 07:29:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 7994791 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 58851BEEE5 for ; Sun, 10 Jan 2016 07:30:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86202202E9 for ; Sun, 10 Jan 2016 07:30:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2484202EB for ; Sun, 10 Jan 2016 07:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752237AbcAJH3s (ORCPT ); Sun, 10 Jan 2016 02:29:48 -0500 Received: from smtprelay0229.hostedemail.com ([216.40.44.229]:42851 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751534AbcAJH3q (ORCPT ); Sun, 10 Jan 2016 02:29:46 -0500 Received: from filter.hostedemail.com (unknown [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 63F346B559; Sun, 10 Jan 2016 07:29:45 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2, 0, 0, , d41d8cd98f00b204, joe@perches.com, :::::::::::, RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2919:3138:3139:3140:3141:3142:3352:3622:3865:3867:3871:3872:4250:4321:5007:6261:8660:9592:10004:10400:10848:11026:11232:11473:11657:11658:11783:11914:12043:12296:12438:12517:12519:12555:12740:13069:13148:13230:13311:13357:13894:14659:21080:30054:30091, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0, LFtime:1, LUA_SUMMARY:none X-HE-Tag: ball53_8f36b775be646 X-Filterd-Recvd-Size: 2217 Received: from joe-X200MA.home (pool-173-51-221-2.lsanca.fios.verizon.net [173.51.221.2]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Sun, 10 Jan 2016 07:29:44 +0000 (UTC) Message-ID: <1452410981.7773.10.camel@perches.com> Subject: Re: [PATCH] [media] netup_unidvb: Remove a useless memset From: Joe Perches To: Christophe JAILLET , serjk@netup.ru, mchehab@osg.samsung.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Date: Sat, 09 Jan 2016 23:29:41 -0800 In-Reply-To: <1452410416-6362-1-git-send-email-christophe.jaillet@wanadoo.fr> References: <1452410416-6362-1-git-send-email-christophe.jaillet@wanadoo.fr> X-Mailer: Evolution 3.18.3-1ubuntu1 Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: --- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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) {