Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9264315rwl; Wed, 11 Jan 2023 03:41:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXvw7PHr8mKO/+Yv03nx6fNdHPsOPbNLu1J0TDHKjiQOkwNxXu3RLAmnrOHyB0eLOBG7eO55 X-Received: by 2002:a17:906:99c7:b0:7ae:b637:633f with SMTP id s7-20020a17090699c700b007aeb637633fmr82853883ejn.4.1673437281437; Wed, 11 Jan 2023 03:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673437281; cv=none; d=google.com; s=arc-20160816; b=feBQiczMwhKvTcMe8jTf12jpqKlYfgzCypTGUMxhDE3e/kZgMTcHcmDsrV6phAcgoD Fjf7+g0IOkdJo8wURZYGAqtxMO0+gMClG9lI/tRLutlFixcVw3hOelPuwYMuVP2SHcEj 6xic7ha8GDXy0InB/fXxgLIOmT1lK+bzF92/Vcs6RXnpvT5jy8crko7nC3T0TdyQ/fsj 9LTFD8j2AbvRt1UwVc9HuAnC87uG2El3fTpXgy7pC+vloM5SXOkw6UeKXpLcrCF09onz 4MnKYkpAHbnc/KL2rpEliRVuPhJlvObpEamboleTRAaBfuYqfKICzvhbf38X1h3FtPsr EH0g== 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=U4D9vKB40fpi84ZzrfHn2IUFF8EycxHQMmEywUdPKyc=; b=mM7f6T+ELjT46zb/IET9NR+J8L5SW1aXZrm5RdLZX5kep2/np5IgDHGrB5F202oD1E 86gMC41fW7FcVEMzRm96PoiKnzK4pCRy9I6dtqJAgJUpq9wjjn+Uu5gMEV0BxYc1wqnn MUoxPmCZPtCRLdGH5VM2JVPf4Ev/n8Jn2iSaNBOZRk7zcamZTsx5ZYPl/FnaaMn6+ypb Uf2vx+816VutfBp2+1A7cX8jP96kFDAJGdY8NwZAOErqWux/6lkaYkqFybB+QyiHgY2B kMrTnvrRJH3NPmrbxTAF1iLvaPBFZikgI0uY10IqHm3mG56cYJ34JnMTBD+Ftqlb1UaE g2XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X7a5KWZH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xb13-20020a170907070d00b0081a9c3ca4c3si14590631ejb.374.2023.01.11.03.41.07; Wed, 11 Jan 2023 03:41:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X7a5KWZH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232408AbjAKLbL (ORCPT + 53 others); Wed, 11 Jan 2023 06:31:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233049AbjAKLaz (ORCPT ); Wed, 11 Jan 2023 06:30:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D544AB9E for ; Wed, 11 Jan 2023 03:30:53 -0800 (PST) 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 89C85B81BAC for ; 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) 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: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 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 --- 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; }; -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_device, dev) struct xenbus_device_id { -- 2.39.0