From patchwork Fri Apr 3 02:53:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nickolaus Woodruff X-Patchwork-Id: 457832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 151B914016A for ; Fri, 3 Apr 2015 13:53:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=M1fIvlc+; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751627AbbDCCxm (ORCPT ); Thu, 2 Apr 2015 22:53:42 -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 Received: by qgdy78 with SMTP id y78so23270486qgd.0; Thu, 02 Apr 2015 19:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=0aoDbfe8tC364CrNAPRCiim7Ho2wp2bTBdv73XGR+K8=; b=M1fIvlc+yoQA3xHBJRbXhfy7+VJsTnjmJ/uK2DoWZFEOMC/emwI7YU8jjY7+I6EWPh sbDd2zqNr3Aop36CQuWuiZwT4VdPaNaiQDQ/FxWYh7mSuBqbcl96lAAQwT3V5XEwfQOH TNp42QfjYI29r7sSB1rHi7z158cp+UQn+mPu7a2ErRqA51RwUXJALB/dcCwUnZOP99yC m+INZiHX4/1OFFUgKjBgw8esHm1qFCu1S+RuexA7qR7/nvcXBxxkqO7O5ucWPI3P6vKQ nWO3OFyxMQnUCV34ZwAb/bMZbgxPXHWSvpmxIUFx0Oo5RHrGDQmRK5lG3qg+D7lq+2/P GZfg== X-Received: by 10.55.50.79 with SMTP id y76mr702844qky.20.1428029620322; Thu, 02 Apr 2015 19:53:40 -0700 (PDT) Received: from localhost (c-68-81-145-94.hsd1.pa.comcast.net. [68.81.145.94]) by mx.google.com with ESMTPSA id p8sm4831078qha.20.2015.04.02.19.53.39 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 02 Apr 2015 19:53:39 -0700 (PDT) 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-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@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(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */