Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2491522pxb; Fri, 17 Sep 2021 10:56:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgV43En+uz8HArDVXUubFX7VBK+mXK6SHUv46WUcsHuyckhV+YtKhcVelmUapBf2OOK4ET X-Received: by 2002:a17:906:3383:: with SMTP id v3mr14169004eja.213.1631901378977; Fri, 17 Sep 2021 10:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631901378; cv=none; d=google.com; s=arc-20160816; b=QkVcyqYpTwPP2Qr5zu+GWB4AQKUCXQO/tAsmx6jAwsxd70TApuCeWZeH626tCVOhTS VmYQMUYvJgHvN53AatyH8QQv7H7VGPQdYbbWQmEowbdj+s6mitO86UyohDtRNjWMXebs Yg/ZCLVLQkqbKQ1LXYY3UFyc/1HtZCJa/I2Favr9Aqt4c3qXmpichrk/br9nbWFIZS8q etFoe1xxr01pZ7/hZtcYdiR5uMPRfk93SGEKTPLHkmGPVGtIv+gsqoVyfRaTvKVBzCMU 3aiH1asCOJT8AuRGCQ4X7JYemyqZToWCLM8cwC1hUE7WMNyOKFh5RlCx4mmzF/x6xJJM 5bwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=VNbJo+XCS8cyefdHjdL5f6p5ldrSnh49pViCY7kN6MQ=; b=NNUJbXEzL1j6hvuznYc/ol7zs/pCowhi9FuGTahF23a1MjfmfIc9Vm2Vp+o7NWV41r 64rC79R+CgOW+DJFhKeqcsSmlJyj20SEWBqsVszW1Tq8opM8W+ILDtx8/2Vehj1jmWkr 0F8YDpNZpkaADD/1asarTwaxoS5c2MB+CJuRv0ZlaBaYhmV0K9FPjem0zK3KS6iB8zOC g0jEIahW/gvScBjUtIMjxzCwiSal/50EpbVz2dzLI96Fy58sNvFlLhcgMX4VYh+BDqk+ 39eBg5ffeJ1wKX0xUF7Pfp4WLDij5trBZuHEGsdtlVIBQx1NvQJbG3z+uAtYxUD50r8S zGRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id da15si7820968edb.598.2021.09.17.10.55.54; Fri, 17 Sep 2021 10:56:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237928AbhIQIWz (ORCPT + 99 others); Fri, 17 Sep 2021 04:22:55 -0400 Received: from smtp25.cstnet.cn ([159.226.251.25]:56230 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230296AbhIQIWz (ORCPT ); Fri, 17 Sep 2021 04:22:55 -0400 Received: from localhost.localdomain (unknown [124.16.141.243]) by APP-05 (Coremail) with SMTP id zQCowABnR6D5T0Rhu_XRAA--.4840S2; Fri, 17 Sep 2021 16:21:14 +0800 (CST) From: Xu Wang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/swapfile: Remove needless request_queue NULL pointer check Date: Fri, 17 Sep 2021 08:21:11 +0000 Message-Id: <20210917082111.33923-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: zQCowABnR6D5T0Rhu_XRAA--.4840S2 X-Coremail-Antispam: 1UD129KBjvdXoWrJFWUWw1ftFWruw1fuw4kJFb_yoWxXFcEvr y0v3ykKrs5Xr13ur13CFyUZasYqFs2qF1xZFWfWFZIqayUGw13JrWDKr98GFW3Z3yjkr1r Cws0kasxJwsrCjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb4kYjsxI4VWDJwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I 8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI 64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6xkF7I0En7xvr7AKxVWUJV W8JwAv7VC2z280aVAFwI0_Cr1j6rxdMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0E wIxGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14 v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkG c2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_ Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxU2jXdUU UUU X-Originating-IP: [124.16.141.243] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCgkHA1z4j9xOIgAAsc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The request_queue pointer returned from bdev_get_queue() shall never be NULL, so the null check is unnecessary, just remove it. Signed-off-by: Xu Wang --- mm/swapfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index 22d10f713848..42027d213fd2 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -3118,7 +3118,7 @@ static bool swap_discardable(struct swap_info_struct *si) { struct request_queue *q = bdev_get_queue(si->bdev); - if (!q || !blk_queue_discard(q)) + if (!blk_queue_discard(q)) return false; return true; -- 2.17.1