From mboxrd@z Thu Jan 1 00:00:00 1970 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 56C7EC77B73 for ; Tue, 6 Jun 2023 13:08:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A96610E23F; Tue, 6 Jun 2023 13:08:18 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F16D10E23F for ; Tue, 6 Jun 2023 13:08:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686056896; x=1717592896; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=EGypTDkiiflKHYna6oC/dC9BQiC2e9SaCPgHT4ONrUQ=; b=Cm/NiDEQY76eIdtlKCe0o1T7HnfAj7dinXB9qJn21wkhMwiKMIxT23VO 3x3EpsQJ1q+NHScFC+6c4ghJNKCg41eZ6VqAm5kzq/T1+uD0PmLoYilUw 8tZlVT97E2rxs7wE5Iu5D0cxgZWeX7rjGiHkeh1PYJ2132E3x2t1Wa/a4 XL9WKOWrJ0CdH6BSv6oIkwgigyKz0DwxXAI2c4zlImOyFPgFpjXuw+LB2 yXzQcJIABJdr0LS9EZ8KkIPMvv/C8M988gqSE8JZHSmJYhvyfp1yGl13o hNdv9usDf2+rCOTmGPEXefM1Uxno6tq3BlJmyritU53ZdkQnAvaTySS2I g==; X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="443041116" X-IronPort-AV: E=Sophos;i="6.00,221,1681196400"; d="scan'208";a="443041116" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2023 06:07:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="821626227" X-IronPort-AV: E=Sophos;i="6.00,221,1681196400"; d="scan'208";a="821626227" Received: from abobyr-mobl1.ccr.corp.intel.com (HELO localhost) ([10.252.59.4]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2023 06:07:53 -0700 From: Jani Nikula To: Laurent Pinchart , Siddh Raman Pant Subject: Re: [PATCH v9 1/8] Revert "drm: mipi-dsi: Convert logging to drm_* functions." In-Reply-To: <20230606125537.GC25774@pendragon.ideasonboard.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20230606125537.GC25774@pendragon.ideasonboard.com> Date: Tue, 06 Jun 2023 16:07:47 +0300 Message-ID: <87pm68u4bg.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain 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: Neil Armstrong , Robert Foss , Andrzej Hajda , Jonas Karlman , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard , Jernej Skrabec , Suraj Upadhyay Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 06 Jun 2023, Laurent Pinchart wrote: > Hi Siddh, > > Thank you for the patch. > > On Tue, Jun 06, 2023 at 04:15:15PM +0530, Siddh Raman Pant wrote: >> This reverts commit 1040e424353f5f4d39f6f3aa8723eb3bd6ea6446. >> >> It used an incorrect way to use drm_* functions. Only drm_device ptrs >> should be passed, but the mentioned commit passed mipi_dsi_host ptr. >> It worked by accident due to macro magic. >> >> Reported-by: Jani Nikula >> Reviewed-by: Jani Nikula >> Signed-off-by: Siddh Raman Pant > > Reviewed-by: Laurent Pinchart > > Any chance we could prevent this from happening by turning the macros > into inline functions ? Patch 2 adds static inline struct device *__drm_dev_ptr(const struct drm_device *drm) which should tackle this. BR, Jani. > >> --- >> drivers/gpu/drm/drm_mipi_dsi.c | 15 ++++++++------- >> 1 file changed, 8 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c >> index 3fd6c733ff4e..a37af4edf394 100644 >> --- a/drivers/gpu/drm/drm_mipi_dsi.c >> +++ b/drivers/gpu/drm/drm_mipi_dsi.c >> @@ -33,7 +33,6 @@ >> >> #include >> #include >> -#include >> >> #include