[v4,01/10] drm/print: Fix and add support for NULL as first argument in drm_* macros
Message ID | 7acc7401b5ad0aec973948822bfa906a9615c43e.1672957022.git.code@siddh.me |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp522599wrt; Thu, 5 Jan 2023 14:28:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXsSvrzPe/clBkQ3t0UoJP9pXvvmaVPnrCq3HI1xPkmnFq2pgStqNxGJDZMwyzfecnY8yuBt X-Received: by 2002:aa7:cad0:0:b0:492:8207:f2ba with SMTP id l16-20020aa7cad0000000b004928207f2bamr3212301edt.1.1672957688186; Thu, 05 Jan 2023 14:28:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672957688; cv=pass; d=google.com; s=arc-20160816; b=JEWZTZhmkIgGrhL/yWygk3mLfvSYiuzDfjrGLn4qo7lEYiY+etupbGfXQmJ73M/ZqM dSeFkH79QeKsu1lex3rBDe2lUOQP6r0QKpntlathp453j8CiBalfkBwAZJXgDeb60mOq FsWdh32nzHFQfhve9OWa9KWea06+8rtvrq1pxN22kg13D83e0xu1txMdjDLW3jpy/Doc YAqae9+vDb1vW9Jv+EOdrCrIKlSTiwxs8JLenPWpi6Up42BKG+h2tBSQsLh5EIkekmb2 SOHivIGTdsejzm49ptuL9njeo3kMOYVs9L//sNP7mmbK8DytlsYervhdlGqLMAzDuqUX EjiA== ARC-Message-Signature: i=2; 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:date:subject:message-id:cc:to:from :dkim-signature; bh=qCG+JBivhEMBMDeHK/f0Oa3MjhNbHZUN5tM+bEf7CHQ=; b=cxGgnv85zp7wfWKuZtmp5giCTa6fZp1IDYDzSmsXiqJTNuvXL6KtpvcKqcqYJ7OBIs DZVc3lDapHp+R6c4cNnHh7pJil/WQPF9ROjYyYSG5uj4DT5K5oXPOKo8PY0zgFBH7D1M +IwJS0Tv2K7GWHxfZKj97ad+oKYzWEPSvcR2kYg/s9eYlZufxmmOYhBXv8KUguZwIMTl bxVgbP5wnOYPJFgVYrg7m11FMPn1lR+UIdjugpJxzZUYwNh+/X2x+2KjSufnUy4YMk5l KbxzeoounpF8QH/t1wk9lodsv+tpuV4orCdftlHxCB75W0uRILppb/0LsdLMpnxdtxfd R+3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=sM5UJWYm; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eq27-20020a056402299b00b004852b8fdf6dsi26952538edb.422.2023.01.05.14.27.44; Thu, 05 Jan 2023 14:28:08 -0800 (PST) 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; dkim=pass header.i=@siddh.me header.s=zmail header.b=sM5UJWYm; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235875AbjAEW0G (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Thu, 5 Jan 2023 17:26:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234829AbjAEW0C (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 5 Jan 2023 17:26:02 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B00FC1FF for <linux-kernel@vger.kernel.org>; Thu, 5 Jan 2023 14:25:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672957509; cv=none; d=zohomail.in; s=zohoarc; b=MaBImDH17xrJ2KRqDSv1eX/Zf8Ga/nh6lsUAhbPpymbOVQQ7GvvIgCLxgmTRa2TbzKoNQ5+b7OUywSOmh0Pt2Gl5mvf61HnKIIItsWntdqTz8+wECNpfE7mpc5uKxtbiNxBSnQPFGE9JWbzSUox/foI8mDBLjmeP6Ygw10mTNlw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1672957509; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=qCG+JBivhEMBMDeHK/f0Oa3MjhNbHZUN5tM+bEf7CHQ=; b=AEmBXJZdOp2XQSEOAARiesO4Y7/3t0OS3i1EwhH8z1ixtXauvDXFMxhoSJXG89CMjFyxyFeQprU/pJrZBTIJCFdDEE7MojjWC2Tc90MDRHJDJENFQeuWZ6lJPalvK5WvDIHHTK3EwkR2t144CN/mTvpFsbPbc+LBxYIN+XE/HKE= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from=<code@siddh.me> DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1672957509; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=qCG+JBivhEMBMDeHK/f0Oa3MjhNbHZUN5tM+bEf7CHQ=; b=sM5UJWYmRQksI7ipYDljIaioSs47YGJw8e9DarhhA87Rw3sAjqhPuqUa9qEGY1w+ 0oIUOhiAF0kxpF/v0IIQFEJnsN4jqnx31bhFU/O/YjIjc7mI3jNph5QKwUukLrO6PU4 pcdWNTHxze0cpQ5H4DlPKOcDmxBVd4gQBTkXKaaM= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 167295750659647.78016132367998; Fri, 6 Jan 2023 03:55:06 +0530 (IST) From: Siddh Raman Pant <code@siddh.me> To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Simon Ser <contact@emersion.fr>, Jim Cromie <jim.cromie@gmail.com> Cc: dri-devel <dri-devel@lists.freedesktop.org>, linux-kernel <linux-kernel@vger.kernel.org> Message-ID: <7acc7401b5ad0aec973948822bfa906a9615c43e.1672957022.git.code@siddh.me> Subject: [PATCH v4 01/10] drm/print: Fix and add support for NULL as first argument in drm_* macros Date: Fri, 6 Jan 2023 03:54:52 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: <cover.1672957022.git.code@siddh.me> References: <cover.1672957022.git.code@siddh.me> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset=utf8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754223280638199148?= X-GMAIL-MSGID: =?utf-8?q?1754223280638199148?= |
Series |
drm: Remove usage of deprecated DRM_* macros
|
|
Commit Message
Siddh Raman Pant
Jan. 5, 2023, 10:24 p.m. UTC
Comments say macros DRM_DEBUG_* are deprecated in favor of
drm_dbg_*(NULL, ...), but they have broken support for it,
as the macro will result in `(NULL) ? (NULL)->dev : NULL`.
Thus, fix them by separating logic to get dev ptr in a new
function, which will return the dev ptr if arg is not NULL.
Use it in drm_dbg_*, and also in __DRM_DEFINE_DBG_RATELIMITED,
where a similar (but correct) NULL check was in place.
Also, add support for NULL in __drm_printk, so that all the
drm_* macros will hence support NULL as the first argument.
This also means that deprecation comments mentioning pr_()*
can now be changed to the drm equivalents.
There is a need to support device pointers, as in some cases,
we may not have drm_device but just the device ptr, such as
when dealing with struct mipi_dsi_host. Before this change,
passing just mipi_dsi_host would have worked, since due to
preprocessing, the resultant would be "host->dev", but now
due to NULL check that cannot happen.
Signed-off-by: Siddh Raman Pant <code@siddh.me>
---
include/drm/drm_print.h | 101 +++++++++++++++++++++++++++++-----------
1 file changed, 73 insertions(+), 28 deletions(-)
Comments
Hi Siddh, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm-misc/drm-misc-next] [also build test WARNING on linus/master v6.2-rc2 next-20230105] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Siddh-Raman-Pant/drm-print-Fix-and-add-support-for-NULL-as-first-argument-in-drm_-macros/20230106-062743 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/7acc7401b5ad0aec973948822bfa906a9615c43e.1672957022.git.code%40siddh.me patch subject: [PATCH v4 01/10] drm/print: Fix and add support for NULL as first argument in drm_* macros config: m68k-allmodconfig compiler: m68k-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/8b796b03036f712417f8a87f85cdf9ac66d736ac git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Siddh-Raman-Pant/drm-print-Fix-and-add-support-for-NULL-as-first-argument-in-drm_-macros/20230106-062743 git checkout 8b796b03036f712417f8a87f85cdf9ac66d736ac # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/gpu/drm/display/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): | ^~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:849:17: note: in expansion of macro 'drm_err' 849 | drm_err(aux->drm_dev, "%s: DPCD failed write at register 0x%x\n", | ^~~~~~~ include/drm/drm_print.h:480:9: warning: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 480 | _Generic((drm), \ | ^~~~~~~~ include/drm/drm_print.h:495:33: note: in expansion of macro '__drm_get_dev_ptr' 495 | struct device *__dev_ = __drm_get_dev_ptr(drm); \ | ^~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:9: note: in expansion of macro '__drm_printk' 513 | __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:857:17: note: in expansion of macro 'drm_err' 857 | drm_err(aux->drm_dev, "%s: DPCD failed write at register 0x%x\n", | ^~~~~~~ include/drm/drm_print.h:480:9: warning: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 480 | _Generic((drm), \ | ^~~~~~~~ include/drm/drm_print.h:495:33: note: in expansion of macro '__drm_get_dev_ptr' 495 | struct device *__dev_ = __drm_get_dev_ptr(drm); \ | ^~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:9: note: in expansion of macro '__drm_printk' 513 | __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:864:17: note: in expansion of macro 'drm_err' 864 | drm_err(aux->drm_dev, "%s: DPCD failed write at register 0x%x\n", | ^~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c: In function 'drm_dp_read_extended_dpcd_caps': include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:538:21: note: in expansion of macro '__drm_get_dev_ptr' 538 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:908:17: note: in expansion of macro 'drm_dbg_kms' 908 | drm_dbg_kms(aux->drm_dev, | ^~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:538:21: note: in expansion of macro '__drm_get_dev_ptr' 538 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:917:9: note: in expansion of macro 'drm_dbg_kms' 917 | drm_dbg_kms(aux->drm_dev, "%s: Base DPCD: %*ph\n", aux->name, DP_RECEIVER_CAP_SIZE, dpcd); | ^~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/display/drm_dp_helper.c: In function 'drm_dp_read_dpcd_caps': include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:538:21: note: in expansion of macro '__drm_get_dev_ptr' 538 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:952:9: note: in expansion of macro 'drm_dbg_kms' 952 | drm_dbg_kms(aux->drm_dev, "%s: DPCD: %*ph\n", aux->name, DP_RECEIVER_CAP_SIZE, dpcd); | ^~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/display/drm_dp_helper.c: In function 'drm_dp_read_downstream_info': include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:538:21: note: in expansion of macro '__drm_get_dev_ptr' 538 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:1001:9: note: in expansion of macro 'drm_dbg_kms' 1001 | drm_dbg_kms(aux->drm_dev, "%s: DPCD DFP: %*ph\n", aux->name, len, downstream_ports); | ^~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/display/drm_dp_helper.c: In function 'drm_dp_i2c_do_msg': >> include/drm/drm_print.h:482:25: warning: passing argument 1 of 'drm_dev_printk' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:646:32: note: in expansion of macro '__drm_get_dev_ptr' 646 | drm_dev_printk(__drm_get_dev_ptr(drm), KERN_DEBUG, \ | ^~~~~~~~~~~~~~~~~ include/drm/drm_print.h:651:9: note: in expansion of macro '__DRM_DEFINE_DBG_RATELIMITED' 651 | __DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:1718:33: note: in expansion of macro 'drm_dbg_kms_ratelimited' 1718 | drm_dbg_kms_ratelimited(aux->drm_dev, "%s: transaction timed out\n", | ^~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:356:42: note: expected 'const struct device *' but argument is of type 'int' 356 | void drm_dev_printk(const struct device *dev, const char *level, | ~~~~~~~~~~~~~~~~~~~~~^~~ include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:538:21: note: in expansion of macro '__drm_get_dev_ptr' 538 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:1721:33: note: in expansion of macro 'drm_dbg_kms' 1721 | drm_dbg_kms(aux->drm_dev, "%s: transaction failed: %d\n", | ^~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:538:21: note: in expansion of macro '__drm_get_dev_ptr' 538 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:1736:25: note: in expansion of macro 'drm_dbg_kms' 1736 | drm_dbg_kms(aux->drm_dev, "%s: native nack (result=%d, size=%zu)\n", | ^~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:538:21: note: in expansion of macro '__drm_get_dev_ptr' 538 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:1741:25: note: in expansion of macro 'drm_dbg_kms' 1741 | drm_dbg_kms(aux->drm_dev, "%s: native defer\n", aux->name); | ^~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ include/drm/drm_print.h:480:9: warning: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 480 | _Generic((drm), \ | ^~~~~~~~ include/drm/drm_print.h:495:33: note: in expansion of macro '__drm_get_dev_ptr' 495 | struct device *__dev_ = __drm_get_dev_ptr(drm); \ | ^~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:9: note: in expansion of macro '__drm_printk' 513 | __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:1755:25: note: in expansion of macro 'drm_err' 1755 | drm_err(aux->drm_dev, "%s: invalid native reply %#04x\n", | ^~~~~~~ include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:538:21: note: in expansion of macro '__drm_get_dev_ptr' 538 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/display/drm_dp_helper.c:1771:25: note: in expansion of macro 'drm_dbg_kms' 1771 | drm_dbg_kms(aux->drm_dev, "%s: I2C nack (result=%d, size=%zu)\n", | ^~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | vim +/drm_dev_printk +482 include/drm/drm_print.h 473 474 /** 475 * __drm_get_dev_ptr - Helper to get device pointer even if NULL is passed. 476 * Primarily for use in drm_*() print macros, since they 477 * need to handle NULL as the first argument passed. 478 */ 479 #define __drm_get_dev_ptr(drm) \ 480 _Generic((drm), \ 481 struct drm_device * : \ > 482 __drm_get_dev_ptr((drm), true), \ 483 struct device * : \ 484 __drm_get_dev_ptr((drm), false), \ 485 default : \ 486 NULL \ 487 ) 488
Hi Siddh, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm-misc/drm-misc-next] [also build test WARNING on linus/master v6.2-rc2 next-20230105] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Siddh-Raman-Pant/drm-print-Fix-and-add-support-for-NULL-as-first-argument-in-drm_-macros/20230106-062743 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/7acc7401b5ad0aec973948822bfa906a9615c43e.1672957022.git.code%40siddh.me patch subject: [PATCH v4 01/10] drm/print: Fix and add support for NULL as first argument in drm_* macros config: ia64-allyesconfig compiler: ia64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/8b796b03036f712417f8a87f85cdf9ac66d736ac git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Siddh-Raman-Pant/drm-print-Fix-and-add-support-for-NULL-as-first-argument-in-drm_-macros/20230106-062743 git checkout 8b796b03036f712417f8a87f85cdf9ac66d736ac # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/gpu/drm/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): In file included from drivers/gpu/drm/drm_atomic.c:43: drivers/gpu/drm/drm_atomic.c: In function 'drm_crtc_commit_wait': include/drm/drm_print.h:482:25: error: implicit declaration of function '__drm_get_dev_ptr'; did you mean '___drm_get_dev_ptr'? [-Werror=implicit-function-declaration] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~ include/drm/drm_print.h:495:33: note: in expansion of macro '__drm_get_dev_ptr' 495 | struct device *__dev_ = __drm_get_dev_ptr(drm); \ | ^~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:9: note: in expansion of macro '__drm_printk' 513 | __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:79:17: note: in expansion of macro 'drm_err' 79 | drm_err(commit->crtc->dev, "hw_done timed out\n"); | ^~~~~~~ >> include/drm/drm_print.h:480:9: warning: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 480 | _Generic((drm), \ | ^~~~~~~~ include/drm/drm_print.h:495:33: note: in expansion of macro '__drm_get_dev_ptr' 495 | struct device *__dev_ = __drm_get_dev_ptr(drm); \ | ^~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:9: note: in expansion of macro '__drm_printk' 513 | __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:79:17: note: in expansion of macro 'drm_err' 79 | drm_err(commit->crtc->dev, "hw_done timed out\n"); | ^~~~~~~ >> include/drm/drm_print.h:480:9: warning: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 480 | _Generic((drm), \ | ^~~~~~~~ include/drm/drm_print.h:495:33: note: in expansion of macro '__drm_get_dev_ptr' 495 | struct device *__dev_ = __drm_get_dev_ptr(drm); \ | ^~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:9: note: in expansion of macro '__drm_printk' 513 | __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:89:17: note: in expansion of macro 'drm_err' 89 | drm_err(commit->crtc->dev, "flip_done timed out\n"); | ^~~~~~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_state_init': >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:145:9: note: in expansion of macro 'drm_dbg_atomic' 145 | drm_dbg_atomic(dev, "Allocated atomic state %p\n", state); | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_state_default_clear': >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:196:9: note: in expansion of macro 'drm_dbg_atomic' 196 | drm_dbg_atomic(dev, "Clearing atomic state %p\n", state); | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function '__drm_atomic_state_free': >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:306:9: note: in expansion of macro 'drm_dbg_atomic' 306 | drm_dbg_atomic(state->dev, "Freeing atomic state %p\n", state); | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_get_crtc_state': >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:363:9: note: in expansion of macro 'drm_dbg_atomic' 363 | drm_dbg_atomic(state->dev, "Added [CRTC:%d:%s] %p state to %p\n", | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_crtc_check': >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:384:17: note: in expansion of macro 'drm_dbg_atomic' 384 | drm_dbg_atomic(crtc->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:396:17: note: in expansion of macro 'drm_dbg_atomic' 396 | drm_dbg_atomic(crtc->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:404:17: note: in expansion of macro 'drm_dbg_atomic' 404 | drm_dbg_atomic(crtc->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:422:17: note: in expansion of macro 'drm_dbg_atomic' 422 | drm_dbg_atomic(crtc->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_connector_check': >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:469:17: note: in expansion of macro 'drm_dbg_atomic' 469 | drm_dbg_atomic(connector->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:480:17: note: in expansion of macro 'drm_dbg_atomic' 480 | drm_dbg_atomic(connector->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:489:25: note: in expansion of macro 'drm_dbg_atomic' 489 | drm_dbg_atomic(connector->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_get_plane_state': >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:549:9: note: in expansion of macro 'drm_dbg_atomic' 549 | drm_dbg_atomic(plane->dev, "Added [PLANE:%d:%s] %p state to %p\n", | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_plane_check': >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:606:17: note: in expansion of macro 'drm_dbg_atomic' 606 | drm_dbg_atomic(plane->dev, "[PLANE:%d:%s] CRTC set but no FB\n", | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:610:17: note: in expansion of macro 'drm_dbg_atomic' 610 | drm_dbg_atomic(plane->dev, "[PLANE:%d:%s] FB set but no CRTC\n", | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:621:17: note: in expansion of macro 'drm_dbg_atomic' 621 | drm_dbg_atomic(plane->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:632:17: note: in expansion of macro 'drm_dbg_atomic' 632 | drm_dbg_atomic(plane->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:644:17: note: in expansion of macro 'drm_dbg_atomic' 644 | drm_dbg_atomic(plane->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ >> include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:660:17: note: in expansion of macro 'drm_dbg_atomic' 660 | drm_dbg_atomic(plane->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:687:25: note: in expansion of macro 'drm_dbg_atomic' 687 | drm_dbg_atomic(plane->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:698:17: note: in expansion of macro 'drm_dbg_atomic' 698 | drm_dbg_atomic(plane->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_get_private_obj_state': include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:866:9: note: in expansion of macro 'drm_dbg_atomic' 866 | drm_dbg_atomic(state->dev, | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_get_connector_state': include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:1048:9: note: in expansion of macro 'drm_dbg_atomic' 1048 | drm_dbg_atomic(connector->dev, "Added [CONNECTOR:%d:%s] %p state to %p\n", | ^~~~~~~~~~~~~~ include/drm/drm_print.h:360:63: note: expected 'const struct device *' but argument is of type 'int' 360 | void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, | ~~~~~~~~~~~~~~~~~~~~~^~~ drivers/gpu/drm/drm_atomic.c: In function 'drm_atomic_add_encoder_bridges': include/drm/drm_print.h:482:25: warning: passing argument 2 of '__drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 482 | __drm_get_dev_ptr((drm), true), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | int include/drm/drm_print.h:411:29: note: in definition of macro 'drm_dev_dbg' 411 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:542:21: note: in expansion of macro '__drm_get_dev_ptr' 542 | drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:1181:9: note: in expansion of macro 'drm_dbg_atomic' 1181 | drm_dbg_atomic(encoder->dev, .. vim +480 include/drm/drm_print.h 473 474 /** 475 * __drm_get_dev_ptr - Helper to get device pointer even if NULL is passed. 476 * Primarily for use in drm_*() print macros, since they 477 * need to handle NULL as the first argument passed. 478 */ 479 #define __drm_get_dev_ptr(drm) \ > 480 _Generic((drm), \ 481 struct drm_device * : \ > 482 __drm_get_dev_ptr((drm), true), \ 483 struct device * : \ 484 __drm_get_dev_ptr((drm), false), \ 485 default : \ 486 NULL \ 487 ) 488 489 /** 490 * Helper for struct drm_device based logging (prefer this over struct device). 491 * Also supports struct device ptr as an argument for edge cases. 492 */ 493 #define __drm_printk(drm, level, type, fmt, ...) \ 494 ({ \ > 495 struct device *__dev_ = __drm_get_dev_ptr(drm); \ 496 if (__dev_) \ 497 dev_##level##type(__dev_, "[drm] " fmt, ##__VA_ARGS__); \ 498 else \ 499 pr_##level##type("[drm] " fmt, ##__VA_ARGS__); \ 500 }) 501 502 503 #define drm_info(drm, fmt, ...) \ 504 __drm_printk((drm), info,, fmt, ##__VA_ARGS__) 505 506 #define drm_notice(drm, fmt, ...) \ 507 __drm_printk((drm), notice,, fmt, ##__VA_ARGS__) 508 509 #define drm_warn(drm, fmt, ...) \ 510 __drm_printk((drm), warn,, fmt, ##__VA_ARGS__) 511 512 #define drm_err(drm, fmt, ...) \ 513 __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) 514 515 516 #define drm_info_once(drm, fmt, ...) \ 517 __drm_printk((drm), info, _once, fmt, ##__VA_ARGS__) 518 519 #define drm_notice_once(drm, fmt, ...) \ 520 __drm_printk((drm), notice, _once, fmt, ##__VA_ARGS__) 521 522 #define drm_warn_once(drm, fmt, ...) \ 523 __drm_printk((drm), warn, _once, fmt, ##__VA_ARGS__) 524 525 #define drm_err_once(drm, fmt, ...) \ 526 __drm_printk((drm), err, _once, "*ERROR* " fmt, ##__VA_ARGS__) 527 528 529 #define drm_err_ratelimited(drm, fmt, ...) \ 530 __drm_printk((drm), err, _ratelimited, "*ERROR* " fmt, ##__VA_ARGS__) 531 532 533 #define drm_dbg_core(drm, fmt, ...) \ 534 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_CORE, fmt, ##__VA_ARGS__) 535 #define drm_dbg_driver(drm, fmt, ...) \ > 536 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_DRIVER, fmt, ##__VA_ARGS__) 537 #define drm_dbg_kms(drm, fmt, ...) \ 538 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) 539 #define drm_dbg_prime(drm, fmt, ...) \ 540 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_PRIME, fmt, ##__VA_ARGS__) 541 #define drm_dbg_atomic(drm, fmt, ...) \ 542 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) 543 #define drm_dbg_vbl(drm, fmt, ...) \ 544 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_VBL, fmt, ##__VA_ARGS__) 545 #define drm_dbg_state(drm, fmt, ...) \ 546 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_STATE, fmt, ##__VA_ARGS__) 547 #define drm_dbg_lease(drm, fmt, ...) \ 548 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_LEASE, fmt, ##__VA_ARGS__) 549 #define drm_dbg_dp(drm, fmt, ...) \ 550 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_DP, fmt, ##__VA_ARGS__) 551 #define drm_dbg_drmres(drm, fmt, ...) \ 552 drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_DRMRES, fmt, ##__VA_ARGS__) 553
Hi Siddh, Thank you for the patch! Yet something to improve: [auto build test ERROR on drm-misc/drm-misc-next] [also build test ERROR on linus/master v6.2-rc2 next-20230105] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Siddh-Raman-Pant/drm-print-Fix-and-add-support-for-NULL-as-first-argument-in-drm_-macros/20230106-062743 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/7acc7401b5ad0aec973948822bfa906a9615c43e.1672957022.git.code%40siddh.me patch subject: [PATCH v4 01/10] drm/print: Fix and add support for NULL as first argument in drm_* macros config: i386-randconfig-a002 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/8b796b03036f712417f8a87f85cdf9ac66d736ac git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Siddh-Raman-Pant/drm-print-Fix-and-add-support-for-NULL-as-first-argument-in-drm_-macros/20230106-062743 git checkout 8b796b03036f712417f8a87f85cdf9ac66d736ac # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All error/warnings (new ones prefixed by >>): >> drivers/gpu/drm/udl/udl_modeset.c:446:4: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_err(dev, "Read EDID byte %zu failed err %x\n", i, ret); ^ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:495:26: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/udl/udl_modeset.c:446:4: note: did you mean '___drm_get_dev_ptr'? include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:495:26: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ include/drm/drm_print.h:463:30: note: '___drm_get_dev_ptr' declared here static inline struct device *___drm_get_dev_ptr(const void *ptr, bool is_drm) ^ >> drivers/gpu/drm/udl/udl_modeset.c:446:4: warning: incompatible integer to pointer conversion initializing 'struct device *' with an expression of type 'int' [-Wint-conversion] drm_err(dev, "Read EDID byte %zu failed err %x\n", i, ret); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:495:17: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ ~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/udl/udl_modeset.c:450:4: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_err(dev, "Read EDID byte %zu failed\n", i); ^ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:495:26: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/udl/udl_modeset.c:450:4: warning: incompatible integer to pointer conversion initializing 'struct device *' with an expression of type 'int' [-Wint-conversion] drm_err(dev, "Read EDID byte %zu failed\n", i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:495:17: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ ~~~~~~~~~~~~~~~~~~~~~~ 2 warnings and 2 errors generated. -- >> drivers/gpu/drm/udl/udl_main.c:303:3: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_err(dev, "Timeout for syncing pending URBs\n"); ^ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:495:26: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/udl/udl_main.c:303:3: note: did you mean '___drm_get_dev_ptr'? include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:495:26: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ include/drm/drm_print.h:463:30: note: '___drm_get_dev_ptr' declared here static inline struct device *___drm_get_dev_ptr(const void *ptr, bool is_drm) ^ >> drivers/gpu/drm/udl/udl_main.c:303:3: warning: incompatible integer to pointer conversion initializing 'struct device *' with an expression of type 'int' [-Wint-conversion] drm_err(dev, "Timeout for syncing pending URBs\n"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:495:17: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ ~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/udl/udl_main.c:316:3: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_warn(dev, "buffer sharing not supported"); /* not an error */ ^ include/drm/drm_print.h:510:2: note: expanded from macro 'drm_warn' __drm_printk((drm), warn,, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:495:26: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/udl/udl_main.c:316:3: warning: incompatible integer to pointer conversion initializing 'struct device *' with an expression of type 'int' [-Wint-conversion] drm_warn(dev, "buffer sharing not supported"); /* not an error */ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:510:2: note: expanded from macro 'drm_warn' __drm_printk((drm), warn,, fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:495:17: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ ~~~~~~~~~~~~~~~~~~~~~~ 2 warnings and 2 errors generated. -- >> drivers/gpu/drm/drm_atomic.c:79:3: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_err(commit->crtc->dev, "hw_done timed out\n"); ^ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:495:26: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic.c:79:3: note: did you mean '___drm_get_dev_ptr'? include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:495:26: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ include/drm/drm_print.h:463:30: note: '___drm_get_dev_ptr' declared here static inline struct device *___drm_get_dev_ptr(const void *ptr, bool is_drm) ^ >> drivers/gpu/drm/drm_atomic.c:79:3: warning: incompatible integer to pointer conversion initializing 'struct device *' with an expression of type 'int' [-Wint-conversion] drm_err(commit->crtc->dev, "hw_done timed out\n"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:495:17: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ ~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:89:3: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_err(commit->crtc->dev, "flip_done timed out\n"); ^ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:495:26: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic.c:89:3: warning: incompatible integer to pointer conversion initializing 'struct device *' with an expression of type 'int' [-Wint-conversion] drm_err(commit->crtc->dev, "flip_done timed out\n"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:513:2: note: expanded from macro 'drm_err' __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:495:17: note: expanded from macro '__drm_printk' struct device *__dev_ = __drm_get_dev_ptr(drm); \ ^ ~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/drm_atomic.c:145:2: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(dev, "Allocated atomic state %p\n", state); ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ >> drivers/gpu/drm/drm_atomic.c:145:2: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(dev, "Allocated atomic state %p\n", state); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:480:2: note: expanded from macro '__drm_get_dev_ptr' _Generic((drm), \ ^ include/drm/drm_print.h:411:22: note: expanded from macro 'drm_dev_dbg' __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) ^~~ include/drm/drm_print.h:360:63: note: passing argument to parameter 'dev' here void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, ^ drivers/gpu/drm/drm_atomic.c:196:2: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(dev, "Clearing atomic state %p\n", state); ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic.c:196:2: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(dev, "Clearing atomic state %p\n", state); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:480:2: note: expanded from macro '__drm_get_dev_ptr' _Generic((drm), \ ^ include/drm/drm_print.h:411:22: note: expanded from macro 'drm_dev_dbg' __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) ^~~ include/drm/drm_print.h:360:63: note: passing argument to parameter 'dev' here void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, ^ drivers/gpu/drm/drm_atomic.c:306:2: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(state->dev, "Freeing atomic state %p\n", state); ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic.c:306:2: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(state->dev, "Freeing atomic state %p\n", state); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:480:2: note: expanded from macro '__drm_get_dev_ptr' _Generic((drm), \ ^ include/drm/drm_print.h:411:22: note: expanded from macro 'drm_dev_dbg' __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) ^~~ include/drm/drm_print.h:360:63: note: passing argument to parameter 'dev' here void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, ^ drivers/gpu/drm/drm_atomic.c:363:2: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(state->dev, "Added [CRTC:%d:%s] %p state to %p\n", ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic.c:363:2: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(state->dev, "Added [CRTC:%d:%s] %p state to %p\n", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:480:2: note: expanded from macro '__drm_get_dev_ptr' _Generic((drm), \ ^ include/drm/drm_print.h:411:22: note: expanded from macro 'drm_dev_dbg' __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) ^~~ include/drm/drm_print.h:360:63: note: passing argument to parameter 'dev' here void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, ^ drivers/gpu/drm/drm_atomic.c:384:3: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(crtc->dev, ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic.c:384:3: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(crtc->dev, ^~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) -- >> drivers/gpu/drm/drm_atomic_uapi.c:92:3: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(crtc->dev, ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic_uapi.c:92:3: note: did you mean '___drm_get_dev_ptr'? include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ include/drm/drm_print.h:463:30: note: '___drm_get_dev_ptr' declared here static inline struct device *___drm_get_dev_ptr(const void *ptr, bool is_drm) ^ >> drivers/gpu/drm/drm_atomic_uapi.c:92:3: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(crtc->dev, ^~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:480:2: note: expanded from macro '__drm_get_dev_ptr' _Generic((drm), \ ^ include/drm/drm_print.h:411:22: note: expanded from macro 'drm_dev_dbg' __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) ^~~ include/drm/drm_print.h:360:63: note: passing argument to parameter 'dev' here void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, ^ drivers/gpu/drm/drm_atomic_uapi.c:98:3: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(crtc->dev, ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic_uapi.c:98:3: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(crtc->dev, ^~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:480:2: note: expanded from macro '__drm_get_dev_ptr' _Generic((drm), \ ^ include/drm/drm_print.h:411:22: note: expanded from macro 'drm_dev_dbg' __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) ^~~ include/drm/drm_print.h:360:63: note: passing argument to parameter 'dev' here void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, ^ drivers/gpu/drm/drm_atomic_uapi.c:137:4: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(crtc->dev, ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic_uapi.c:137:4: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(crtc->dev, ^~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:480:2: note: expanded from macro '__drm_get_dev_ptr' _Generic((drm), \ ^ include/drm/drm_print.h:411:22: note: expanded from macro 'drm_dev_dbg' __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) ^~~ include/drm/drm_print.h:360:63: note: passing argument to parameter 'dev' here void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, ^ drivers/gpu/drm/drm_atomic_uapi.c:147:4: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(crtc->dev, ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic_uapi.c:147:4: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(crtc->dev, ^~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:480:2: note: expanded from macro '__drm_get_dev_ptr' _Generic((drm), \ ^ include/drm/drm_print.h:411:22: note: expanded from macro 'drm_dev_dbg' __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) ^~~ include/drm/drm_print.h:360:63: note: passing argument to parameter 'dev' here void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, ^ drivers/gpu/drm/drm_atomic_uapi.c:157:3: error: implicit declaration of function '__drm_get_dev_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] drm_dbg_atomic(crtc->dev, ^ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) ^ include/drm/drm_print.h:482:4: note: expanded from macro '__drm_get_dev_ptr' __drm_get_dev_ptr((drm), true), \ ^ drivers/gpu/drm/drm_atomic_uapi.c:157:3: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct device *' [-Wint-conversion] drm_dbg_atomic(crtc->dev, ^~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:542:14: note: expanded from macro 'drm_dbg_atomic' drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) .. vim +/__drm_get_dev_ptr +446 drivers/gpu/drm/udl/udl_modeset.c 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 425 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 426 static int udl_get_edid_block(void *data, u8 *buf, unsigned int block, size_t len) 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 427 { 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 428 struct udl_device *udl = data; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 429 struct drm_device *dev = &udl->drm; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 430 struct usb_device *udev = udl_to_usb_device(udl); 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 431 u8 *read_buff; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 432 int ret; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 433 size_t i; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 434 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 435 read_buff = kmalloc(2, GFP_KERNEL); 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 436 if (!read_buff) 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 437 return -ENOMEM; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 438 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 439 for (i = 0; i < len; i++) { 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 440 int bval = (i + block * EDID_LENGTH) << 8; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 441 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 442 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 443 0x02, (0x80 | (0x02 << 5)), bval, 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 444 0xA1, read_buff, 2, USB_CTRL_GET_TIMEOUT); 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 445 if (ret < 0) { 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 @446 drm_err(dev, "Read EDID byte %zu failed err %x\n", i, ret); 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 447 goto err_kfree; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 448 } else if (ret < 1) { 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 449 ret = -EIO; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 450 drm_err(dev, "Read EDID byte %zu failed\n", i); 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 451 goto err_kfree; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 452 } 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 453 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 454 buf[i] = read_buff[1]; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 455 } 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 456 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 457 kfree(read_buff); 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 458 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 459 return 0; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 460 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 461 err_kfree: 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 462 kfree(read_buff); 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 463 return ret; 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 464 } 0862cfd3e22f3f Thomas Zimmermann 2022-10-06 465
On Fri, 06 Jan 2023 06:43:35 +0530, kernel test robot wrote > Hi Siddh, > > Thank you for the patch! Perhaps something to improve: Yes, I sent the rectification as a reply to this patch. [1] Reviewers may please take note. Thanks, Siddh [1] https://lore.kernel.org/all/20230105224018.132302-1-code@siddh.me/
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a44fb7ef257f..df791cd747da 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -34,6 +34,7 @@ #include <linux/dynamic_debug.h> #include <drm/drm.h> +#include <drm/drm_device.h> /* Do *not* use outside of drm_print.[ch]! */ extern unsigned long __drm_debug; @@ -451,9 +452,52 @@ void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, * Prefer drm_device based logging over device or prink based logging. */ -/* Helper for struct drm_device based logging. */ +/** + * ___drm_get_dev_ptr - Helper function to get device pointer. + * @ptr: struct drm_device pointer, struct device pointer, or NULL. + * @is_drm: True implies @ptr is drm_device pointer, else device pointer. + * + * RETURNS: + * The device pointer (NULL if @ptr is NULL). + */ +static inline struct device *___drm_get_dev_ptr(const void *ptr, bool is_drm) +{ + if (!ptr) + return NULL; + + if (is_drm) + return ((struct drm_device *)ptr)->dev; + + return (struct device *)ptr; +} + +/** + * __drm_get_dev_ptr - Helper to get device pointer even if NULL is passed. + * Primarily for use in drm_*() print macros, since they + * need to handle NULL as the first argument passed. + */ +#define __drm_get_dev_ptr(drm) \ + _Generic((drm), \ + struct drm_device * : \ + __drm_get_dev_ptr((drm), true), \ + struct device * : \ + __drm_get_dev_ptr((drm), false), \ + default : \ + NULL \ + ) + +/** + * Helper for struct drm_device based logging (prefer this over struct device). + * Also supports struct device ptr as an argument for edge cases. + */ #define __drm_printk(drm, level, type, fmt, ...) \ - dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__) +({ \ + struct device *__dev_ = __drm_get_dev_ptr(drm); \ + if (__dev_) \ + dev_##level##type(__dev_, "[drm] " fmt, ##__VA_ARGS__); \ + else \ + pr_##level##type("[drm] " fmt, ##__VA_ARGS__); \ +}) #define drm_info(drm, fmt, ...) \ @@ -487,25 +531,25 @@ void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, #define drm_dbg_core(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_CORE, fmt, ##__VA_ARGS__) -#define drm_dbg_driver(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_CORE, fmt, ##__VA_ARGS__) +#define drm_dbg_driver(drm, fmt, ...) \ + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_DRIVER, fmt, ##__VA_ARGS__) #define drm_dbg_kms(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_KMS, fmt, ##__VA_ARGS__) + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) #define drm_dbg_prime(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_PRIME, fmt, ##__VA_ARGS__) + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_PRIME, fmt, ##__VA_ARGS__) #define drm_dbg_atomic(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) #define drm_dbg_vbl(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_VBL, fmt, ##__VA_ARGS__) + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_VBL, fmt, ##__VA_ARGS__) #define drm_dbg_state(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_STATE, fmt, ##__VA_ARGS__) + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_STATE, fmt, ##__VA_ARGS__) #define drm_dbg_lease(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_LEASE, fmt, ##__VA_ARGS__) + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_LEASE, fmt, ##__VA_ARGS__) #define drm_dbg_dp(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_DP, fmt, ##__VA_ARGS__) + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_DP, fmt, ##__VA_ARGS__) #define drm_dbg_drmres(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_DRMRES, fmt, ##__VA_ARGS__) + drm_dev_dbg(__drm_get_dev_ptr(drm), DRM_UT_DRMRES, fmt, ##__VA_ARGS__) #define drm_dbg(drm, fmt, ...) drm_dbg_driver(drm, fmt, ##__VA_ARGS__) @@ -533,31 +577,31 @@ void __drm_err(const char *format, ...); #define _DRM_PRINTK(once, level, fmt, ...) \ printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_info(). */ +/* NOTE: this is deprecated in favor of drm_info(NULL, ...). */ #define DRM_INFO(fmt, ...) \ _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_notice(). */ +/* NOTE: this is deprecated in favor of drm_notice(NULL, ...). */ #define DRM_NOTE(fmt, ...) \ _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_warn(). */ +/* NOTE: this is deprecated in favor of drm_warn(NULL, ...). */ #define DRM_WARN(fmt, ...) \ _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_info_once(). */ +/* NOTE: this is deprecated in favor of drm_info_once(NULL, ...). */ #define DRM_INFO_ONCE(fmt, ...) \ _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_notice_once(). */ +/* NOTE: this is deprecated in favor of drm_notice_once(NULL, ...). */ #define DRM_NOTE_ONCE(fmt, ...) \ _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_warn_once(). */ +/* NOTE: this is deprecated in favor of drm_warn_once(NULL, ...). */ #define DRM_WARN_ONCE(fmt, ...) \ _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_err(). */ +/* NOTE: this is deprecated in favor of drm_err(NULL, ...). */ #define DRM_ERROR(fmt, ...) \ __drm_err(fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_err_ratelimited(). */ +/* NOTE: this is deprecated in favor of drm_err_ratelimited(NULL, ...). */ #define DRM_ERROR_RATELIMITED(fmt, ...) \ DRM_DEV_ERROR_RATELIMITED(NULL, fmt, ##__VA_ARGS__) @@ -593,13 +637,14 @@ void __drm_err(const char *format, ...); #define DRM_DEBUG_DP(fmt, ...) \ __drm_dbg(DRM_UT_DP, fmt, ## __VA_ARGS__) -#define __DRM_DEFINE_DBG_RATELIMITED(category, drm, fmt, ...) \ -({ \ - static DEFINE_RATELIMIT_STATE(rs_, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST);\ - const struct drm_device *drm_ = (drm); \ - \ - if (drm_debug_enabled(DRM_UT_ ## category) && __ratelimit(&rs_)) \ - drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__); \ +#define __DRM_DEFINE_DBG_RATELIMITED(category, drm, fmt, ...) \ +({ \ + static DEFINE_RATELIMIT_STATE(rs_, DEFAULT_RATELIMIT_INTERVAL, \ + DEFAULT_RATELIMIT_BURST); \ + \ + if (drm_debug_enabled(DRM_UT_ ## category) && __ratelimit(&rs_))\ + drm_dev_printk(__drm_get_dev_ptr(drm), KERN_DEBUG, \ + fmt, ## __VA_ARGS__); \ }) #define drm_dbg_kms_ratelimited(drm, fmt, ...) \