From patchwork Tue Jul 22 07:12:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 4599921 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A992EC0514 for ; Tue, 22 Jul 2014 07:12:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0831200E6 for ; Tue, 22 Jul 2014 07:12:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1B87A200E5 for ; Tue, 22 Jul 2014 07:12:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6934F6E4A9; Tue, 22 Jul 2014 00:12:34 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 40A1C6E4A9 for ; Tue, 22 Jul 2014 00:12:30 -0700 (PDT) Received: by mail-wi0-f174.google.com with SMTP id d1so5383645wiv.1 for ; Tue, 22 Jul 2014 00:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iNVuNITU4r9rt7IOi97Ua2b6kUfigBmGvY9Ogo8K01A=; b=jDLMYm1aBYusBlvN6rSMvV8b4yzbQ0xga9umTdgxSRqiV17DxODxX2OKnRuW/WGJDi Dhmukj5l52z1LMpKw4EC/Cnvi8eRtjcWa57hllILKuicUxvkqC/GDgkabRbaWpwbm7AP ursSlcLc7xbZVhOHfyTnN7MtwRLTJGyRTVJpyJRTHYfn7gbD6SBXBNhvaSnO8Vexj7h+ 2+FZzN4FqOw4f+1k0HUaOp9KuiGZDbSgCUJlYhDte8Eh6p2ND4033+1MkrmCPuL2WEvQ eogEemWh5T3lL0ysE15hNXLEU/CqD8cgIq3OPaKP9dqJt48gn95IOV7Cdgjx5E8s778o vnZg== X-Received: by 10.180.211.101 with SMTP id nb5mr11802261wic.53.1406013149269; Tue, 22 Jul 2014 00:12:29 -0700 (PDT) Received: from localhost (port-49503.pppoe.wtnet.de. [46.59.193.249]) by mx.google.com with ESMTPSA id ey16sm50656288wid.14.2014.07.22.00.12.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jul 2014 00:12:28 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH 4/4] drm/panel: s6e8aa0: Use static inline for upcasting Date: Tue, 22 Jul 2014 09:12:21 +0200 Message-Id: <1406013141-18552-4-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1406013141-18552-1-git-send-email-thierry.reding@gmail.com> References: <1406013141-18552-1-git-send-email-thierry.reding@gmail.com> Cc: Andrzej Hajda , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding Use a static inline function for upcasting a struct drm_panel to the driver-specific structure. The advantage over using a macro is that it gives us additional type checking. Signed-off-by: Thierry Reding Acked-by: Andrzej Hajda --- drivers/gpu/drm/panel/panel-s6e8aa0.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-s6e8aa0.c b/drivers/gpu/drm/panel/panel-s6e8aa0.c index d39bee36816c..6034d300d218 100644 --- a/drivers/gpu/drm/panel/panel-s6e8aa0.c +++ b/drivers/gpu/drm/panel/panel-s6e8aa0.c @@ -120,7 +120,10 @@ struct s6e8aa0 { int error; }; -#define panel_to_s6e8aa0(p) container_of(p, struct s6e8aa0, panel) +static inline struct s6e8aa0 *panel_to_s6e8aa0(struct drm_panel *panel) +{ + return container_of(panel, struct s6e8aa0, panel); +} static int s6e8aa0_clear_error(struct s6e8aa0 *ctx) {