From patchwork Fri Nov 5 20:37:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12605465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EF0FC433EF for ; Fri, 5 Nov 2021 20:37:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 211E360720 for ; Fri, 5 Nov 2021 20:37:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 211E360720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id ACA08940030; Fri, 5 Nov 2021 16:37:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A0366940007; Fri, 5 Nov 2021 16:37:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8CE79940030; Fri, 5 Nov 2021 16:37:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 761DC940007 for ; Fri, 5 Nov 2021 16:37:21 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 34B721856A8C9 for ; Fri, 5 Nov 2021 20:37:21 +0000 (UTC) X-FDA: 78776036682.18.1521C65 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP id 8AFEC20019E2 for ; Fri, 5 Nov 2021 20:37:21 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id CF0E660E08; Fri, 5 Nov 2021 20:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636144640; bh=ocH+yVvAf4/EjIgaD54nWyy2pMZQ33fGsi9sbCMjpyE=; h=Date:From:To:Subject:In-Reply-To:From; b=xxCgZkbByb/JuEgUC5tr6XhrDYrM1o7zYSDwgKHGFdzeRdfE+EFaAjpvBaOTwWtzx a5caNLO1CwtourKpBSV6MSk5S2p3nqYEMFG3v/VDirSTlt7n/qFhHrRPMEnNU6w33G JNnZNtEdOrfY5FeYFStFLfYuo9R+Rf4ZwX1ORQbY= Date: Fri, 05 Nov 2021 13:37:19 -0700 From: Andrew Morton To: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, vulab@iscas.ac.cn Subject: [patch 051/262] mm/swapfile: remove needless request_queue NULL pointer check Message-ID: <20211105203719.-ssTsYg32%akpm@linux-foundation.org> In-Reply-To: <20211105133408.cccbb98b71a77d5e8430aba1@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 8AFEC20019E2 X-Stat-Signature: por9ag8uza1jd5cabwhhswwmghibktoz Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=xxCgZkbB; spf=pass (imf26.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1636144641-523447 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Xu Wang Subject: mm/swapfile: remove needless request_queue NULL pointer check The request_queue pointer returned from bdev_get_queue() shall never be NULL, so the null check is unnecessary, just remove it. Link: https://lkml.kernel.org/r/20210917082111.33923-1-vulab@iscas.ac.cn Signed-off-by: Xu Wang Acked-by: David Hildenbrand Signed-off-by: Andrew Morton --- mm/swapfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/swapfile.c~mm-swapfile-remove-needless-request_queue-null-pointer-check +++ a/mm/swapfile.c @@ -3118,7 +3118,7 @@ static bool swap_discardable(struct swap { struct request_queue *q = bdev_get_queue(si->bdev); - if (!q || !blk_queue_discard(q)) + if (!blk_queue_discard(q)) return false; return true;