From patchwork Fri May 14 13:10:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12257779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44300C433B4 for ; Fri, 14 May 2021 13:10:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 141756145D for ; Fri, 14 May 2021 13:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbhENNLo (ORCPT ); Fri, 14 May 2021 09:11:44 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:16352 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbhENNLn (ORCPT ); Fri, 14 May 2021 09:11:43 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14ED2taC015440; Fri, 14 May 2021 13:10:17 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-2020-01-29; bh=BWZS0HN8ia2EZ8/iDhv4qJtHdLFxZrWdNxtzGbJVoN0=; b=ocYbePh5J/X9c1hpPR3BUDrT+QM2TqhQy9lZYKDxqBNKca/MxMVEFdBlg8Sh6PLUMvLe 8M+plEmYrliWXZM7T2rc2cuMEyjeewecvxE1Mqm8GCAderzdz+omUR5CV/qFBr76CxLP Qkt9CH+rCta59TQTymgER1T8se4U4GgpEQ6UKghmbqHoqx4whtR6GDBRe2ZuyfUH1Gb0 /MVeMvT1egGXDSZ+p9orNLesSDds4yScw87JNeZ/EQr2NbGF/P5D77XO/FuPYFezYPmm z6xTmGQE7LXiySXikKRqTDOhR3jlUFQVE/wZrI0htFHqi+X5HUVPLkstDSIUux6yWodx Gg== Received: from oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 38gpqsrp8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 May 2021 13:10:17 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 14ED1DTI084169; Fri, 14 May 2021 13:10:16 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3020.oracle.com with ESMTP id 38gppe5jax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 May 2021 13:10:16 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 14ED40Aa113198; Fri, 14 May 2021 13:10:15 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 38gppe5j9a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 May 2021 13:10:15 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 14EDAEuv018893; Fri, 14 May 2021 13:10:14 GMT Received: from mwanda (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 14 May 2021 06:10:13 -0700 Date: Fri, 14 May 2021 16:10:07 +0300 From: Dan Carpenter To: Jonathan Cameron Cc: Lars-Peter Clausen , Joe Sandom , Andy Shevchenko , linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] iio: light: tsl2591: fix some signedness bugs Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Proofpoint-GUID: Sb-hFiORgf1OQUOz4XMQTOELAE__bnP3 X-Proofpoint-ORIG-GUID: Sb-hFiORgf1OQUOz4XMQTOELAE__bnP3 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org These variables need to be int for the error handling to work. Fixes: f053d4e748ce ("iio: light: Added AMS tsl2591 driver implementation") Signed-off-by: Dan Carpenter --- drivers/iio/light/tsl2591.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c index 2bdae388ff01..26e3cb6c4ff8 100644 --- a/drivers/iio/light/tsl2591.c +++ b/drivers/iio/light/tsl2591.c @@ -213,7 +213,7 @@ static int tsl2591_gain_to_multiplier(const u8 als_gain) } } -static u8 tsl2591_multiplier_to_gain(const u32 multiplier) +static int tsl2591_multiplier_to_gain(const u32 multiplier) { switch (multiplier) { case TSL2591_CTRL_ALS_LOW_GAIN_MULTIPLIER: @@ -783,8 +783,8 @@ static int tsl2591_write_raw(struct iio_dev *indio_dev, int val, int val2, long mask) { struct tsl2591_chip *chip = iio_priv(indio_dev); - u32 int_time; - u8 gain; + int int_time; + int gain; int ret; mutex_lock(&chip->als_mutex); From patchwork Fri May 14 13:10:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12257781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0A54C433ED for ; Fri, 14 May 2021 13:11:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD2906145E for ; Fri, 14 May 2021 13:11:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231754AbhENNMg (ORCPT ); Fri, 14 May 2021 09:12:36 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:23292 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbhENNMg (ORCPT ); Fri, 14 May 2021 09:12:36 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14ED17JA018629; Fri, 14 May 2021 13:11:10 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 : in-reply-to; s=corp-2020-01-29; bh=7fC04BucLpGRD/n2GA1XspszHQIl4ZHLmE65wctplAY=; b=Q8HL8oJDlLSH/LMF6fpUfBnDb2UpqrVz5qTgJrOQK7f0FHB9AXACy4Yl/C3r4iPFI1st DqmqznPjv8bnG7F60XUc6xJ21cxy8GyFWSbT8ll5/H5SpX4zIWb4SnQ/4dkyCWNVlX2x O6QS87ui3Wb0eBpaPabaSNuu/ssPZAUNhaOA/ZIDPx/8BPyAS7xp2CNb2L7gP9++hYN+ U+z9g18cVX34o5RMXle7MMJTsuyEnDaKAZoAhIT+aDURnNmTsg5SKJQwgvgeMBc/9Qzu QabLzhPSsyZWEwjV9uZxR+kT2pebGi8Z0IbKJuEtxeFm/z4YTS5eCGsKGt0t/UdDECeC QQ== Received: from oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 38gppjgp89-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 May 2021 13:11:10 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 14EDB9kO188514; Fri, 14 May 2021 13:11:09 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3020.oracle.com with ESMTP id 38gppe5mqc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 May 2021 13:11:09 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 14EDB7oh187959; Fri, 14 May 2021 13:11:07 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 38gppe5mgm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 May 2021 13:11:07 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 14EDB2fJ015206; Fri, 14 May 2021 13:11:02 GMT Received: from mwanda (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 14 May 2021 06:11:01 -0700 Date: Fri, 14 May 2021 16:10:55 +0300 From: Dan Carpenter To: Jonathan Cameron Cc: Lars-Peter Clausen , Joe Sandom , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 2/2] iio: light: tsl2591: delete a stray tab Message-ID: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email haha only kidding X-Proofpoint-ORIG-GUID: AKY68wcUczUoxFVjFD-8bC0o0aQH1_9J X-Proofpoint-GUID: AKY68wcUczUoxFVjFD-8bC0o0aQH1_9J Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org This return statement is indented one more tab than it should be. Signed-off-by: Dan Carpenter --- drivers/iio/light/tsl2591.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c index 26e3cb6c4ff8..39e68d0c9d6a 100644 --- a/drivers/iio/light/tsl2591.c +++ b/drivers/iio/light/tsl2591.c @@ -451,7 +451,7 @@ static int tsl2591_read_channel_data(struct iio_dev *indio_dev, sizeof(als_data), als_data); if (ret < 0) { dev_err(&client->dev, "Failed to read data bytes"); - return ret; + return ret; } als_ch0 = get_unaligned_le16(&als_data[0]);