From patchwork Wed Jun 8 20:49:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 9165663 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 CD1CE60832 for ; Wed, 8 Jun 2016 20:50:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC5D328047 for ; Wed, 8 Jun 2016 20:50:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F74D282DC; Wed, 8 Jun 2016 20:50:01 +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 44D8F28047 for ; Wed, 8 Jun 2016 20:50:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425374AbcFHUtz (ORCPT ); Wed, 8 Jun 2016 16:49:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45840 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425323AbcFHUtr (ORCPT ); Wed, 8 Jun 2016 16:49:47 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9073580082; Wed, 8 Jun 2016 20:49:46 +0000 (UTC) Received: from rh2.redhat.com (vpn-61-23.rdu2.redhat.com [10.10.61.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u58KnicT014353; Wed, 8 Jun 2016 16:49:45 -0400 From: mchristi@redhat.com To: linux-ext4@vger.kernel.org, linux-block@vger.kernel.org Cc: Mike Christie Subject: [PATCH 2/2] mg_disk: fix enum REQ_OP_ kbuild error Date: Wed, 8 Jun 2016 15:49:41 -0500 Message-Id: <1465418981-7360-3-git-send-email-mchristi@redhat.com> In-Reply-To: <1465418981-7360-1-git-send-email-mchristi@redhat.com> References: <1465418981-7360-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 08 Jun 2016 20:49:46 +0000 (UTC) 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: Mike Christie Because we define WRITE/READ as REQ_OPs, we cannot do switch (rq_data_dir(request)) case READ .... case WRITE ... without getting warnings about handling other REQ_OPs. This just has mq_disk do a if/else like it does in other places. Signed-off-by: Mike Christie --- drivers/block/mg_disk.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c index 145ce2a..1ee3918 100644 --- a/drivers/block/mg_disk.c +++ b/drivers/block/mg_disk.c @@ -687,15 +687,13 @@ static unsigned int mg_issue_req(struct request *req, unsigned int sect_num, unsigned int sect_cnt) { - switch (rq_data_dir(req)) { - case READ: + if (rq_data_dir(req) == READ) { if (mg_out(host, sect_num, sect_cnt, MG_CMD_RD, &mg_read_intr) != MG_ERR_NONE) { mg_bad_rw_intr(host); return host->error; } - break; - case WRITE: + } else { /* TODO : handler */ outb(ATA_NIEN, (unsigned long)host->dev_base + MG_REG_DRV_CTRL); if (mg_out(host, sect_num, sect_cnt, MG_CMD_WR, &mg_write_intr) @@ -714,7 +712,6 @@ static unsigned int mg_issue_req(struct request *req, mod_timer(&host->timer, jiffies + 3 * HZ); outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base + MG_REG_COMMAND); - break; } return MG_ERR_NONE; }