]> 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>
Wed, 25 Apr 2012 01:02:37 +0000 (11:02 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 30 Apr 2012 05:17:07 +0000 (15:17 +1000)
commitf3cafd18425b11efc3607be2ef2f8fa17c045639
tree989a3ac2d68eb277606c2d74cccdcc0a720be66a
parentabb3266104aa6a0677bee03b78e23d4b62a59498
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