]> git.karo-electronics.de Git - karo-tx-linux.git/commit
pagemap.h: fix warning about possibly used before init var
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 3 May 2012 05:43:08 +0000 (15:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 May 2012 05:46:10 +0000 (15:46 +1000)
commitbd16c55182250652aabf09887c4b00f447a9719a
tree8477b37e283cf47133754ed3c367464cb86ec88f
parent507486c6e7c6cdbd57fcd273bff40525c87222ff
pagemap.h: fix warning about possibly used before init var

Commit f56f821feb7b36223f309e0ec05986bb137ce418 (linux-next)

    "mm: extend prefault helpers to fault in more than PAGE_SIZE"

added in the new functions:

fault_in_multipages_writeable
fault_in_multipages_readable

However, we currently see:

  include/linux/pagemap.h:492: warning: 'ret' may be used uninitialized in this function
  include/linux/pagemap.h:492: note: 'ret' was declared here

Unlike a lot of gcc nags, this one appears somewhat legit.  i.e.  passing
in an invalid negative value of "size" does make it look like all the
conditionals in there would be bypassed and the uninitialized value would
be returned.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/pagemap.h