From patchwork Wed Dec 16 23:12:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 7866691 Return-Path: X-Original-To: patchwork-linux-scsi@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 B31A6BEEE5 for ; Wed, 16 Dec 2015 23:12:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E463D203EB for ; Wed, 16 Dec 2015 23:12:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 138B220396 for ; Wed, 16 Dec 2015 23:12:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755350AbbLPXMf (ORCPT ); Wed, 16 Dec 2015 18:12:35 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:36054 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755298AbbLPXM0 (ORCPT ); Wed, 16 Dec 2015 18:12:26 -0500 Received: by mail-pa0-f47.google.com with SMTP id q3so11062065pav.3 for ; Wed, 16 Dec 2015 15:12:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=date:from:to:subject:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=GyG4HrPR4Nz4aTzwbmWaCbZGt4/Gc8gXvJSpLeHXNtU=; b=BwRWJnYzZLTBhcozVRTHoN0zqOo9HgrjfOVxyWOQB6kLlfOksDZ4tHSOM6m6gqS67P A51bEwhbClYQTVKIFxYGbACM6HmwtEMXF4RdRihsy2PlgX5h8k4lNuT9CoTUXXpsMDz+ 0oSZKcaHPcBYp+7We78o9y3wmOpopwdHyx6x4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=GyG4HrPR4Nz4aTzwbmWaCbZGt4/Gc8gXvJSpLeHXNtU=; b=QKYieMhZfXg5Ttrxs6Scs+D8RgTd9po8FpyNPfURSSuCmmwuesFCPqbsYp6rA20dmA zxXEfSGuehCr1U1FuNRsgQWXRlnBZ8GjcZaNPsFzaVjTbZzoTaQlzWkx066j5oqX1r57 7I9TpSOAzoRbaD4Svi4aFpWxnPvuj9CswapV+TkPco23xSr5SluqsgmSVsxOacsNbny/ k1Rv4ULxVkJHNvBeaaglZP7oYPTxHsO3PiZfNKu2Untb+w08CVjjptTpqeOdU1E5Hclq o0Y1MDuUweRUtdUfQJC/P06cuIuY4veDr/Kjmx6iZ0N/3QxkJQtsFq55qSjxAx0GgYTr edXA== X-Gm-Message-State: ALoCoQnynRYVmokJxxXvGcaKtt4+CXYhbm6Lc3gyARbPP786kJrxMyD4sKAOKivrYSOpksxKGM69ZzJ82vJorLijk7GNF03wcg== X-Received: by 10.66.193.36 with SMTP id hl4mr67363118pac.153.1450307546416; Wed, 16 Dec 2015 15:12:26 -0800 (PST) Received: from myfc17 (cm-wififw.emulex.com. [138.239.220.50]) by smtp.gmail.com with ESMTPSA id o22sm7008516pfi.2.2015.12.16.15.12.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 Dec 2015 15:12:25 -0800 (PST) Date: Wed, 16 Dec 2015 18:12:07 -0500 From: james.smart@avagotech.com (James Smart) To: linux-scsi@vger.kernel.org Subject: [PATCH 16/17] lpfc: Use kzalloc instead of kmalloc Message-ID: <5671efc7.97bycJ6w84wBFCRH%james.smart@avagotech.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 From: Punit Vara This patch is to the lpfc_els.c which resolves following warning reported by coccicheck: WARNING: kzalloc should be used for rdp_context, instead of kmalloc/memset Signed-off-by: Punit Vara Signed-off-by: James Smart Reviewed-by: Matthew R. Ochs Reviewed-by: Hannes Reinecke Reviewed-by: Sebastian Herbszt --- drivers/scsi/lpfc/lpfc_els.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 273a1db..7f5abb8 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -5016,13 +5016,12 @@ lpfc_els_rcv_rdp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, if (RDP_NPORT_ID_SIZE != be32_to_cpu(rdp_req->nport_id_desc.length)) goto rjt_logerr; - rdp_context = kmalloc(sizeof(struct lpfc_rdp_context), GFP_KERNEL); + rdp_context = kzalloc(sizeof(struct lpfc_rdp_context), GFP_KERNEL); if (!rdp_context) { rjt_err = LSRJT_UNABLE_TPC; goto error; } - memset(rdp_context, 0, sizeof(struct lpfc_rdp_context)); cmd = &cmdiocb->iocb; rdp_context->ndlp = lpfc_nlp_get(ndlp); rdp_context->ox_id = cmd->unsli3.rcvsli3.ox_id;