Return-Path: Received: from mx2.suse.de ([195.135.220.15]:53421 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934930AbcKVWkx (ORCPT ); Tue, 22 Nov 2016 17:40:53 -0500 From: Jiri Slaby To: stable@vger.kernel.org Cc: Arnd Bergmann , "David S . Miller" , Jiri Slaby Subject: [patch added to 3.12-stable] smc91x: avoid self-comparison warning Date: Tue, 22 Nov 2016 23:40:25 +0100 Message-Id: <20161122224029.29962-37-jslaby@suse.cz> In-Reply-To: <20161122224029.29962-1-jslaby@suse.cz> References: <20161122224029.29962-1-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: From: Arnd Bergmann This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit e3ebd894f084255fde19116955ba7054858ff5d6 upstream. The smc91x driver defines a macro that compares its argument to itself, apparently to get a true result while using its argument to avoid a warning about unused local variables. Unfortunately, this triggers a warning with gcc-6, as the comparison is obviously useless: drivers/net/ethernet/smsc/smc91x.c: In function 'smc_hardware_send_pkt': drivers/net/ethernet/smsc/smc91x.c:563:14: error: self-comparison always evaluates to true [-Werror=tautological-compare] if (!smc_special_trylock(&lp->lock, flags)) { This replaces the macro with another one that behaves similarly, with a cast to (void) to ensure the argument is used, and using a literal 'true' as its value. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Jiri Slaby --- drivers/net/ethernet/smsc/smc91x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 73be7f3982e6..af9e7d775348 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c @@ -533,7 +533,7 @@ static inline void smc_rcv(struct net_device *dev) #define smc_special_lock(lock, flags) spin_lock_irqsave(lock, flags) #define smc_special_unlock(lock, flags) spin_unlock_irqrestore(lock, flags) #else -#define smc_special_trylock(lock, flags) (flags == flags) +#define smc_special_trylock(lock, flags) ((void)flags, true) #define smc_special_lock(lock, flags) do { flags = 0; } while (0) #define smc_special_unlock(lock, flags) do { flags = 0; } while (0) #endif -- 2.10.2