All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Tom Rix <trix@redhat.com>
Cc: akpm@linux-foundation.org, pmladek@suse.com,
	kernelfans@gmail.com, lecopzer.chen@mediatek.com,
	ldufour@linux.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: set variables watchdog_soft,hardlockup_user_enabled storage-class-specifier to static
Date: Wed, 24 May 2023 11:05:15 -0700	[thread overview]
Message-ID: <CAD=FV=V_i5wR4oNy+xarA9e=VcgpH6i3U1uxFKtsaOe5AQX=Zw@mail.gmail.com> (raw)
In-Reply-To: <CAD=FV=W5HrBFakvoX-cQ5G=4xV1upkFPZ6aSR8me+d+aCpirgg@mail.gmail.com>

Hi,

On Tue, May 23, 2023 at 7:12 AM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Tue, May 23, 2023 at 5:23 AM Tom Rix <trix@redhat.com> wrote:
> >
> > smatch reports
> > kernel/watchdog.c:40:19: warning: symbol
> >   'watchdog_hardlockup_user_enabled' was not declared. Should it be static?
> > kernel/watchdog.c:41:19: warning: symbol
> >   'watchdog_softlockup_user_enabled' was not declared. Should it be static?
> >
> > These variabled are only used in their defining file, so it should be static.
>
> s/variabled/variables
>
> >
> > Signed-off-by: Tom Rix <trix@redhat.com>
> > ---
> >  kernel/watchdog.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
>
> While your fix is valid (thanks!), it's only half the fix.
>
> I wondered why smatch would have suddenly noticed this since the
> change that touched this variable recently was only a rename. When I
> dug deeper, I realized that the old names actually _were_ referenced
> outside this file and my rename missed them. The reason I missed them
> is that the only reference is an "extern" reference in
> `include/linux/nmi.h`. The references in `include/linux/nmi.h`
> probably should have been removed in commit dd0693fdf054 ("watchdog:
> move watchdog sysctl interface to watchdog.c")
>
> ...so a more complete fix would also remove references to the old
> names (nmi_watchdog_user_enabled and soft_watchdog_user_enabled) in
> `include/linux/nmi.h`.

FWIW, Petr has the other half of the fix at:

https://lore.kernel.org/r/ZG4TW--j-DdSsUO6@alley

Any chance you could send out a v2 and include that? If I don't see
something by tomorrow morning I'll try to send out a v2 for you that
squashes your and his changes.

-Doug

  reply	other threads:[~2023-05-24 18:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 12:23 [PATCH] watchdog: set variables watchdog_soft,hardlockup_user_enabled storage-class-specifier to static Tom Rix
2023-05-23 12:40 ` Mukesh Ojha
2023-05-23 14:12 ` Doug Anderson
2023-05-24 18:05   ` Doug Anderson [this message]
2023-05-25 23:31     ` Doug Anderson

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='CAD=FV=V_i5wR4oNy+xarA9e=VcgpH6i3U1uxFKtsaOe5AQX=Zw@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=kernelfans@gmail.com \
    --cc=ldufour@linux.ibm.com \
    --cc=lecopzer.chen@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=trix@redhat.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 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.