[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ae170e7c4988399e63a00ad8505e397665563d22.camel@sipsolutions.net>
Date: Sat, 18 Apr 2020 21:16:19 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Matthew Wilcox <willy@...radead.org>, Joe Perches <joe@...ches.com>
Cc: Randy Dunlap <rdunlap@...radead.org>, linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org,
"J. Bruce Fields" <bfields@...ldses.org>,
Chuck Lever <chuck.lever@...cle.com>,
linux-nfs@...r.kernel.org, Dan Williams <dan.j.williams@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Dave Jiang <dave.jiang@...el.com>, linux-nvdimm@...ts.01.org,
"Martin K. Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
Zzy Wysm <zzy@...wysm.com>
Subject: Re: [PATCH 7/9] drivers/base: fix empty-body warnings in
devcoredump.c
On Sat, 2020-04-18 at 12:13 -0700, Matthew Wilcox wrote:
>
> > > > > if (sysfs_create_link(&devcd->devcd_dev.kobj, &dev->kobj,
> > > > > "failing_device"))
> > > > > - /* nothing - symlink will be missing */;
> > > > > + do_empty(); /* nothing - symlink will be missing */
> > > > >
> > > > > if (sysfs_create_link(&dev->kobj, &devcd->devcd_dev.kobj,
> > > > > "devcoredump"))
> > > > > - /* nothing - symlink will be missing */;
> > > > > + do_empty(); /* nothing - symlink will be missing */
> > > > >
> > > > > INIT_DELAYED_WORK(&devcd->del_wk, devcd_del);
> > > > > schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT);
> > > >
> > > > Could just remove the 'if's?
> > > >
> > > > + sysfs_create_link(&devcd->devcd_dev.kobj, &dev->kobj,
> > > > + "failing_device");
> > > >
> > >
> > > OK.
> >
> > sysfs_create_link is __must_check
>
> Oh, I missed the declaration -- I just saw the definition. This is a
> situation where __must_check hurts us and it should be removed.
>
> Or this code is wrong and it should be
>
> WARN(sysfs_create_link(&devcd->devcd_dev.kobj, &dev->kobj,
> "failing_device");
Perhaps it should be. I didn't think it really mattered _that_ much if
the symlink suddenly went missing, but OTOH I don't even know how it
could possibly fail.
johannes
Powered by blists - more mailing lists