From patchwork Wed Dec 7 16:07:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13067308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85133C4708E for ; Wed, 7 Dec 2022 16:09:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EF0F210E3E6; Wed, 7 Dec 2022 16:09:18 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id F40B310E3D9 for ; Wed, 7 Dec 2022 16:09:10 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 57F075C00A6; Wed, 7 Dec 2022 11:09:10 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 07 Dec 2022 11:09:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1670429350; x= 1670515750; bh=px2+MbhbeI+jrnsZ/vqUEifAPSMXpR4NGEBEX3i+hsw=; b=Y CaxLUsx7sbkNkpYxwbVV5dtH3TbJG0pr0L1judfcJdwMCQJzJCnZiIavSMV0g7Ks YyF0gdwyjwrG8q2N12xJsmPVQokQJsajMUdflALXTZKRVAnyeFpcGV2SCDnoFvEq V79ab1iMFu0eCrT6zMrjypZoNueZBiBvenCg7nmpEClMlFr/BmbujZxd8E3VnC3x u3Dn0QB5/qszbtHKgTdimHbu2gbvoNKcibQV9UMz6OigNVMxIrswoqqXyLBRqJ2h vaKQWFvb7Z3XIXoYVYeGTTnzM6rFfhw1XTCEd3NM1j0wEGxOh0+sKJGwuZxHKuAV NIa+wcCDnwzADN9rZQ0LA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1670429350; x= 1670515750; bh=px2+MbhbeI+jrnsZ/vqUEifAPSMXpR4NGEBEX3i+hsw=; b=l anFwiR4bWUyMdKHuFjfIMQCTitktsAklfKzRoMPcyJXuMmRlc7VZKWoKmTiPGQB+ dLSNYHA38TqvPt7u1jFmf7hWoASTn0ndYdI5GdGSwLA8F8wNiuzWEI5Q56Rh/f8O 8xvGrVJZYncHbJJFZcCso28KaXesRnt24L1lzCs4579Znz1RG/2XzghORO0cJee9 FMJIuJrclpggKINshV+qLTfYNKYOedP/miEgzm9G+ocvnxii9cUgqUBs130ifRuN gCVoVq3BxWRXZWpK6dNOBRgyXAAXdgMyCsRhvbbCiXXRiOOZD1I6pxHXvGxYr8d+ fhsjsSZXDHWVlBpoP1qBA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudekgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeevvdelieejgedvkeffheekheeilefhgefgffehteekueelvddtueffheet ledtffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Dec 2022 11:09:09 -0500 (EST) From: Maxime Ripard Date: Wed, 07 Dec 2022 17:07:46 +0100 Subject: [PATCH 2/9] drm/vc4: hdmi: Constify container_of wrappers MIME-Version: 1.0 Message-Id: <20221207-rpi-hdmi-improvements-v1-2-6b15f774c13a@cerno.tech> References: <20221207-rpi-hdmi-improvements-v1-0-6b15f774c13a@cerno.tech> In-Reply-To: <20221207-rpi-hdmi-improvements-v1-0-6b15f774c13a@cerno.tech> To: Emma Anholt , Maxime Ripard , David Airlie , Daniel Vetter X-Mailer: b4 0.11.0-dev-8c583 X-Developer-Signature: v=1; a=openpgp-sha256; l=1406; i=maxime@cerno.tech; h=from:subject:message-id; bh=dCH6llKR5UwxqNbbxar32+yc+y4RRk/F+4gf1CbtXyE=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMkTdgV1SruruN33CH23+ET6vpLqMvtVofxOG6dtXczKW7FN Uq+to5SFQYyLQVZMkSVG2HxJ3KlZrzvZ+ObBzGFlAhnCwMUpABMRVWVkeCSoY/rAvPPKJk29p7d+3h VrrQ38mDPROPXpxY9ma43PTGD47zP35PuuwqorzNf7lJSuTX4YvHnBq8u/rnI3RcTFq1+dzgEA X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Dave Stevenson Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" None of our wrappers around container_of to access our objects from the DRM object pointer actually modify the latter. Let's make them const. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index dc3ccd8002a0..023ea64ef006 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -224,13 +224,13 @@ struct vc4_hdmi { }; static inline struct vc4_hdmi * -connector_to_vc4_hdmi(struct drm_connector *connector) +connector_to_vc4_hdmi(const struct drm_connector *connector) { return container_of(connector, struct vc4_hdmi, connector); } static inline struct vc4_hdmi * -encoder_to_vc4_hdmi(struct drm_encoder *encoder) +encoder_to_vc4_hdmi(const struct drm_encoder *encoder) { struct vc4_encoder *_encoder = to_vc4_encoder(encoder); return container_of(_encoder, struct vc4_hdmi, encoder); @@ -244,7 +244,7 @@ struct vc4_hdmi_connector_state { }; static inline struct vc4_hdmi_connector_state * -conn_state_to_vc4_hdmi_conn_state(struct drm_connector_state *conn_state) +conn_state_to_vc4_hdmi_conn_state(const struct drm_connector_state *conn_state) { return container_of(conn_state, struct vc4_hdmi_connector_state, base); }