From patchwork Tue Feb 19 21:15:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keyur Patel X-Patchwork-Id: 10821063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FFE313B5 for ; Wed, 20 Feb 2019 02:16:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6C882DB1A for ; Wed, 20 Feb 2019 02:16:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA8022DB1C; Wed, 20 Feb 2019 02:16:17 +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.1 required=2.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM, 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 6C8A72DB1B for ; Wed, 20 Feb 2019 02:16:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730283AbfBTCQL (ORCPT ); Tue, 19 Feb 2019 21:16:11 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:33556 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbfBTCQL (ORCPT ); Tue, 19 Feb 2019 21:16:11 -0500 Received: by mail-qt1-f196.google.com with SMTP id z39so25732798qtz.0; Tue, 19 Feb 2019 18:16:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nb+HcHL5nNL955Nd2X2UTE163Svkf9JDL2pHNFXhLkE=; b=VHlXNvEuQAEOrluwp0W3jB1xvWNft5hzopZ5ZEuI1M6K1nWvfmlnP8nPH1aC6oRkpf YVxtX+EKlwge3Gi16KA6Aw0LujaRjO/85KnKt3KFxT9LBn3bQ3fJTjXhyfrJEY6K05FF DnJuXZMjBvIP9E7u1+rWoqYwWiC5WXidNeleKLezndgWZzLPhuJw0LJuxDzgzb1ZDs12 40xgafIDPc1UyG23m89XfjeDO1y/BV3oRU700ZJzylRezl6FfMWCowJ49CYAQ7RCObW0 +pSJ4SbC1qoPygf1IuMcq81aijSfbCMNfI0PA5gTCcS6H+nrM/DZlpMgSm+GD4VYE01F V3XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nb+HcHL5nNL955Nd2X2UTE163Svkf9JDL2pHNFXhLkE=; b=QH5Js6gfnvXRSkgMV07RdQnDgUCOJ9bHVanq/wTi6P5QNeVtHxmdTYLUov7ybur7dA Om4ECJ0mHcUxny7jqi8WF0mm2phEMxJ4qvXcFe4T0gMHAy1SplcWvipiYmtjmB2cRKft ITbbZDHVc+4yrGO97niyTx1SZ+0MJaPdyVjaoifaIN7cS8VvHzmGhNIWnffRaF7buixK 1MuSb/nRWivRGQIsB6QP6nC+Xqtrh4SLfGgkYGFV7eNQL3Kg7xeAJcCxhKo7Sm1cd8+Z YjjNnhyfHAGVzEFe2YVKrl91UdBjhAfFxLzIG5+qFQ6l72n4s96AenFg4TuSo4C8S08D pMYw== X-Gm-Message-State: AHQUAubVlWXTxir6gpNOn7+4JzbsNQfafRzwnvJoLjekKbvbHAfJvDyU PQ4heg9ftTHI7Dpr53NVBg== X-Google-Smtp-Source: AHgI3IYW9ryYP/SZxRQndVdEfNyF3fYQV6b7DKPyOM6KZ7Hh6cqaCjfiehSk+ebhSIU+iHZ2+t3q3A== X-Received: by 2002:a0c:c48f:: with SMTP id u15mr21853873qvi.154.1550628970709; Tue, 19 Feb 2019 18:16:10 -0800 (PST) Received: from localhost.localdomain (modemcable148.230-83-70.mc.videotron.ca. [70.83.230.148]) by smtp.gmail.com with ESMTPSA id d55sm11000075qtb.93.2019.02.19.18.16.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 18:16:09 -0800 (PST) From: Keyur Patel X-Google-Original-From: Keyur Patel Cc: Keyur Patel , Greg Kroah-Hartman , Oliver Neukum , Alan Stern , Sebastian Andrzej Siewior , Paul Moore , Stephen Smalley , Kees Cook , "Eric W. Biederman" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: core: Replace hardcoded check with inline function from usb.h Date: Tue, 19 Feb 2019 16:15:50 -0500 Message-Id: <20190219211558.20809-1-iamkeyur96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Keyur Patel Expression (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_IN can be replaced by usb_urb_dir_in(struct urb *urb) from usb.h for better readability. Signed-off-by: Keyur Patel --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index d65566341dd1..29e2ff055e6e 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -604,7 +604,7 @@ static void async_completed(struct urb *urb) snoop(&urb->dev->dev, "urb complete\n"); snoop_urb(urb->dev, as->userurb, urb->pipe, urb->actual_length, as->status, COMPLETE, NULL, 0); - if ((urb->transfer_flags & URB_DIR_MASK) == URB_DIR_IN) + if (usb_urb_dir_in(urb)) snoop_urb_data(urb, urb->actual_length); if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET &&