Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6799155ybi; Wed, 29 May 2019 13:23:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqylXND4C/xtYKt5WGPYNlRJl2YlPwgbnBPUoVvQSEcDR6Sc7MOaxPHODGo1WWX8dXlNUiN5 X-Received: by 2002:a17:902:54f:: with SMTP id 73mr21020929plf.246.1559161401485; Wed, 29 May 2019 13:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559161401; cv=none; d=google.com; s=arc-20160816; b=0F/sAvRrEQAvIq7qzZw5OZ2p66sRN7r2Qp7rhNtCxuPTq7anh0mqKwkjUzj+T4sjne T14w8XVi5bVFjbncWpGMQnsQqaWJf4y8WvpMmSOQiOueUE5etcV7JedzNTmoPlY4hRab NKoKhtFl6zgXN4EsffYw47OzgJeIpoxnfpHwOOnEADrdX/8bapCBcN3lQ9tz67pKs+Ar OFLm8RD4jikoD96kwAZ7hwR7Emp/gyu/0bJHKJxi86Hu6+aX/ZmWxeGpyAbO8r4kzVP9 UlHufN3vpXxe6OgYtY91YRDttVbzi61PW/w2B9A4VjKgQ9z+GLITXothvIHDsl3J13on wHgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:references:message-id :content-transfer-encoding:mime-version:to:subject:date:from; bh=S2lqT2tJ8BXBotF75naQqWNmO6h3m5YAopULvMdXxTI=; b=WlDfIRnyxgYgxpoGwuSk3GqXA08kHU/KNxghPb6HNavKnHHoVPKomRDJb7Omo3dSd+ GjclDp6ThKBW/rEF+wUww+6fhrL0hkYrvuHULCAcfHRyaqUE1uCupyK5CxxVqxp4VYah fJeefePs+asaO8fpUnFq7Fud5Uy8XSZdkhNXRqGVBCya++R22/Uszif/7VTECouv/BWm DBEDND68l8TpW21nT5sDzLY4gxozYbleWiZWdrJuFGfEeOC7CKsB/eLsY+/tOcLrr1ap 8gp8aFr/UIZd1FEPpdgVhu0RmMxU0Y9KL0glRaWlR794/5IV8x38vx8GS0VPTPyia6Eh agMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si729325pgt.462.2019.05.29.13.23.04; Wed, 29 May 2019 13:23:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726540AbfE2UVp (ORCPT + 99 others); Wed, 29 May 2019 16:21:45 -0400 Received: from www17.your-server.de ([213.133.104.17]:55976 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbfE2UVo (ORCPT ); Wed, 29 May 2019 16:21:44 -0400 Received: from [88.198.220.130] (helo=sslproxy01.your-server.de) by www17.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1hW54w-0005yN-A2; Wed, 29 May 2019 22:21:42 +0200 Received: from [2a02:908:4c22:ec00:915f:2518:d2f6:b586] (helo=maria.localdomain) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1hW54v-0006Vr-20; Wed, 29 May 2019 22:21:42 +0200 Received: by maria.localdomain (sSMTP sendmail emulation); Wed, 29 May 2019 22:21:40 +0200 From: "Thomas Meyer" Date: Wed, 29 May 2019 22:21:40 +0200 Subject: [PATCH] scsi: pmcraid: Use *_pool_zalloc rather than *_pool_alloc To: jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patch: Cocci X-Mailer: DiffSplit Message-ID: <1559161113902-328168114-2-diffsplit-thomas@m3y3r.de> References: <1559161113889-196429735-0-diffsplit-thomas@m3y3r.de> In-Reply-To: <1559161113889-196429735-0-diffsplit-thomas@m3y3r.de> X-Serial-No: 2 X-Authenticated-Sender: thomas@m3y3r.de X-Virus-Scanned: Clear (ClamAV 0.100.3/25464/Wed May 29 09:59:09 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0. Signed-off-by: Thomas Meyer --- diff -u -p a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -4668,18 +4668,14 @@ static int pmcraid_allocate_control_bloc return -ENOMEM; for (i = 0; i < PMCRAID_MAX_CMD; i++) { - pinstance->cmd_list[i]->ioa_cb = - dma_pool_alloc( - pinstance->control_pool, - GFP_KERNEL, - &(pinstance->cmd_list[i]->ioa_cb_bus_addr)); + pinstance->cmd_list[i]->ioa_cb = dma_pool_zalloc(pinstance->control_pool, + GFP_KERNEL, + &(pinstance->cmd_list[i]->ioa_cb_bus_addr)); if (!pinstance->cmd_list[i]->ioa_cb) { pmcraid_release_control_blocks(pinstance, i); return -ENOMEM; } - memset(pinstance->cmd_list[i]->ioa_cb, 0, - sizeof(struct pmcraid_control_block)); } return 0; }