Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7709242ybi; Thu, 1 Aug 2019 12:32:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJRFYH2rnT08ZUH75uudDSsdJZZ7vO5W3l3LIu/lgbHLLe+jYngQbS9FQ1nmSDiQvpDjXm X-Received: by 2002:a17:90a:cb87:: with SMTP id a7mr419770pju.130.1564687953244; Thu, 01 Aug 2019 12:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564687953; cv=none; d=google.com; s=arc-20160816; b=xieeS+bK2cCWUmXybwSCoVucbWP3x4FVBXh18GYZ5oEO1Qkp81uCeJCVKIqT1QqVeH hDF5GRtHTScGzxv+EIqDuguqZownVuTa/ZG+fXzHpfymNLC4PDkQWwOWJQNIvcWD587x 2HfmrsJQtHWfPwWCpIEsIdnbsjtSPyg3i2ncXR1UmGaTC5P1AFFuP2B7v7o7CwVVCiUj OE0xtrEtKMxSj7j8N8GwrM67TZTufEaHWXZKPODnE4w5NXLfpOHihtkDhjxXB7c5jlYS jaz1wKkzgQrOH4t/i8rmjzRj/u5V15j8yDxlWDFH5tBnTCaOBvhDp4ZHRsPLYupddzVn /Hig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/KxH//CcJ8Im+Foo/ZUTLEj8rEIDU88OrANuSVjeiJY=; b=Ms2xtoOdKC0BMADpOuI6RDaSfA0QDtUfkcZp1NaEYaWF27I+A1pdR5HuWlvor+IVdU 8qVuLOVYEiNzGCBNoeNjLdJND9Q7xEilmLqKzC9/nLYZyWoe4dOJo2ruunQOnKcofS76 pW3LZrnRNY6avjf+EtyPtEsIQF8ozTbMN20uRdUhjgL/ASes19Y1hisPZoCgrtyk14xs jfGIptitnb9t3LBTebgfjXuDshNQoOM5AsywqZaKHE58/zygd/DsxLw+OWuOHTjP7Km5 7uDkSv2omxzLc1NThw/QoaT1vxNZzG5WbP6Aa0K+Tn04InG0jWSmxciRvH+d2pxHr5BW HNsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ujfvtTrj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u71si37577321pgd.279.2019.08.01.12.32.17; Thu, 01 Aug 2019 12:32:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ujfvtTrj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388684AbfHATaC (ORCPT + 99 others); Thu, 1 Aug 2019 15:30:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:33536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388609AbfHATaB (ORCPT ); Thu, 1 Aug 2019 15:30:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 20FAB20838; Thu, 1 Aug 2019 19:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564687800; bh=aGiuNYAKFtwr+H6dfpMjzcshOhxpjT0ZAh8jB5F/L0A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ujfvtTrjvhO/7DUQN6B+/PSJcJ4VLRu59lE5mc6mxPMozovnomEOynQyjsTP6Xq/b LWXiB1lHcp0YOwJ3oZkSWDFoqHD2nyuj0kP+rcIg2cUMQJXJkBCafEvI8shsGZTLMf XMbTDVPDAnxO9TEon+cwBuJSVQ+/F6zEsN8KtVuA= Date: Thu, 1 Aug 2019 21:29:58 +0200 From: Greg KH To: Matt Sickler Cc: Harsh Jain , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] staging:kpc2000:Fix dubious x | !y sparse warning Message-ID: <20190801192958.GA24482@kroah.com> References: <20190731183606.2513-1-harshjain32@gmail.com> <20190801163437.GA8360@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 01, 2019 at 07:22:13PM +0000, Matt Sickler wrote: > >-----Original Message----- > >From: devel On Behalf Of Greg KH > >Sent: Thursday, August 01, 2019 11:35 AM > >To: Harsh Jain > >Cc: devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org > >Subject: Re: [PATCH] staging:kpc2000:Fix dubious x | !y sparse warning > > > >On Thu, Aug 01, 2019 at 12:06:06AM +0530, Harsh Jain wrote: > >> Bitwise OR(|) operation with 0 always yield same result. > >> It fixes dubious x | !y sparse warning. > >> > >> Signed-off-by: Harsh Jain > >> --- > >> drivers/staging/kpc2000/kpc2000_i2c.c | 16 +--------------- > >> 1 file changed, 1 insertion(+), 15 deletions(-) > >> > >> diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c > >> index b108da4..5f027d7c 100644 > >> --- a/drivers/staging/kpc2000/kpc2000_i2c.c > >> +++ b/drivers/staging/kpc2000/kpc2000_i2c.c > >> @@ -536,29 +536,15 @@ static u32 i801_func(struct i2c_adapter *adapter) > >> > >> u32 f = > >> I2C_FUNC_I2C | /* 0x00000001 (I enabled this one) */ > >> - !I2C_FUNC_10BIT_ADDR | /* 0x00000002 */ > >> - !I2C_FUNC_PROTOCOL_MANGLING | /* 0x00000004 */ > >> ((priv->features & FEATURE_SMBUS_PEC) ? I2C_FUNC_SMBUS_PEC : 0) | /* 0x00000008 */ > >> - !I2C_FUNC_SMBUS_BLOCK_PROC_CALL | /* 0x00008000 */ > >> I2C_FUNC_SMBUS_QUICK | /* 0x00010000 */ > >> - !I2C_FUNC_SMBUS_READ_BYTE | /* 0x00020000 */ > >> - !I2C_FUNC_SMBUS_WRITE_BYTE | /* 0x00040000 */ > >> - !I2C_FUNC_SMBUS_READ_BYTE_DATA | /* 0x00080000 */ > >> - !I2C_FUNC_SMBUS_WRITE_BYTE_DATA | /* 0x00100000 */ > >> - !I2C_FUNC_SMBUS_READ_WORD_DATA | /* 0x00200000 */ > >> - !I2C_FUNC_SMBUS_WRITE_WORD_DATA | /* 0x00400000 */ > >> - !I2C_FUNC_SMBUS_PROC_CALL | /* 0x00800000 */ > >> - !I2C_FUNC_SMBUS_READ_BLOCK_DATA | /* 0x01000000 */ > >> - !I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | /* 0x02000000 */ > > > >This is ok, it is showing you that these bits are explicitly being not > >set. Which is good, now you can go through the list and see that all > >are accounted for. > > > >So I think this should stay as-is, thanks. > > I was going to say the same thing, but I didn't know what the kernel style guideline was. > Would Linus prefer this style or would commenting them out be preferred? > Seems like the sparse warnings means the current style is not acceptable? > Sparse is just warning that you really are not doing anything here, in case you think you are, as it's a common pattern for bugs. So all should be fine, don't worry about it for now. thanks, greg k-h