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: 32568 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84) (envelope-from ) id 1aIARv-0005cD-Kx; Sun, 10 Jan 2016 07:30:03 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.76/mailfrontend-6) with esmtp id 1aIARt-0006Ah-4Y; Sun, 10 Jan 2016 08:30:03 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752237AbcAJH3s (ORCPT + 1 other); 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-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.1.10.71816 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MIME_LOWER_CASE 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1400_1499 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, NO_URI_HTTPS 0, REFERENCES 0, SINGLE_URI_IN_BODY 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FORWARDED_MSG 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __REFERENCES 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS ' 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) {