All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Jingyu Wang <jingyuwang_vip@163.com>,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch
Cc: Jingyu Wang <jingyuwang_vip@163.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/print: cleanup coding style in drm_print.h
Date: Mon, 05 Sep 2022 11:45:34 +0300	[thread overview]
Message-ID: <87wnaib45t.fsf@intel.com> (raw)
In-Reply-To: <20220904203818.16775-1-jingyuwang_vip@163.com>

On Mon, 05 Sep 2022, Jingyu Wang <jingyuwang_vip@163.com> wrote:
> Fix everything checkpatch.pl complained about in drm_print.h

Sorry, you just can't assume the checkpatch.pl complaints are all
correct, or that it would be this trivial to fix them.

This is broken.

> Signed-off-by: Jingyu Wang <jingyuwang_vip@163.com>
> ---
>  include/drm/drm_print.h | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index 22fabdeed297..4332fbeb76a8 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -1,3 +1,4 @@
> +/* SPDX-License-Identifier: MIT */

What's the point of having both the SPDX and full license text in the
header? But unless you're the license holder, I'd be pretty careful
about removing the license text.

>  /*
>   * Copyright (C) 2016 Red Hat
>   *
> @@ -103,7 +104,7 @@ __printf(2, 0)
>   * @va: the va_list
>   */
>  static inline void
> -drm_vprintf(struct drm_printer *p, const char *fmt, va_list *va)
> +drm_vprintf(struct drm_printer *p, const char *fmt, va_list * va)

Checkpatch is just confused here. Look at all the other params, why
would you add an extra space here?

>  {
>  	struct va_format vaf = { .fmt = fmt, .va = va };
>  
> @@ -426,16 +427,16 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
>  
>  
>  #define drm_info(drm, fmt, ...)					\
> -	__drm_printk((drm), info,, fmt, ##__VA_ARGS__)
> +	__drm_printk((drm), info, fmt, ##__VA_ARGS__)
>  
>  #define drm_notice(drm, fmt, ...)				\
> -	__drm_printk((drm), notice,, fmt, ##__VA_ARGS__)
> +	__drm_printk((drm), notice, fmt, ##__VA_ARGS__)
>  
>  #define drm_warn(drm, fmt, ...)					\
> -	__drm_printk((drm), warn,, fmt, ##__VA_ARGS__)
> +	__drm_printk((drm), warn, fmt, ##__VA_ARGS__)
>  
>  #define drm_err(drm, fmt, ...)					\
> -	__drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__)
> +	__drm_printk((drm), err, "*ERROR* " fmt, ##__VA_ARGS__)

This is macro magic, and that ,, there passes an empty arg. You remove
it completely, shifting all the args to the wrong place, breaking drm
error logging.

BR,
Jani.

>  
>  
>  #define drm_info_once(drm, fmt, ...)				\
>
> base-commit: e47eb90a0a9ae20b82635b9b99a8d0979b757ad8
> prerequisite-patch-id: f039528bc88876d6e0f64e843da089e85f6d3f58
> prerequisite-patch-id: c14ed2e970be2c3f8ba746634e8161b94c148e88

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-09-05  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-04 20:38 [PATCH] drm/print: cleanup coding style in drm_print.h Jingyu Wang
2022-09-04 20:38 ` Jingyu Wang
2022-09-05  8:45 ` Jani Nikula [this message]
2022-09-05  8:49   ` Jani Nikula
2022-09-05 10:05     ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnaib45t.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingyuwang_vip@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.