From nobody Mon Feb 9 17:37:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1650467429; cv=none; d=zohomail.com; s=zohoarc; b=UQT8Bz3g9K8xOOER9IlPs9fb1+Zv8CPSBeSfK1Y/d3n8Sz6KxXqHBLTa/9YM/EfC3mxSa/KnTfhGuRWa3jMg1KqVdWP0ISxtGk0rd/h45ccy5XRizuAUfuUwxId1jxOVQ2uwIeBa6PtcX/DKDItQcaBNUfYbuE0hUAh7JcuFM1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650467429; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SPIngja7rfH6/X0ahWtYB7L7nX8NRl4zj/+cjR7xZr0=; b=kSbE6iL+6st/6U4SJTGFMZhOcJs5+w3p9qBmf4nKIKvqTdS2crgOEZeHg3jmz7Ivme7DQ1Jty1BJfWobLb6y0q7oOArXkSf0qm+eBV99M+rsTIWiZVnNExpTS/UX4kshBz9jq3l8NboxNbhyILHsFd0xNeglnl9f6GJn3lHiYko= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1650467429756386.4195867351991; Wed, 20 Apr 2022 08:10:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.309354.525543 (Exim 4.92) (envelope-from ) id 1nhBy1-00058X-Rn; Wed, 20 Apr 2022 15:10:05 +0000 Received: by outflank-mailman (output) from mailman id 309354.525543; Wed, 20 Apr 2022 15:10:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nhBy1-000545-D2; Wed, 20 Apr 2022 15:10:05 +0000 Received: by outflank-mailman (input) for mailman id 309354; Wed, 20 Apr 2022 15:10:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nhBxz-0003l9-70 for xen-devel@lists.xenproject.org; Wed, 20 Apr 2022 15:10:03 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f280d0b4-c0bb-11ec-8fbf-03012f2f19d4; Wed, 20 Apr 2022 17:10:00 +0200 (CEST) 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 1094E215FC; Wed, 20 Apr 2022 15:10:00 +0000 (UTC) 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 DDE5413AD5; Wed, 20 Apr 2022 15:09:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iEbyNEciYGJILQAAMHmgww (envelope-from ); Wed, 20 Apr 2022 15:09:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f280d0b4-c0bb-11ec-8fbf-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1650467400; 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=SPIngja7rfH6/X0ahWtYB7L7nX8NRl4zj/+cjR7xZr0=; b=izW36Q/K4I+x9+ssoIZTIP6kcaOBnqGIAchacXhFrguclN9mlcwDy5Y3j6XIl58RxItKh2 yFKJRHgSaBRlN10cFBSOt7Ea7MtSQEgQQW0NFvI/a+0rlT0kNILSRJWUf2qg0/waqA7ALN NEaH3ZeHIDVzSTHBGCrCGbqlRrM0AMs= From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini Subject: [PATCH 07/18] xen/dmabuf: switch gntdev-dmabuf to use INVALID_GRANT_REF Date: Wed, 20 Apr 2022 17:09:31 +0200 Message-Id: <20220420150942.31235-8-jgross@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220420150942.31235-1-jgross@suse.com> References: <20220420150942.31235-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1650467430915100002 Content-Type: text/plain; charset="utf-8" Instead of using a private macro for an invalid grant reference use the common one. Signed-off-by: Juergen Gross --- drivers/xen/gntdev-dmabuf.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c index d5bfd7b867fc..91073b4e4a20 100644 --- a/drivers/xen/gntdev-dmabuf.c +++ b/drivers/xen/gntdev-dmabuf.c @@ -24,15 +24,6 @@ =20 MODULE_IMPORT_NS(DMA_BUF); =20 -#ifndef GRANT_INVALID_REF -/* - * Note on usage of grant reference 0 as invalid grant reference: - * grant reference 0 is valid, but never exposed to a driver, - * because of the fact it is already in use/reserved by the PV console. - */ -#define GRANT_INVALID_REF 0 -#endif - struct gntdev_dmabuf { struct gntdev_dmabuf_priv *priv; struct dma_buf *dmabuf; @@ -532,7 +523,7 @@ static void dmabuf_imp_end_foreign_access(u32 *refs, in= t count) int i; =20 for (i =3D 0; i < count; i++) - if (refs[i] !=3D GRANT_INVALID_REF) + if (refs[i] !=3D INVALID_GRANT_REF) gnttab_end_foreign_access(refs[i], 0UL); } =20 @@ -567,7 +558,7 @@ static struct gntdev_dmabuf *dmabuf_imp_alloc_storage(i= nt count) gntdev_dmabuf->nr_pages =3D count; =20 for (i =3D 0; i < count; i++) - gntdev_dmabuf->u.imp.refs[i] =3D GRANT_INVALID_REF; + gntdev_dmabuf->u.imp.refs[i] =3D INVALID_GRANT_REF; =20 return gntdev_dmabuf; =20 --=20 2.34.1