From patchwork Mon Jan 8 20:21:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Lyle X-Patchwork-Id: 10150539 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 C485F602CA for ; Mon, 8 Jan 2018 20:22:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF94B2858C for ; Mon, 8 Jan 2018 20:22:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE51028755; Mon, 8 Jan 2018 20:22:14 +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 1DD2328A58 for ; Mon, 8 Jan 2018 20:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757223AbeAHUVp (ORCPT ); Mon, 8 Jan 2018 15:21:45 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:45394 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934227AbeAHUVn (ORCPT ); Mon, 8 Jan 2018 15:21:43 -0500 Received: by mail-pg0-f67.google.com with SMTP id c194so5324865pga.12 for ; Mon, 08 Jan 2018 12:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lyle-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ROdtTBTZ6zQMizJciRUSGndq1U7oV7l7L/K0LmyMWkU=; b=Ay1bB9BPWWDcX3Vbvv1eP9pqQg7GG0+TyQ2VrAf+ej3ZBwo4/FtgOzaYJuVu1TIUgh j50uXM7zdW63CJjNVQUILHJ4iwBuopgpyXeFUfvKpbW7GXiTP2V6vqxzwvHz7qnIfN7P Cv+pJoJDPqkqrcZo03NrcdiG9Hhg1j04SEe+IHXwv/9HHiopo0gBL1Cd9D/MoRj04nWU eUP6PXjoEG47ItNWLqTyyL/nuDjLL9FRwyYn4ZOSxXxRnkD8Oti4xsy+tJGAtO6kddyg +/NzyMdIa1+xwUSfd5ODn80g6fVR1yHIFPT612XpU4gvNvxsZy0+H7xFa4iQrmq6Cor7 qc0Q== 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; bh=ROdtTBTZ6zQMizJciRUSGndq1U7oV7l7L/K0LmyMWkU=; b=iDOQdh43WnNrrm/OlH4Bg07OJf4DXx0GTNK+IRkjcbmKaUYAbHuGduEcXQnQ0Fhz3i 8+wje4Nq8dETt7j67Jy8CuxceFGDxcac/gRn2Xe1KGlf4iQ0Llop2rKKfLMhBqyFP7yN 7pIVm55lbrEsooU0DMY1xdr8vRnwCKNxCq8mesucAehbbRYIBdUZhRwDE3OqrvFn74iK OIhiKKO/BgRcz8vO5N63DiQ/soZar/H6+S/A/1sP8yXSBVhLIoyHwklJPj7JH/i9PgX9 R6hjGRIS+pd7rldwWPLS/wOzK6p9r/IKQFbV1+C3KVLocnu5OHsNquDqkl0KrCZ64onW I0WA== X-Gm-Message-State: AKGB3mI+e3nmd3bpwLuwN8z+wL6HcyHnyI+dmvmtpjyw2fjo1BMCNWsV PkJmLu/5RSsyHPOnnpPV9HC1Jg== X-Google-Smtp-Source: ACJfBosEJw839PuO5TJbp+C7/1nleAgw7zhL1Ro0oLWLjK4C+3SkSq6GqDcMDXf5Gx4jDKSMLLx+WQ== X-Received: by 10.99.139.195 with SMTP id j186mr6173848pge.188.1515442902916; Mon, 08 Jan 2018 12:21:42 -0800 (PST) Received: from midnight.lan (2600-6c52-6200-383d-a0f8-4aea-fac9-9f39.dhcp6.chtrptr.net. [2600:6c52:6200:383d:a0f8:4aea:fac9:9f39]) by smtp.gmail.com with ESMTPSA id o70sm28540227pfk.79.2018.01.08.12.21.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 12:21:42 -0800 (PST) From: Michael Lyle To: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org Cc: axboe@fb.com, Vasyl Gomonovych Subject: [416 PATCH 03/13] bcache: Use PTR_ERR_OR_ZERO() Date: Mon, 8 Jan 2018 12:21:20 -0800 Message-Id: <20180108202130.31303-4-mlyle@lyle.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180108202130.31303-1-mlyle@lyle.org> References: <20180108202130.31303-1-mlyle@lyle.org> 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: Vasyl Gomonovych Fix ptr_ret.cocci warnings: drivers/md/bcache/btree.c:1800:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vasyl Gomonovych Reviewed-by: Michael Lyle --- drivers/md/bcache/btree.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index ebb1874218e7..9e30713dbdb8 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -1804,10 +1804,7 @@ static int bch_gc_thread(void *arg) int bch_gc_thread_start(struct cache_set *c) { c->gc_thread = kthread_run(bch_gc_thread, c, "bcache_gc"); - if (IS_ERR(c->gc_thread)) - return PTR_ERR(c->gc_thread); - - return 0; + return PTR_ERR_OR_ZERO(c->gc_thread); } /* Initial partial gc */