Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp362541rdb; Sat, 19 Aug 2023 05:04:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfmjhUystAlO7vwHxVgPN7NUL/TgGVazGm+W8m9RFnLNywWmb1vJ9ZVN9BpyW18v8MMR/9 X-Received: by 2002:a05:6808:2f18:b0:39e:ced8:8122 with SMTP id gu24-20020a0568082f1800b0039eced88122mr2417873oib.2.1692446641950; Sat, 19 Aug 2023 05:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692446641; cv=none; d=google.com; s=arc-20160816; b=p0dPtLuxo0EPHICRNTmWav0IqHzkxl+NbMQXN0gEbHRaY1IgeaiCqGu21KnHjEf+G0 0qD/lVJzh1NEKNMk6LSnQpy7uyVf6t7CdMav4eyyhpKcCjUEftjW9u4/9IqTaRf5rcO7 xV9RTYKWbPmRG1OIE8WHdc5ryEdxycfZ5SZh9Md1p3c5b789UF4Ydjev8j3Yilj4m2hO S/sMIWPBB3Jru7ZVYicrO/Guk28rBwyLJuKqluiCZDcIupN6p8IDxf83DEL9EcPeI28A qA7/TERQLx9wGTzMiPpa8bTmov2O1bFsz40PFDIXvIpQxxLRUxJNvRyCdWNJQ8JpzBNg RcbA== 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; bh=k4DcBnRhObsnGxgNHH6P7N1sN20nLN3uJOQUQ16iVKA=; fh=OmmZDJEp3pl7jaFV8O2/yN66VkuJIFqajAiD2ZUHFno=; b=pVHXKou6ZEhUU6JLVqZ9P4DXlnMV1Tan3W6e/BtIsuMUZSSHe3uQc3Ed4BAjB2eQ9s /iZG4faLuaQ7jo2wWL/sJTM/+hqaA/lw9yXsXRphuQqJkowahvZC9agGX6METGNQRnUr dsXPejNoIzlSp7xfAdDSXiURKzqq+TXu9YJ7iPx3zQBrk7W8VywAezP8B+VObdBtjIWU ZCTmJuYpPdUKNqq0MQYTe/rw13w6CJiaq2mTdIy83i7QQF4fpJ0CzsYEabS0VcpaLk8M kFzLF7egg+VkGEJgNh8e013dQybPElM0gRjT4UltPjJblRUrgRV3qlSER/K+px/ijKI1 UonA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n7-20020a6543c7000000b0054fdfd26dffsi3309710pgp.337.2023.08.19.05.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 05:04:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 864E5D94F; Sat, 19 Aug 2023 01:36:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244105AbjHPKpr (ORCPT + 99 others); Wed, 16 Aug 2023 06:45:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244010AbjHPKpK (ORCPT ); Wed, 16 Aug 2023 06:45:10 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A04942121 for ; Wed, 16 Aug 2023 03:44:49 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5d0c:f209:12a7:4ce5]) by andre.telenet-ops.be with bizsmtp id aAkh2A00745ualL01AkhCf; Wed, 16 Aug 2023 12:44:42 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qWE0w-000os9-Kg; Wed, 16 Aug 2023 12:44:41 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWDAw-00675m-PZ; Wed, 16 Aug 2023 11:50:50 +0200 From: Geert Uytterhoeven To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Laurent Pinchart Subject: [PATCH v3 21/41] drm: renesas: shmobile: Convert container helpers to static inline functions Date: Wed, 16 Aug 2023 11:50:28 +0200 Message-Id: <0d74fdda78f548f68c57739844a8fb0412368e15.1692178020.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE autolearn=no 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 Replace to conversion helper macros using container_of() by static inline functions, to improve type-safety. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart --- v3: - No changes, v2: - Add Reviewed-by. --- drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 11 ++++++++--- drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c | 5 ++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c index 9c66e00ed70ea582..207fa98fe76d6f88 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c @@ -258,7 +258,10 @@ static void shmob_drm_crtc_update_base(struct shmob_drm_crtc *scrtc) lcdc_write(sdev, LDRCNTR, lcdc_read(sdev, LDRCNTR) ^ LDRCNTR_MRS); } -#define to_shmob_crtc(c) container_of(c, struct shmob_drm_crtc, crtc) +static inline struct shmob_drm_crtc *to_shmob_crtc(struct drm_crtc *crtc) +{ + return container_of(crtc, struct shmob_drm_crtc, crtc); +} static void shmob_drm_crtc_dpms(struct drm_crtc *crtc, int mode) { @@ -538,8 +541,10 @@ int shmob_drm_encoder_create(struct shmob_drm_device *sdev) * Connector */ -#define to_shmob_connector(c) \ - container_of(c, struct shmob_drm_connector, connector) +static inline struct shmob_drm_connector *to_shmob_connector(struct drm_connector *connector) +{ + return container_of(connector, struct shmob_drm_connector, connector); +} static int shmob_drm_connector_get_modes(struct drm_connector *connector) { diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c index 17e66a018689f648..258288c80756bf16 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c @@ -34,7 +34,10 @@ struct shmob_drm_plane { unsigned int crtc_h; }; -#define to_shmob_plane(p) container_of(p, struct shmob_drm_plane, plane) +static inline struct shmob_drm_plane *to_shmob_plane(struct drm_plane *plane) +{ + return container_of(plane, struct shmob_drm_plane, plane); +} static void shmob_drm_plane_compute_base(struct shmob_drm_plane *splane, struct drm_framebuffer *fb, -- 2.34.1