Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2374897imm; Sun, 9 Sep 2018 23:24:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYAP6I/rPjYIqhGqKQJUtuQiSrS6tzOj40SO1d9HL9lR02+8+u9JQDmdTDm+DHYbO3rYp/5 X-Received: by 2002:a17:902:9893:: with SMTP id s19-v6mr20325750plp.130.1536560671923; Sun, 09 Sep 2018 23:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536560671; cv=none; d=google.com; s=arc-20160816; b=wQBsriLgLQEAfbM8N3SrD7LcN9U1Zvrt+rLxG6xbqkvlcEI0Xt5UYkBb6GuVvrOgpf eK0Ab0khJqpxyURgkIXUySbgbvg4mUCuBPbDCAwFKf6Jr75YHiHIuZEdUg5YnfJJzgYB uVAUv4xPtZUtMfTvzSUQ5UmQh8rIZqfcIYDzgQzgqcaBecPJRZ3vNdRcNCe/B3zAYgUA 9zwAi/h8z7qg8MS5umnTn7ZtRTGc001SqRHP8ph2RV9vx6BZy/g2Auih+5wfa6aeyeJX HCTs3e8N9LU3KZ+tHb81y075LNQQV5J7+MbSwz2Nzlr9x8WT6jeoNLL9Yfn55Z2mdddR /jwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:subject:cc:to:from:date; bh=X/0VV7xVbUqoi41kDFUUk9oRgUn8xCMT7A2vL426A8Q=; b=XxHizEBAolkamu9nnccfSGqjK7IOA3er4JjWlzSox+1EHqGn3LGGNQbmeBtGf7FOoX ItG84dr4ApKdRHhhJKTUcuKWXbn/R9YSb43HNjMwp6QZbwOCkUA6wNc0beidg+TpA+i6 G7oj7oQw82Lg/C/ZO5kffG+AopKrLogHx8qIcnHTv9w5DL75z3Sg1Z+/XsmyhZLWbzLj xSd8BCIu4EWyTiuc3DFKApjT/KAYSg57zYUKtgla2+LmyI9YPrbbnoCcMoMmM+VCKFQ7 4YRPnVI5H805WHQuhSzZWhHZEUQgtOmcz06lljT8nN1Aze0ArrbbBaGreiwSKuza08X6 dhtg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y4-v6si16229429pgh.225.2018.09.09.23.24.17; Sun, 09 Sep 2018 23:24:31 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727473AbeIJLPb (ORCPT + 99 others); Mon, 10 Sep 2018 07:15:31 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57466 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726405AbeIJLPb (ORCPT ); Mon, 10 Sep 2018 07:15:31 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8A6Jvdu114186 for ; Mon, 10 Sep 2018 02:23:05 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mdj3mjkv2-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 10 Sep 2018 02:23:05 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Sep 2018 07:23:03 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 10 Sep 2018 07:23:02 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8A6N1oL47120496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Sep 2018 06:23:01 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 40F31A405B; Mon, 10 Sep 2018 09:22:51 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2EED2A404D; Mon, 10 Sep 2018 09:22:51 +0100 (BST) Received: from w530-pk1mzal (unknown [9.152.212.186]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 10 Sep 2018 09:22:51 +0100 (BST) Received: from bblock by w530-pk1mzal with local (Exim 4.91) (envelope-from ) id 1fzFbA-0000hK-Oo; Mon, 10 Sep 2018 08:23:00 +0200 Date: Mon, 10 Sep 2018 08:23:00 +0200 From: Benjamin Block To: zhong jiang Cc: maier@linux.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] s390: zfcp_aux: remove unnecessary null pointer check before mempool_destroy References: <1536399705-21676-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1536399705-21676-1-git-send-email-zhongjiang@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 x-cbid: 18091006-0016-0000-0000-00000202FE85 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091006-0017-0000-0000-00003259B94D Message-Id: <20180910062300.GA6465@w530-pk1mzal> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-10_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809100069 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 08, 2018 at 05:41:45PM +0800, zhong jiang wrote: > mempool_destroy has taken null pointer check into account. so remove the > redundant check. > > Signed-off-by: zhong jiang > --- > drivers/s390/scsi/zfcp_aux.c | 21 +++++++-------------- > 1 file changed, 7 insertions(+), 14 deletions(-) > > diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c > index 94f4d8f..e06c3f2 100644 > --- a/drivers/s390/scsi/zfcp_aux.c > +++ b/drivers/s390/scsi/zfcp_aux.c > @@ -248,20 +248,13 @@ static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter) > > static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter) > { > - if (adapter->pool.erp_req) > - mempool_destroy(adapter->pool.erp_req); > - if (adapter->pool.scsi_req) > - mempool_destroy(adapter->pool.scsi_req); > - if (adapter->pool.scsi_abort) > - mempool_destroy(adapter->pool.scsi_abort); > - if (adapter->pool.qtcb_pool) > - mempool_destroy(adapter->pool.qtcb_pool); > - if (adapter->pool.status_read_req) > - mempool_destroy(adapter->pool.status_read_req); > - if (adapter->pool.sr_data) > - mempool_destroy(adapter->pool.sr_data); > - if (adapter->pool.gid_pn) > - mempool_destroy(adapter->pool.gid_pn); > + mempool_destroy(adapter->pool.erp_req); > + mempool_destroy(adapter->pool.scsi_req); > + mempool_destroy(adapter->pool.scsi_abort); > + mempool_destroy(adapter->pool.qtcb_pool); > + mempool_destroy(adapter->pool.status_read_req); > + mempool_destroy(adapter->pool.sr_data); > + mempool_destroy(adapter->pool.gid_pn); > } > Acked-by: Benjamin Block Thank you. We'll send it along when we next send patches upstream. -- With Best Regards, Benjamin Block / Linux on IBM Z Kernel Development IBM Systems & Technology Group / IBM Deutschland Research & Development GmbH Vorsitz. AufsR.: Martina Koederitz / Gesch?ftsf?hrung: Dirk Wittkopp Sitz der Gesellschaft: B?blingen / Registergericht: AmtsG Stuttgart, HRB 243294