linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v1] printk: Declare log_wait as external variable
Date: Tue, 4 Feb 2020 11:05:33 +0200	[thread overview]
Message-ID: <20200204090533.GM32742@smile.fi.intel.com> (raw)
In-Reply-To: <20200204021620.GD41358@google.com>

On Tue, Feb 04, 2020 at 11:16:20AM +0900, Sergey Senozhatsky wrote:
> On (20/02/03 15:15), Andy Shevchenko wrote:
> > Static analyzer is not happy:
> > 
> > kernel/printk/printk.c:421:1: warning: symbol 'log_wait' was not declared. Should it be static?
> > 
> > This is due to usage of log_wait in the other module without announcing
> > its declaration to the world. I wasn't able to dug into deep history of
> > reasons why it is so, and thus decide to make less invasive change, i.e.
> > declaring log_wait as external variable to make static analyzer happy.
> 
> [..]
> 
> > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> > index 633f41a11d75..43b5cb88c607 100644
> > --- a/kernel/printk/printk.c
> > +++ b/kernel/printk/printk.c
> > @@ -418,7 +418,14 @@ DEFINE_RAW_SPINLOCK(logbuf_lock);
> >  	} while (0)
> >
> >  #ifdef CONFIG_PRINTK
> > +
> > +#ifdef CONFIG_PROC_FS
> > +extern wait_queue_head_t log_wait;	/* Used in fs/proc/kmsg.c */
> >  DECLARE_WAIT_QUEUE_HEAD(log_wait);
> > +#else
> > +static DECLARE_WAIT_QUEUE_HEAD(log_wait);
> > +#endif /* CONFIG_PROC_FS */
> 
> [..]
> 
> Since we are now introducing CONFIG_PROC_FS dependency to printk (and
> proc/kmsg already has CONFIG_PRINTK dependency),

I'm not sure I understood. The above does not introduce any dependencies.

>	then I guess I wouldn't
> mind it if fs/proc/kmsg would just relocate to printk, next to devksmg
> implementation. Just saying.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-02-04  9:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 13:15 [PATCH v1] printk: Declare log_wait as external variable Andy Shevchenko
2020-02-04  2:16 ` Sergey Senozhatsky
2020-02-04  9:05   ` Andy Shevchenko [this message]
2020-02-04 11:22     ` Sergey Senozhatsky
2020-02-04 11:31       ` Andy Shevchenko
2020-02-11 12:43 ` Petr Mladek
2020-02-12  1:31   ` Sergey Senozhatsky
2020-02-12 14:03     ` Petr Mladek
2020-02-12 14:24       ` John Ogness
2020-02-13 12:02         ` Sergey Senozhatsky

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=20200204090533.GM32742@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.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;
as well as URLs for NNTP newsgroup(s).