From patchwork Sat Aug 23 19:04:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4769951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 65DD99F2E8 for ; Sat, 23 Aug 2014 19:07:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A37DB20158 for ; Sat, 23 Aug 2014 19:07:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C206D2013D for ; Sat, 23 Aug 2014 19:07:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XLGco-00008H-NA; Sat, 23 Aug 2014 19:05:18 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XLGcm-0007Uc-4P for linux-arm-kernel@lists.infradead.org; Sat, 23 Aug 2014 19:05:16 +0000 Received: from wuerfel.localnet (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0Mdund-1WyOXn0PjJ-00PbIf; Sat, 23 Aug 2014 21:04:50 +0200 From: Arnd Bergmann To: Corey Minyard Subject: [PATCH] ipmi: work around gcc-4.9 build warning Date: Sat, 23 Aug 2014 21:04:48 +0200 Message-ID: <58708252.p9ogO3naVQ@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.11.0-26-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:yBPxYo/cwdvtH7niZ0rS1jB1PHGIW9Qt3KMzlMpaOIw MqAzyJahLEUcxCz6ADOvLl5R7NfXo8dF2pKlNwQtrJyzyOr/8o 3jMLxMf389ui7vZyrX5tMOQSLMrCyoUCmqdPNyeu1zT+Mqktzr 33UZ6poGQ95OX9J0pnwze/wdX+pPrq8FqwcYP2cw1bdiRzDYHC CtQuiQ4OlK8++ONRXvtm05RrqIm/gJHxj0VhUpPwquNVzXvi8x pDWHZRM9jXumJu/Vn4Le2+1pXSJC49BpLEWuUZSKQJ8W9ActrD M0aBi/r/WwhKnN/ATHi09ylNJucyw7XzUkBClZSiCLlFwv8AWr rtHv8YFg3y621LMr6hKU= X-UI-Out-Filterresults: notjunk:1; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140823_120516_514532_386592E3 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Arnd Bergmann diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 5d665680ae33..539ff0db52fc 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -965,9 +965,9 @@ static inline int ipmi_si_is_busy(struct timespec *ts) return ts->tv_nsec != -1; } -static int ipmi_thread_busy_wait(enum si_sm_result smi_result, - const struct smi_info *smi_info, - struct timespec *busy_until) +static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result, + const struct smi_info *smi_info, + struct timespec *busy_until) { unsigned int max_busy_us = 0;