From patchwork Fri Jul 6 08:49:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10511067 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 178EF600CA for ; Fri, 6 Jul 2018 08:49:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 075AB284B1 for ; Fri, 6 Jul 2018 08:49:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEB4F284BD; Fri, 6 Jul 2018 08:49:40 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 43341284C8 for ; Fri, 6 Jul 2018 08:49:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752681AbeGFItj (ORCPT ); Fri, 6 Jul 2018 04:49:39 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:45332 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751517AbeGFIti (ORCPT ); Fri, 6 Jul 2018 04:49:38 -0400 Received: from ayla.of.borg ([84.194.111.163]) by xavier.telenet-ops.be with bizsmtp id 7Lpc1y00c3XaVaC01LpcQl; Fri, 06 Jul 2018 10:49:36 +0200 Received: from rox.of.borg ([192.168.97.57]) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1fbMQq-0004w1-Mn; Fri, 06 Jul 2018 10:49:36 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1fbMQq-0007uR-Kd; Fri, 06 Jul 2018 10:49:36 +0200 From: Geert Uytterhoeven To: Jens Axboe Cc: Arnd Bergmann , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3] block: Add default switch case to blk_pm_allow_request() to kill warning Date: Fri, 6 Jul 2018 10:49:35 +0200 Message-Id: <20180706084935.30359-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 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 With gcc 4.9.0 and 7.3.0: block/blk-core.c: In function 'blk_pm_allow_request': block/blk-core.c:2747:2: warning: enumeration value 'RPM_ACTIVE' not handled in switch [-Wswitch] switch (rq->q->rpm_status) { ^ Convert the return statement below the switch() block into a default case to fix this. Fixes: e4f36b249b4d4e75 ("block: fix peeking requests during PM") Signed-off-by: Geert Uytterhoeven Reviewed-by: Christoph Hellwig --- v3: - Update line number, - Add gcc 7.3.0, v2: - Add Reviewed-by, - Update line number. --- block/blk-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index f84a9b7b6f5aa167..40e495073bdeec32 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2750,9 +2750,9 @@ static bool blk_pm_allow_request(struct request *rq) return rq->rq_flags & RQF_PM; case RPM_SUSPENDED: return false; + default: + return true; } - - return true; } #else static bool blk_pm_allow_request(struct request *rq)