From patchwork Fri Mar 2 15:53:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10255075 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 7FF40602B5 for ; Fri, 2 Mar 2018 15:53:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7030E28A08 for ; Fri, 2 Mar 2018 15:53:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 635EF28A0C; Fri, 2 Mar 2018 15:53:25 +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,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 D2B9528A08 for ; Fri, 2 Mar 2018 15:53:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425570AbeCBPxX (ORCPT ); Fri, 2 Mar 2018 10:53:23 -0500 Received: from xavier.telenet-ops.be ([195.130.132.52]:54816 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424741AbeCBPxW (ORCPT ); Fri, 2 Mar 2018 10:53:22 -0500 Received: from ayla.of.borg ([84.194.111.163]) by xavier.telenet-ops.be with bizsmtp id H3tL1x00Q3XaVaC013tLdz; Fri, 02 Mar 2018 16:53:20 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1ermzo-0003vg-GR; Fri, 02 Mar 2018 16:53:20 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1ermzo-0003ZJ-F5; Fri, 02 Mar 2018 16:53:20 +0100 From: Geert Uytterhoeven To: Jens Axboe Cc: Arnd Bergmann , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2] block: Add default switch case to blk_pm_allow_request() to kill warning Date: Fri, 2 Mar 2018 16:53:19 +0100 Message-Id: <1520005999-13679-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 2.7.4 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: block/blk-core.c: In function 'blk_pm_allow_request': block/blk-core.c:2653: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 --- 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 2d1a7bbe063437bf..81d2928ce4e9d370 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2656,9 +2656,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)