From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753078AbbDCCxr (ORCPT ); Thu, 2 Apr 2015 22:53:47 -0400 Received: from mail-qg0-f47.google.com ([209.85.192.47]:33255 "EHLO mail-qg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbbDCCxl (ORCPT ); Thu, 2 Apr 2015 22:53:41 -0400 Date: Thu, 2 Apr 2015 22:53:38 -0400 From: Nickolaus Woodruff To: wsa@the-dreams.de Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/i2c/i2c-core.c: Fix sparse warning Message-ID: <20150403025338.GA18595@Caladan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes the following sparse warning in drivers/i2c/: CHECK drivers/i2c/i2c-core.c drivers/i2c/i2c-core.c:2353:36: warning: dubious: x | !y Signed-off-by: Nickolaus Woodruff --- drivers/i2c/i2c-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index edf274c..f50d46e 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -2350,7 +2350,7 @@ static u8 i2c_smbus_pec(u8 crc, u8 *p, size_t count) static u8 i2c_smbus_msg_pec(u8 pec, struct i2c_msg *msg) { /* The address will be sent first */ - u8 addr = (msg->addr << 1) | !!(msg->flags & I2C_M_RD); + u8 addr = (msg->addr << 1) | ((msg->flags & I2C_M_RD) != 0); pec = i2c_smbus_pec(pec, &addr, 1); /* The data buffer follows */ -- 1.9.1