mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	Randy Dunlap <rdunlap@infradead.org>,
	Matthew Wilcox <willy@infradead.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Joe Perches <joe@perches.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] devcoredump: avoid -Wempty-body warnings
Date: Mon, 22 Mar 2021 12:35:23 +0100	[thread overview]
Message-ID: <YFiA+2/kgOWOyWHP@kroah.com> (raw)
In-Reply-To: <CAK8P3a2B4X98VMy-1E=mNX+96Dmika8Y-YdTn5E-_uWqK9JnWQ@mail.gmail.com>

On Mon, Mar 22, 2021 at 12:22:11PM +0100, Arnd Bergmann wrote:
> On Mon, Mar 22, 2021 at 11:29 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > On Mon, Mar 22, 2021 at 11:19:53AM +0100, Arnd Bergmann wrote:
> > > From: Arnd Bergmann <arnd@arndb.de>
> > > +      * These should normally not fail, but there is no problem
> > > +      * continuing without the links, so just warn instead of
> > > +      * failing.
> > > +      */
> > > +     WARN_ON_ONCE(sysfs_create_link(&devcd->devcd_dev.kobj, &dev->kobj,
> > > +                                    "failing_device"));
> > >
> > > -     if (sysfs_create_link(&dev->kobj, &devcd->devcd_dev.kobj,
> > > -                           "devcoredump"))
> > > -             /* nothing - symlink will be missing */;
> > > +     WARN_ON_ONCE(sysfs_create_link(&dev->kobj, &devcd->devcd_dev.kobj,
> > > +                                    "devcoredump"));
> >
> > We do not want to reboot machines that have panic-on-warn set,
> 
> Fair enough.
> 
> > so if this really needs a trace dump, please do that instead...
> 
> I don't think the backtrace is needed here, if it ever happens it's either
> going to be -ENOMEM or completely reproducible. I can instead
> do the cast to (void) that Linus suggested, or a simple if(...) dev_warn()
> or dev_warn_once() to have some indication of the failure.

dev_warn() should be fine I think.

thanks,

greg k-h

      reply	other threads:[~2021-03-22 11:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 10:19 Arnd Bergmann
2021-03-22 10:29 ` Greg Kroah-Hartman
2021-03-22 11:22   ` Arnd Bergmann
2021-03-22 11:35     ` Greg Kroah-Hartman [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=YFiA+2/kgOWOyWHP@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@kernel.org \
    --cc=joe@perches.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=willy@infradead.org \
    /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

all inboxes | Powered by JetHome®