Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116AbdIMJQA (ORCPT ); Wed, 13 Sep 2017 05:16:00 -0400 Received: from mail-sn1nam02on0081.outbound.protection.outlook.com ([104.47.36.81]:32395 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751062AbdIMJPz (ORCPT ); Wed, 13 Sep 2017 05:15:55 -0400 From: "Kalluru, Sudarsana" To: Himanshu Jha , "Mintz, Yuval" CC: "Elior, Ariel" , Dept-Eng Everest Linux L2 , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] qed: remove unnecessary call to memset Thread-Topic: [PATCH] qed: remove unnecessary call to memset Thread-Index: AQHTK7kMfvcmlC/520yMWwGw9weCc6KyifwQ Date: Wed, 13 Sep 2017 09:15:53 +0000 Message-ID: References: <1505215162-3917-1-git-send-email-himanshujha199640@gmail.com> In-Reply-To: <1505215162-3917-1-git-send-email-himanshujha199640@gmail.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Sudarsana.Kalluru@cavium.com; x-originating-ip: [114.143.185.87] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR07MB3093;6:DSeUSF21kdBkgW5yFXyfC3K12WC7scrqLoD4+azRHmMzoSEYEOjk/gbkmhlQ9df5BfyJVL6E4w4WhNiGpIhnkTUddza4CfzWzHVjwEP6vEW2rdExuNyURhtU869/RxZb8WEj+aPVpOO/0r8OMkPBakudVstfNXv2rRuYiBwUi5+SztQ4CFB0mKexYbgrwGUAP6X5dM52wWeQ60kCC34Zy58whNs7HYAuOx7ncxb4iwhf6v0eGVSM4Z3IyK0I/ttWZkRqvppej+WoGTVoLOY76Lmdmn5jDFrliGTZq/Og2EEt8Jl5EffO1vY7VrIx97t1qk3AgILp4MyttLg6FtkCZw==;5:Ptpgk/wrwrcMRIHGRkU8iID+cn3AJ5uYps7KFT8gb6bNzHScRkNsXlbO0yfZvb2qS0TDk5xTZWdirkcKe1HKFynowmdMHCU5nNWWHwK7g/vT6XOr5BVynKF9kNPifnwo0iyzKDQJiY2dON6Fzkp8wQ==;24:CIDGr+jAEb6DDePz3Zlc6fGanNCcoQDkEuxjUjaVQYiBzUNENvnMVD/9VHJh3VtXbHrl0CkqT06EBDBe8rcRsQmzUmIHzJ2Q2y1ebwmtb5w=;7:tI4GvknHvbT1yA+1KoALg2ggbYjtFEnvo5QamyCjGzu3yieV+Xx3xeVo+sK7ElMmAoh01bRZz3AJKC4c6ouCmny6Z/86SzmyYXepScQMUbhdT+Ic1BXji20ZSHwu5ja0XfAsacya2OXUrIGarflP8bjhTTUEixNyffqbBG/hedFZnvvT4TBVcvKHA3eTOoSRivuxZznHa2o6b/JOkpmwkbJ+XQ4QNmjeKvHNgR0Mv9Y= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 3b544f0a-01b9-42f3-ab37-08d4fa8808b8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR07MB3093; x-ms-traffictypediagnostic: CY4PR07MB3093: x-exchange-antispam-report-test: UriScan:(9452136761055); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR07MB3093;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR07MB3093; x-forefront-prvs: 042957ACD7 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(346002)(376002)(366002)(189002)(13464003)(199003)(6116002)(102836003)(66066001)(2906002)(106356001)(189998001)(68736007)(3280700002)(2950100002)(105586002)(97736004)(5660300001)(6636002)(76176999)(4326008)(74316002)(7696004)(86362001)(3846002)(72206003)(478600001)(316002)(25786009)(7736002)(14454004)(3660700001)(50986999)(55016002)(2900100001)(77096006)(9686003)(305945005)(53936002)(99286003)(54906002)(33656002)(39060400002)(8936002)(81156014)(6506006)(53546010)(229853002)(54356999)(81166006)(6246003)(6436002)(101416001)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB3093;H:CY4PR07MB3048.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2017 09:15:53.3805 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3093 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v8D9G52K013158 Content-Length: 1434 Lines: 43 -----Original Message----- From: Himanshu Jha [mailto:himanshujha199640@gmail.com] Sent: 12 September 2017 16:49 To: Mintz, Yuval Cc: Elior, Ariel ; Dept-Eng Everest Linux L2 ; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Himanshu Jha Subject: [PATCH] qed: remove unnecessary call to memset call to memset to assign 0 value immediately after allocating memory with kzalloc is unnecesaary as kzalloc allocates the memory filled with 0 value. Semantic patch used to resolve this issue: @@ expression e,e2; constant c; statement S; @@ e = kzalloc(e2, c); if(e == NULL) S - memset(e, 0, e2); Signed-off-by: Himanshu Jha --- drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index eaca457..8f6ccc0 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c @@ -1244,7 +1244,6 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn, if (!dcbx_info) return -ENOMEM; - memset(dcbx_info, 0, sizeof(*dcbx_info)); rc = qed_dcbx_query_params(p_hwfn, dcbx_info, QED_DCBX_OPERATIONAL_MIB); if (rc) { kfree(dcbx_info); -- 2.7.4 Acked-by: Sudarsana Kalluru