From patchwork Tue Jul 31 18:11:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10551157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 655C013BB for ; Tue, 31 Jul 2018 18:12:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54A332B569 for ; Tue, 31 Jul 2018 18:12:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48A5D2B5CF; Tue, 31 Jul 2018 18:12:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C375D2B569 for ; Tue, 31 Jul 2018 18:12:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729409AbeGaTxq (ORCPT ); Tue, 31 Jul 2018 15:53:46 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:55508 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728140AbeGaTxq (ORCPT ); Tue, 31 Jul 2018 15:53:46 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6VI9MlX077552; Tue, 31 Jul 2018 18:11:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=ZEfzcZi7BovrXJUW/h3ggA4xD4P6803sanQIHYYInBk=; b=y/X1gnc2YQGiZ2wk9s/tSUEOy78zQyhMLb+yT6RYp7nmEOt5bRcEk74SfJXyY3d4AKlu Olw+vVfFFYIIbFHaPNqJ98dC0bcKCPEud7tyr9fx3iZZZyeJlzPcw34aKQ7ozeMOO/Nx LeSLXIpxqQtnR1cjkRAiED4B8kMy+ZfTMbb7qliC3maw6V9rHKQCvfwLEo5/aBcQoIe1 t9RORsjAwUCyQkdtsvwkcgrBwjhgvZaqS2d3k+3Pbjxr5xrxRS0T0zwL/vTUT+zxj5Gh aB/OLTGYEZzVjzH4/R8f5m8UtznBLKXbfiU2ZXUGgr4bNeXsVeFEPjuNfv6fieXapFcu DQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2kggep29jk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Jul 2018 18:11:45 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w6VIBi3r031322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Jul 2018 18:11:44 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6VIBgtQ022655; Tue, 31 Jul 2018 18:11:42 GMT Received: from kili.mountain (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 31 Jul 2018 11:11:41 -0700 Date: Tue, 31 Jul 2018 21:11:34 +0300 From: Dan Carpenter To: Jonathan Cameron , Maxime =?iso-8859-1?q?Roussin-B=E9l?= =?iso-8859-1?q?anger?= Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jean-Francois Dagenais , linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] iio: light: si1133: fix an && vs || typo Message-ID: <20180731181134.rp57ywlshwqm4onu@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8971 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=672 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807310168 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The "val" variable can't be both 0 and 1 at the same time so this will always return -EINVAL. Fixes: e01e7eaf37d8 ("iio: light: introduce si1133") Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-iio" 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/iio/light/si1133.c b/drivers/iio/light/si1133.c index d3fbeb3bc463..5ac22c46da1f 100644 --- a/drivers/iio/light/si1133.c +++ b/drivers/iio/light/si1133.c @@ -838,7 +838,7 @@ static int si1133_write_raw(struct iio_dev *iio_dev, switch (chan->type) { case IIO_INTENSITY: case IIO_UVINDEX: - if (val != 0 || val != 1) + if (val != 0 && val != 1) return -EINVAL; return si1133_update_adcsens(data,