Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4905138iob; Mon, 9 May 2022 04:33:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykokT9HGVq2ipfgbM8oM+YGliZ1RfstTJY2kGs/3aL+9sbfYHREjqRi7TXHp28v6HLslIL X-Received: by 2002:a17:903:3093:b0:15e:d850:56 with SMTP id u19-20020a170903309300b0015ed8500056mr16268101plc.152.1652096001839; Mon, 09 May 2022 04:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652096001; cv=none; d=google.com; s=arc-20160816; b=wPl/gpCAyQ4V3rQLLDVx4n0cG5DHpMor6tTE76QT7ss9QUHvoCxdZODo6czgUxkYbp bkdeHFKBjKF6LmMgcEFxFFIBusP2LzFAJJzUuJEdxpoSc439XBHlSoGZqzNNsHBJSNUF CSXNnhQT1g3/ZuBZw2Z39l2Xff9xKHfGhwSxoUuov7ooLGXMcwb9B3tIMHuv5UOTu+O4 E48jkupAZijRfbckAT15WqDHKr4zf3977DuBbxeZ8XGWwt1IOKSNNjkKkrxq4nTOxTMF mZHTTvdb+II4VpKBoApx1yy2IBMlhjG31ygWVuDpozI0r4MepgxI5tsWEN7wHfaGvcMM YUXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=40GR81qLBAKpQ1pdFfw5ZbcFKNAIeNjaSwOGqddCksA=; b=thgFGv2StmX+mZFdC25MXwF9gGYJBb2RxXbnZpx7oNkuH9BeFKq2N1M1vY74Xm832e VNRPRlbLyBO6Tdf6nQI6uDyXTeBuT1CmazISKUTNv59whkwOyrI3OqvY9NzdY+CQ+fCW U2wQ0mSUdx/21Hqdp1nDeMvIXhzqkdEQI2OjZMoDCyGdlGv7fpLpSXv71MuGygn7eFVn P/f/lDhBfnmoJWiBBneoaYBuu4BRaL/q6nfQB+kRjRmQnYwk5PCo9+ubrOrPm1PCUTYi unkBtYc0IliaGw9BjHg+dTc10uAP6Z1lr89v9c+smuGmqTlwIWYoNKyYNm9KGRgwE3Hu 8D4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=EYWTHAdH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 202-20020a6300d3000000b003c186ab908fsi14150982pga.525.2022.05.09.04.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 04:33:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=EYWTHAdH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C56E01ED582; Mon, 9 May 2022 03:38:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348401AbiEEIXR (ORCPT + 99 others); Thu, 5 May 2022 04:23:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346964AbiEEIU1 (ORCPT ); Thu, 5 May 2022 04:20:27 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B23FD4738D; Thu, 5 May 2022 01:16:46 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6F7012129A; Thu, 5 May 2022 08:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1651738605; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=40GR81qLBAKpQ1pdFfw5ZbcFKNAIeNjaSwOGqddCksA=; b=EYWTHAdH5RBPO4czJu3WhK/zfuAs3DPsQSFX7ShogW2nC4Y+RSVboPlZrXxv7vWz6rPt4r hH6yrF93UKdeG02In73kBwMr+ScCL3WB97iWJbmhTeE3jQIFTITqOW8UWBzubf6sOu4oSJ NLeFPsnT2hA+8Ihi6gyc0hhiGm3PHGg= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3FEC413B11; Thu, 5 May 2022 08:16:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WPtXDu2Hc2K1BwAAMHmgww (envelope-from ); Thu, 05 May 2022 08:16:45 +0000 From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Greg Kroah-Hartman Subject: [PATCH v3 06/21] xen/usb: switch xen-hcd to use INVALID_GRANT_REF Date: Thu, 5 May 2022 10:16:25 +0200 Message-Id: <20220505081640.17425-7-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220505081640.17425-1-jgross@suse.com> References: <20220505081640.17425-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of using a private macro for an invalid grant reference use the common one. Signed-off-by: Juergen Gross Acked-by: Greg Kroah-Hartman --- drivers/usb/host/xen-hcd.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/xen-hcd.c b/drivers/usb/host/xen-hcd.c index 3e487baf8422..9cbc7c2dab02 100644 --- a/drivers/usb/host/xen-hcd.c +++ b/drivers/usb/host/xen-hcd.c @@ -87,8 +87,6 @@ struct xenhcd_info { bool error; }; -#define GRANT_INVALID_REF 0 - #define XENHCD_RING_JIFFIES (HZ/200) #define XENHCD_SCAN_JIFFIES 1 @@ -1100,17 +1098,17 @@ static void xenhcd_destroy_rings(struct xenhcd_info *info) unbind_from_irqhandler(info->irq, info); info->irq = 0; - if (info->urb_ring_ref != GRANT_INVALID_REF) { + if (info->urb_ring_ref != INVALID_GRANT_REF) { gnttab_end_foreign_access(info->urb_ring_ref, (unsigned long)info->urb_ring.sring); - info->urb_ring_ref = GRANT_INVALID_REF; + info->urb_ring_ref = INVALID_GRANT_REF; } info->urb_ring.sring = NULL; - if (info->conn_ring_ref != GRANT_INVALID_REF) { + if (info->conn_ring_ref != INVALID_GRANT_REF) { gnttab_end_foreign_access(info->conn_ring_ref, (unsigned long)info->conn_ring.sring); - info->conn_ring_ref = GRANT_INVALID_REF; + info->conn_ring_ref = INVALID_GRANT_REF; } info->conn_ring.sring = NULL; } @@ -1123,8 +1121,8 @@ static int xenhcd_setup_rings(struct xenbus_device *dev, grant_ref_t gref; int err; - info->urb_ring_ref = GRANT_INVALID_REF; - info->conn_ring_ref = GRANT_INVALID_REF; + info->urb_ring_ref = INVALID_GRANT_REF; + info->conn_ring_ref = INVALID_GRANT_REF; urb_sring = (struct xenusb_urb_sring *)get_zeroed_page( GFP_NOIO | __GFP_HIGH); -- 2.35.3