From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbdJESI3 (ORCPT ); Thu, 5 Oct 2017 14:08:29 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34706 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751768AbdJESI1 (ORCPT ); Thu, 5 Oct 2017 14:08:27 -0400 X-Google-Smtp-Source: AOwi7QDA1LxFHN1/OAcjaMXwLkYGX/qAPkU5NyiJo3WKqoWjTgQ4XUARcX7YjExz8zGJ6ahKMCfHhQ== Date: Thu, 5 Oct 2017 14:09:20 -0400 From: Tim Hansen To: axboe@kernel.dk Cc: devtimhansen@gmail.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, alexander.levin@one.verizon.com Subject: [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free() Message-ID: <20171005180920.GA121296@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mempool_destroy() already checks for a NULL value being passed in, this eliminates duplicate checks. This was caught by running make coccicheck M=block/ on linus' tree on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of this patch). Signed-off-by: Tim Hansen --- block/bio-integrity.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 5df3290..23b42e8 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -485,11 +485,8 @@ EXPORT_SYMBOL(bioset_integrity_create); void bioset_integrity_free(struct bio_set *bs) { - if (bs->bio_integrity_pool) - mempool_destroy(bs->bio_integrity_pool); - - if (bs->bvec_integrity_pool) - mempool_destroy(bs->bvec_integrity_pool); + mempool_destroy(bs->bio_integrity_pool); + mempool_destroy(bs->bvec_integrity_pool); } EXPORT_SYMBOL(bioset_integrity_free); -- 2.1.4