public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: zhangjiao2 <zhangjiao2@cmss.chinamobile.com>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, trivial@kernel.org
Subject: Re: [PATCH] char: misc: add missing #ifdef CONFIG_PROC_FS and error checking
Date: Mon, 29 Jul 2024 11:43:40 +0200	[thread overview]
Message-ID: <2024072951-lyrically-running-d1e3@gregkh> (raw)
In-Reply-To: <20240729073511.61935-1-zhangjiao2@cmss.chinamobile.com>

On Mon, Jul 29, 2024 at 03:35:11PM +0800, zhangjiao2 wrote:
> From: Zhang Jiao <zhangjiao2@cmss.chinamobile.com>
> 
> Add "#ifdef CONFIG_PROC_FS" to control misc proc create 
> and give some error checking.
> 
> Signed-off-by: Zhang Jiao <zhangjiao2@cmss.chinamobile.com>
> ---
>  drivers/char/misc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/char/misc.c b/drivers/char/misc.c
> index 541edc26ec89..0370d53f368a 100644
> --- a/drivers/char/misc.c
> +++ b/drivers/char/misc.c
> @@ -286,9 +286,15 @@ EXPORT_SYMBOL(misc_deregister);
>  static int __init misc_init(void)
>  {
>  	int err;
> +#ifdef CONFIG_PROC_FS

We should almost never have #ifdef in .c files, please don't do that
here either.

Also, why is this suddenly a new issue?

And, when you have "and" in a changelog text, that's a huge hint you
need to split things up into multiple patches, please do that here.

thanks,

greg k-h

      parent reply	other threads:[~2024-07-29  9:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29  7:35 [PATCH] char: misc: add missing #ifdef CONFIG_PROC_FS and error checking zhangjiao2
2024-07-29  9:42 ` Arnd Bergmann
2024-07-30  8:03   ` [PATCH v2] char: misc: add missing #ifdef CONFIG_PROC_FS zhangjiao2
2024-07-30  8:42     ` Greg KH
2024-07-30  8:31       ` zhangjiao2
2024-07-30  9:11         ` Greg KH
2024-07-30 10:25           ` Arnd Bergmann
2024-07-29  9:43 ` Greg KH [this message]

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=2024072951-lyrically-running-d1e3@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@kernel.org \
    --cc=zhangjiao2@cmss.chinamobile.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox