Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1479314
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] dax: use correct dev_t value |
| Date | 2016-09-08 17:10 +0200 |
| Message-ID | <sf97H-7om-17@gated-at.bofh.it> (permalink) |
| References | <sf81X-6tT-11@gated-at.bofh.it> <sf8Y2-75b-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thursday, September 8, 2016 7:56:31 AM CEST Dan Williams wrote:
> On Thu, Sep 8, 2016 at 6:53 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > The dev_t variable in devm_create_dax_dev() is used before it's
> > first set:
> >
> > drivers/dax/dax.c: In function 'devm_create_dax_dev':
> > drivers/dax/dax.c:205:39: error: 'dev_t' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > inode = iget5_locked(dax_superblock, hash_32(devt + DAXFS_MAGIC, 31),
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > drivers/dax/dax.c:688:8: note: 'dev_t' was declared here
> >
> > This reorders the code to how it looks correct to me.
> >
>
> Looks good to me.
>
> Strange, I don't see this error with gcc-5.3.1, I assume 0day missed
> it for a similar reason?
No, the warning is disabled by now since 6e8d666e9253 ("Disable
"maybe-uninitialized" warning globally"), which I have reverted
locally.
You can also build with -Wmaybe-uninitialized, but that causes
many false positives if any of these options are enabled:
CONFIG_CC_OPTIMIZE_FOR_SIZE
CONFIG_PROFILE_ALL_BRANCHES
CONFIG_UBSAN_SANITIZE_ALL
CONFIG_GCOV_PROFILE_ALL
I'm still trying to come up with a way to get the warning to
be useful again without annoying Linus too much.
Arnd
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] dax: use correct dev_t value Arnd Bergmann <arnd@arndb.de> - 2016-09-08 16:00 +0200
Re: [PATCH] dax: use correct dev_t value Dan Williams <dan.j.williams@intel.com> - 2016-09-08 17:00 +0200
Re: [PATCH] dax: use correct dev_t value Arnd Bergmann <arnd@arndb.de> - 2016-09-08 17:10 +0200
csiph-web