• Arnd Bergmann's avatar
    ipmi: work around gcc-4.9 build warning · cc4cbe90
    Arnd Bergmann authored
    Building ipmi on arm with gcc-4.9 results in this warning for an
    allmodconfig build:
    
      drivers/char/ipmi/ipmi_si_intf.c: In function 'ipmi_thread':
      include/linux/time.h:28:5: warning: 'busy_until.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized]
        if (lhs->tv_sec > rhs->tv_sec)
           ^
      drivers/char/ipmi/ipmi_si_intf.c:1007:18: note: 'busy_until.tv_sec' was declared here
        struct timespec busy_until;
                        ^
    
    The warning is bogus and this case can not occur.  Apparently this is a
    false positive resulting from gcc getting a little smarter about
    tracking assignments but not smart enough.
    
    Marking the ipmi_thread_busy_wait function as inline gives the gcc
    optimization logic enough information to figure out for itself that the
    case cannot happen, which gets rid of the warning without adding any
    fake initialization.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    cc4cbe90
ipmi_si_intf.c 93.3 KB