Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7148958rwp; Tue, 18 Jul 2023 10:44:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlHioRB+QKHU1kHcMeDmGDIty/R/MtKVuUVBOHturXbAz6Dmh5Sxy8Cp4MpShMiEEQkAzymq X-Received: by 2002:a17:906:6a07:b0:988:e365:6231 with SMTP id qw7-20020a1709066a0700b00988e3656231mr640067ejc.41.1689702246526; Tue, 18 Jul 2023 10:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689702246; cv=none; d=google.com; s=arc-20160816; b=gEsqCPuoU/PV/WFtyvdK9B5iXTJqxk1IZJue4zku7VFAHRZXn6+h64luFBBwSB7vhA iDFwvQ9xeeim0WiN26xASGJj+xFQ5RlLMdKnLVUFxMOc821W6yD+bBYxqkXJTUUEdWDT MqPW0IxYeOhtgACv24sZ0WOL6jrwzwI3yBQgj3VxSxphSLztSvWUwY1hUTnIiY/Q1t20 Hd6BYCYpRYAj+vrY5CybhcvEs3k/Avsog3xeoSrGiCs9ej/WBHL1HKt+DZ/GoHB4IwAY jEdizsqOq6BBEVMVunMSqso07XF19Zxdc1UlWXx4iifY16Am4f+xiXNuF7tMciK5Zeyv G+lQ== 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=eEw6vfik03tCosoxRj7PdsKfnxN8ZC5HnG7wf8+aT2k=; fh=Ople2ijcDVdvBJwvAg2RvyZp0qNZK7It46SN0LxlrVk=; b=SGQZ/S/OxaV8KF7hyAVi5r0n3xC8eMd6kY1knbCFuJmMJz/C4pnFdc31/Xi5uXM0D1 W0syNFLW4jwXrCb5gqR3kz43JjyXOv6mVK9w3Vd1ZH1HIzZpRLzfBz2uD7tuLH4t4DRu SVkp523Bz8fBqzslA1GS5ygE/fsnOLEvPxko2g8Him2sFbEYoJBnIm89nLjZSI2jIGDS EHbatnCeRj0fC9/Av+C/KQ+Rlu1EELsOyju4m7u8TnUnSPOblGZX5YpsUZM3sehzk9eN t0iaZ54WfIyUQMSKIytprKViQTMd7l1sEAEhEOdsBI8C/RHnmfHrxbtQbV/xPveVFQQC s2IA== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020a170906848d00b00992d0de8760si1380326ejx.911.2023.07.18.10.43.42; Tue, 18 Jul 2023 10:44:06 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233644AbjGRQ4F (ORCPT + 99 others); Tue, 18 Jul 2023 12:56:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232759AbjGRQzB (ORCPT ); Tue, 18 Jul 2023 12:55:01 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37C5419AD for ; Tue, 18 Jul 2023 09:54:54 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5803:2d6d:5bbc:e252]) by michel.telenet-ops.be with bizsmtp id Ngur2A00G0ucMBo06gurXK; Tue, 18 Jul 2023 18:54:53 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qLnyD-001nYm-Dy; Tue, 18 Jul 2023 18:54:51 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qLnyN-000gcm-F7; Tue, 18 Jul 2023 18:54:51 +0200 From: Geert Uytterhoeven To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Laurent Pinchart Subject: [PATCH v2 21/41] drm: renesas: shmobile: Convert container helpers to static inline functions Date: Tue, 18 Jul 2023 18:54:26 +0200 Message-Id: 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=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 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 --- 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