From patchwork Thu Mar 29 22:05:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10316489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B563360353 for ; Thu, 29 Mar 2018 22:08:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EB262A4C2 for ; Thu, 29 Mar 2018 22:08:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 932D42A534; Thu, 29 Mar 2018 22:08:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 160ED2A4C2 for ; Thu, 29 Mar 2018 22:08:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751209AbeC2WIV (ORCPT ); Thu, 29 Mar 2018 18:08:21 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:42660 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752640AbeC2WHk (ORCPT ); Thu, 29 Mar 2018 18:07:40 -0400 Received: by mail-lf0-f67.google.com with SMTP id a22-v6so10328698lfg.9 for ; Thu, 29 Mar 2018 15:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L/t/EKOVst4kg+hi0NRGkVECgYmf72g+dzxCxgv4FiY=; b=mlh6r5tvuQ/4Wv6cLlV8dL3ugXARvMPHd+Kd80/INit1fB69knPYpUgHupAnX5HyI2 NHfm7ci9j6aOYLxQBNLWvPg1udE7rdbKOw7syn6yIM3yjPvA9uobMHoGrDL0TSNd2pP6 FDW9qiqYXZC67pCFgEeQHmBBRIsV3uv5BFEL0fgYImbC35Onh2suJlEZJRKQCnY71qf1 O8D3RMj3pGvFB6fr6fHpB3OKMxjVDk9XKauT4KKp48uhMvMbB3lgS4Rk6TpO1T7Eyzp/ 2vnx9tePDcu3LOqHYRTrs4GQ8OK4f62Hwp7CLD0LJ6x/0PSKtpNZM0H3nyeIBXk7520A yk9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L/t/EKOVst4kg+hi0NRGkVECgYmf72g+dzxCxgv4FiY=; b=UND/56lvJIHoS/Hp9aBm1pQQG66+thYJKW24a0axpWNqm2r/1WucBlBXxFPuZUjckT 9lOX4hCnPSSGC0RP7UTN4kJwCq7X1h5pYJHfUwMamd/D+KQsSOwU9IOmg1WgbxsQfwZ2 S3gP8ST7KoUPUdtuNKdLXg1DPv2QysM84zZwNPjJBQ3DLV8l2VyoJIJ/OcLJ++mY+5Bl rsRb7Tr0v0M5M3Hv2OXqeCHE5Xu5l4VNSmGNO2rKwDBJkmFjnPenMLR57Sy6w3Zyod4D cLddBzu5MAx7QLhoMeapA7yTUT3sobYb7X2g0tEotI2h6Yn+s4mTjYdwK4rAYfRcT6QZ 0HnQ== X-Gm-Message-State: AElRT7GraQrshQKnRLzB+F/448aEjn1amN5pYgrcE4CGr9v+Nvk0qOvg vzFMIihG121vGFu01XRNt+zfdQ== X-Google-Smtp-Source: AIpwx4+kPv8zaP/PuaKPqg+xkqmPkZUFMQi4dkRyvj0DKbeZafH7/k+Rfu7h+M8XCSUl5NQPHfloCA== X-Received: by 10.46.153.193 with SMTP id l1mr6356799ljj.56.1522361258721; Thu, 29 Mar 2018 15:07:38 -0700 (PDT) Received: from Macroninja.cnexlabs.com (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.gmail.com with ESMTPSA id i89-v6sm1365508lfk.12.2018.03.29.15.07.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 15:07:37 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, keith.busch@intel.com, javier@cnexlabs.com, Dan Carpenter , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 36/37] lightnvm: pblk: remove some unnecessary NULL checks Date: Fri, 30 Mar 2018 00:05:23 +0200 Message-Id: <20180329220524.30363-37-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180329220524.30363-1-mb@lightnvm.io> References: <20180329220524.30363-1-mb@lightnvm.io> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dan Carpenter Smatch complains that flush_workqueue() dereferences the work queue pointer but then we check if it's NULL on the next line when it's too late. These NULL checks can be removed because the module won't load if we can't allocate the work queues. Signed-off-by: Dan Carpenter Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-gc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c index 7143b0f740fb..6851a5c67189 100644 --- a/drivers/lightnvm/pblk-gc.c +++ b/drivers/lightnvm/pblk-gc.c @@ -664,12 +664,10 @@ void pblk_gc_exit(struct pblk *pblk) kthread_stop(gc->gc_reader_ts); flush_workqueue(gc->gc_reader_wq); - if (gc->gc_reader_wq) - destroy_workqueue(gc->gc_reader_wq); + destroy_workqueue(gc->gc_reader_wq); flush_workqueue(gc->gc_line_reader_wq); - if (gc->gc_line_reader_wq) - destroy_workqueue(gc->gc_line_reader_wq); + destroy_workqueue(gc->gc_line_reader_wq); if (gc->gc_writer_ts) kthread_stop(gc->gc_writer_ts);