Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9302807rwl; Wed, 11 Jan 2023 04:10:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXu534WhV3oRGG3tfyqKzoIoHCHVtotqonCTiNt5lehd/ycf5ydYKmdU5p20zmJMYGZeq6SC X-Received: by 2002:a17:902:f08c:b0:192:a480:208c with SMTP id p12-20020a170902f08c00b00192a480208cmr2127135pla.19.1673439021734; Wed, 11 Jan 2023 04:10:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673439021; cv=none; d=google.com; s=arc-20160816; b=OtIpyzioITHaGxq574oDLuoMppDDVXHqljJWeY6rLz3WKcIjjocCXJmvNR+SL2IbPX 3rq+QaDDD41yzQhoU8rbU5aI8Q6EiSGiHYpP1dOwoo+8cx2ZCq3CQd//tesyCPjEHZdW bOQWdGCXvY2SIDHz1aBEADmkUlZiKUphEjZCYkA8e16/HVyjCva544TS4U9l5s4GqqpU WrYsW7GstpvOzLn0a+EKlOanNj7PBktb/kothoBaTygMOwKObN9n8qiN6IvIYsp7PTMx Y/6xTU2rSE6yuR9u4CDFUiYrfC1+Cj5t8DAyJRQZzChR/Yp2z3eHp0poYuR057vwvFmf GIFQ== 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=acS2n8MJA8KU0DrqsdTHv/3Pqe8/K22dkE+CfbrUXn8=; b=fVldCpGMo/4hxhv5dSMuyYY9dl3zkbWbRFHdLVr5pQJ5HLV+DZ8begChA5Xg6MV7fo MXXo7xVKWgITDtBAuZwOg3SmNKTsAFWdGTaFe1agYhpZJACfkGYi+8ifs+k1fYHKXnnD L1kR+OOp+/h87xWziwbmmqCjvf5W6tZT1nRs7PTAgRgilVPDcNKzok9MEeWNEN48al2b yStw7qxTJLuruaMfSORJBov5aWXT6HUh1CSv+oHAj8nnmBgPEqj1Y+w15zk37OMU/l// qF05WkzffQS5Hat788hzYMtArbkJMzTcHWVxLOeu9puv32AegoZwgOoTJvpOfl05UUmS PrWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2sy49pou; 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 g10-20020a170902d1ca00b00186bb39ff55si12543494plb.427.2023.01.11.04.10.15; Wed, 11 Jan 2023 04:10: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=2sy49pou; 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 S231875AbjAKLbf (ORCPT + 53 others); Wed, 11 Jan 2023 06:31:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232316AbjAKLaj (ORCPT ); Wed, 11 Jan 2023 06:30:39 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4D5B95B3; Wed, 11 Jan 2023 03:30:37 -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 8E7E9B81B8D; Wed, 11 Jan 2023 11:30:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D55ADC433EF; Wed, 11 Jan 2023 11:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673436635; bh=n8OnoHXUKt8/vexOA9DOw2P/znFEmBc1dMUhPM/P1nE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2sy49pouXHeFMASqr063ewfQj/lTX3SXAOjasByVHYZhWJtGQf+RQpeHziZY54PeY JXq+p19tkWKhMMWJx/E/kp6W25ZORCcL6ZjLRYaGln7pPm8n61zZDJYS4UjHnpI6PH Zz4N6jXJRlr1PtNp9rX+/FZOhZkDRoyUJupRvbEM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , linux-hyperv@vger.kernel.org Subject: [PATCH v2 10/16] drivers: hv: move device_to_hv_device to use container_of_const() Date: Wed, 11 Jan 2023 12:30:12 +0100 Message-Id: <20230111113018.459199-11-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=1177; i=gregkh@linuxfoundation.org; h=from:subject; bh=n8OnoHXUKt8/vexOA9DOw2P/znFEmBc1dMUhPM/P1nE=; b=owGbwMvMwCRo6H6F97bub03G02pJDMn75p68dtJ97m/PZ6YrTvN9j4tZYrzO51pEfViqqM8V7m6l c1nnO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiN+4zzHd07zprkHDlNOMpv//hrd tW83MGBTEs2BxmsuBRzpwd6/jnMYrpL0sXlnjlCAA= 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 device_to_hv_device() to use container_of_const() to handle this change. device_to_hv_device() now properly keeps the const-ness of the pointer passed into it, while as before it could be lost. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Wei Liu Cc: Dexuan Cui Cc: linux-hyperv@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- include/linux/hyperv.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 85f7c5a63aa6..8430e27f3c3f 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -1309,10 +1309,7 @@ struct hv_device { }; -static inline struct hv_device *device_to_hv_device(struct device *d) -{ - return container_of(d, struct hv_device, device); -} +#define device_to_hv_device(d) container_of_const(d, struct hv_device, device) static inline struct hv_driver *drv_to_hv_drv(struct device_driver *d) { -- 2.39.0