Received: by 10.192.165.156 with SMTP id m28csp2746155imm; Sun, 15 Apr 2018 08:08:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx48tECgcdgI65ZKXRcrEFPGONZUnJGYpzsT8CtEJ3jVaTA5iAZJixijyCxIac2MJlQORwXiT X-Received: by 2002:a17:902:4d45:: with SMTP id o5-v6mr12060958plh.84.1523804898815; Sun, 15 Apr 2018 08:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523804898; cv=none; d=google.com; s=arc-20160816; b=rdj+Z8KkNCstAbJ7OM3WcxhngdlZf+wWif7a+//HCVchZu1rnje4hIfJI+4FtB0FTu YZcvw1QdYSCLX3bHfMsn6xqATlhNEvoSRDrLJ7e0k5AFxYhyd2hbfjXQCIT61CUyQswc IodSylwAFwjSLMxVdbmKH0emESNetHknEKzq55UaO7Sos1tVC7/g5gbvXYONTMvemL2+ IUDW4HGVRg4o2KvX4vG5gX5O64obuqA8i5DnhYwAM8x/Ub27r5aJfMydQgalxvM5kZ9Y OzEFTUdls8C0JohYj+i0QMuO5JMLPOuBQS014Am9f+5JJteHrZfG95GQtdvNgxMrElNE YdgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=BRlwHWLAIdOLX0yHZT1/I14v8P2CMplcXyfmwvFZDzk=; b=eH3uoITifgm3/DNsR3bmSm2b7TxpIK3qYexogMK9QOi8HtZbG/U/p8EW85gDoBzdr+ kYW9PH5/MzjPIesPsyfHJdgPMdwYgZZuZnpbPD5BLL5OQckJgKV/b25ovBBLqJIEnp7q J3i0ANKq4XoiaIHMzGEw2jMDya4vOMAFKR6MG4fJnIWY96/9fVEHKBe9GqhssVsD+TzI aAVatXvUZhPCALS3N8DuLBVQkxFynBBVV1gzTws8mcyRxDXgEqkHyiM2TUbldwDjB4+D vSI0UD+XsDxqrzbcsCargJqrns6azs0Jz2dza17bbzCtKdAOqZNcU8bxpm0bODwGLuVS SfSA== ARC-Authentication-Results: i=1; mx.google.com; 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 t12-v6si10368496plq.547.2018.04.15.08.08.05; Sun, 15 Apr 2018 08:08:18 -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; 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 S1752697AbeDOPF5 convert rfc822-to-8bit (ORCPT + 99 others); Sun, 15 Apr 2018 11:05:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:38428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399AbeDOPFz (ORCPT ); Sun, 15 Apr 2018 11:05:55 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 3517520779; Sun, 15 Apr 2018 15:05:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3517520779 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sun, 15 Apr 2018 16:05:50 +0100 From: Jonathan Cameron To: =?UTF-8?B?SGVybsOhbg==?= Gonzalez Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 03/14] staging: iio: ad7746: Fix bound checkings Message-ID: <20180415160550.4705667e@archlinux> In-Reply-To: <1523637411-8531-4-git-send-email-hernan@vanguardiasur.com.ar> References: <1523637411-8531-1-git-send-email-hernan@vanguardiasur.com.ar> <1523637411-8531-4-git-send-email-hernan@vanguardiasur.com.ar> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Apr 2018 13:36:40 -0300 Hernán Gonzalez wrote: > Also remove unnecessary parenthesis I am probably missing something. I'm not sure what you mean by fix bound checking? There are superfluous brackets, but I don't see any functional change to indicate there was anything wrong with the original checks. > > Signed-off-by: Hernán Gonzalez > --- > drivers/staging/iio/cdc/ad7746.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c > index 516aa93..d793785 100644 > --- a/drivers/staging/iio/cdc/ad7746.c > +++ b/drivers/staging/iio/cdc/ad7746.c > @@ -458,7 +458,7 @@ static int ad7746_write_raw(struct iio_dev *indio_dev, > ret = 0; > break; > case IIO_CHAN_INFO_CALIBBIAS: > - if ((val < 0) | (val > 0xFFFF)) { > + if (val < 0 || val > 0xFFFF) { > ret = -EINVAL; > goto out; > } > @@ -470,7 +470,7 @@ static int ad7746_write_raw(struct iio_dev *indio_dev, > ret = 0; > break; > case IIO_CHAN_INFO_OFFSET: > - if ((val < 0) | (val > 43008000)) { /* 21pF */ > + if (val < 0 || val > 43008000) { /* 21pF */ > ret = -EINVAL; > goto out; > }