From nobody Mon Sep 15 19:39:10 2025 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=none dis=none) header.from=linuxfoundation.org ARC-Seal: i=1; a=rsa-sha256; t=1673436685; cv=none; d=zohomail.com; s=zohoarc; b=MZhS3ktJHxOvBioprOM9LmURKQZDF7UgyF1YOpknjufG2xxT+pAwRG7a+Bjx6wNP0/BYQMd+efwqyPwbn87RFGf5iWsh/Sb4yO2onRKvC2m4GU390iP6K67lo1sGkMtwUomPeVwI4oobWFQfOulG1e5BEsSUtBYTfn24mQ53ZaM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673436685; 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=U4D9vKB40fpi84ZzrfHn2IUFF8EycxHQMmEywUdPKyc=; b=F1qGnhBAYBnYkY6xOpvtNkU1sUV4HVpcrOTGWWUT5s3ciVaX9Ujucx/PtLxfsw0wbpDnKGXQAPMI9P9Jq3C6iVkBavMjei8qtKIUfSdRTZkDQZ3WgGa3kHNkd60SC5nE6j0zxAZroU7hiw8new3Qvim5AkGBvZaP9Z47GNDGq0Q= 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=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1673436685210742.0565838989377; Wed, 11 Jan 2023 03:31:25 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.475211.736799 (Exim 4.92) (envelope-from ) id 1pFZJo-0006Vr-D9; Wed, 11 Jan 2023 11:30:56 +0000 Received: by outflank-mailman (output) from mailman id 475211.736799; Wed, 11 Jan 2023 11:30:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFZJo-0006Vk-AU; Wed, 11 Jan 2023 11:30:56 +0000 Received: by outflank-mailman (input) for mailman id 475211; Wed, 11 Jan 2023 11:30:54 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFZJm-0006Ve-JF for xen-devel@lists.xenproject.org; Wed, 11 Jan 2023 11:30:54 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 680acd88-91a3-11ed-91b6-6bf2151ebd3b; Wed, 11 Jan 2023 12:30:53 +0100 (CET) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 81C1EB81B8D; Wed, 11 Jan 2023 11:30:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D688C433EF; Wed, 11 Jan 2023 11:30:50 +0000 (UTC) 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: 680acd88-91a3-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673436651; bh=WJ96hH6M2QWhqMqos8NlJvpLqVVBxtYsuEjUoVykxZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X7a5KWZHBLMUkKm8d7N1mA+UILCUqbJnKRAWqBLYnqLFbEiClsPP+hZZV1xghrAa6 /mZHoqJZQ3wMqDA66QoIsvm5lc2i9xyw4j4Qa9qsBNa5/OJ4Pcg7bemhED9vtRGmtJ c/TGi6+t/6rL26PggxIY0N2xBa4fplpGKMUGxUKo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , xen-devel@lists.xenproject.org Subject: [PATCH v2 14/16] xen/xenbus: move to_xenbus_device() to use container_of_const() Date: Wed, 11 Jan 2023 12:30:16 +0100 Message-Id: <20230111113018.459199-15-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111113018.459199-1-gregkh@linuxfoundation.org> References: <20230111113018.459199-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1111; i=gregkh@linuxfoundation.org; h=from:subject; bh=WJ96hH6M2QWhqMqos8NlJvpLqVVBxtYsuEjUoVykxZs=; b=owGbwMvMwCRo6H6F97bub03G02pJDMn75p5iDqjYGXvtfmJbfiGLYEh0rmbzkQfMxlmZT6a8f3xz mmVIRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExEzINhnumZBRPTnvPn53v37j2tLX W4Ri/vPsM8/VuB8089evrezHar0ST1/HL+f+5XAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linuxfoundation.org) X-ZM-MESSAGEID: 1673436686398100001 Content-Type: text/plain; charset="utf-8" The driver core is changing to pass some pointers as const, so move to_xenbus_device() to use container_of_const() to handle this change. to_xenbus_device() now properly keeps the const-ness of the pointer passed into it, while as before it could be lost. Cc: Juergen Gross Cc: Stefano Stabellini Cc: Oleksandr Tyshchenko Cc: xen-devel@lists.xenproject.org Signed-off-by: Greg Kroah-Hartman Acked-by: Juergen Gross --- include/xen/xenbus.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index eaa932b99d8a..b31f77f9c50c 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h @@ -96,10 +96,7 @@ struct xenbus_device { unsigned int spurious_threshold; }; =20 -static inline struct xenbus_device *to_xenbus_device(struct device *dev) -{ - return container_of(dev, struct xenbus_device, dev); -} +#define to_xenbus_device(__dev) container_of_const(__dev, struct xenbus_de= vice, dev) =20 struct xenbus_device_id { --=20 2.39.0