• Jeff Mahoney's avatar
    reiserfs: fix warnings with gcc 4.4 · 1d965fe0
    Jeff Mahoney authored
    Several code paths in reiserfs have a construct like:
    
     if (is_direntry_le_ih(ih = B_N_PITEM_HEAD(src, item_num))) ...
    
    which, in addition to being ugly, end up causing compiler warnings with
    gcc 4.4.0.  Previous compilers didn't issue a warning.
    
    fs/reiserfs/do_balan.c:1273: warning: operation on `aux_ih' may be undefined
    fs/reiserfs/lbalance.c:393: warning: operation on `ih' may be undefined
    fs/reiserfs/lbalance.c:421: warning: operation on `ih' may be undefined
    fs/reiserfs/lbalance.c:777: warning: operation on `ih' may be undefined
    
    I believe this is due to the ih being passed to macros which evaluate the
    argument more than once.  This is old code and we haven't seen any
    problems with it, but this patch eliminates the warnings.
    
    It converts the multiple evaluation macros to static inlines and does a
    preassignment for the cases that were causing the warnings because that
    code is just ugly.
    Reported-by: default avatarChris Mason <mason@oracle.com>
    Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    1d965fe0
lbalance.c 41.4 KB