From patchwork Thu Mar 8 01:10:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10265759 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 86A516055D for ; Thu, 8 Mar 2018 01:10:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78F7D295F2 for ; Thu, 8 Mar 2018 01:10:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DD6C295F4; Thu, 8 Mar 2018 01:10:19 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 1D025295F3 for ; Thu, 8 Mar 2018 01:10:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755044AbeCHBKR (ORCPT ); Wed, 7 Mar 2018 20:10:17 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:22142 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755136AbeCHBKP (ORCPT ); Wed, 7 Mar 2018 20:10:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1520471415; x=1552007415; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=OxhjjWLui5/lb/+cZFdA5bBx+B2XEuZn475qPxEY2i8=; b=CzqMr13WKLd7BalEkqvSu3UgPXi9pseC5Eu8nA0U4j9DjOxfwYdAcg6s FmbnH5d5NhQe/tA0xfDZmCDFHnAOkC8YBmxVE+Y4wggx/dTbl2Uenb+3x YRBQgWAvx5Y1VPrkJOXG+Tr7NT8T61ajQXdgJ26haw648G16KojzmwRG3 Lzf+d7OkMuKYcVdeoJbTLTgN/vyD18a0EaJ9LB23y0qdqcelNCOio1Ee/ eqy/XAhrqaT7zSQ358MelK7g2qxCoxiK3ll4/CIIvnuaDS8kwgCmHjjHt QA0oXsTu8itzXL1D0Ljth1AOYz+wTlWVBY2SUX9sz4OI059tbn4peWdUV Q==; X-IronPort-AV: E=Sophos;i="5.47,438,1515427200"; d="scan'208";a="72999160" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 08 Mar 2018 09:10:13 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 07 Mar 2018 17:04:04 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Mar 2018 17:10:14 -0800 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Hannes Reinecke , Ming Lei Subject: [PATCH v2 05/11] mtip32xx: Use the blk_queue_flag_*() functions Date: Wed, 7 Mar 2018 17:10:06 -0800 Message-Id: <20180308011012.31522-6-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180308011012.31522-1-bart.vanassche@wdc.com> References: <20180308011012.31522-1-bart.vanassche@wdc.com> 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 Use the blk_queue_flag_*() functions instead of open-coding these. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Reviewed-by: Martin K. Petersen Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei --- drivers/block/mtip32xx/mtip32xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index b8af7352a18f..769c551e3d71 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -159,7 +159,7 @@ static bool mtip_check_surprise_removal(struct pci_dev *pdev) if (vendor_id == 0xFFFF) { dd->sr = true; if (dd->queue) - set_bit(QUEUE_FLAG_DEAD, &dd->queue->queue_flags); + blk_queue_flag_set(QUEUE_FLAG_DEAD, dd->queue); else dev_warn(&dd->pdev->dev, "%s: dd->queue is NULL\n", __func__); @@ -3855,8 +3855,8 @@ static int mtip_block_initialize(struct driver_data *dd) goto start_service_thread; /* Set device limits. */ - set_bit(QUEUE_FLAG_NONROT, &dd->queue->queue_flags); - clear_bit(QUEUE_FLAG_ADD_RANDOM, &dd->queue->queue_flags); + blk_queue_flag_set(QUEUE_FLAG_NONROT, dd->queue); + blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, dd->queue); blk_queue_max_segments(dd->queue, MTIP_MAX_SG); blk_queue_physical_block_size(dd->queue, 4096); blk_queue_max_hw_sectors(dd->queue, 0xffff); @@ -3866,7 +3866,7 @@ static int mtip_block_initialize(struct driver_data *dd) /* Signal trim support */ if (dd->trim_supp == true) { - set_bit(QUEUE_FLAG_DISCARD, &dd->queue->queue_flags); + blk_queue_flag_set(QUEUE_FLAG_DISCARD, dd->queue); dd->queue->limits.discard_granularity = 4096; blk_queue_max_discard_sectors(dd->queue, MTIP_MAX_TRIM_ENTRY_LEN * MTIP_MAX_TRIM_ENTRIES);