Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2319880imm; Thu, 20 Sep 2018 11:08:44 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda/7OOP/ujD76zSeWfAzhAujrcLVMfxE8z/tto69lKk0p0IEUsi9rgCBhvExXHcJs/lkh8r X-Received: by 2002:a63:d74f:: with SMTP id w15-v6mr38144244pgi.306.1537466924671; Thu, 20 Sep 2018 11:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537466924; cv=none; d=google.com; s=arc-20160816; b=s1t+Cvp+5AQsfOplguvd/FEW80vyrynnqVU/ICO7ABn0DJbgF1uQA23tkq8loPBrP/ A5WPYNeFjAEeOQWL/012SzoAL/ZNRGykpuxZ81HAUAQCTWwSqlcTMSdqRKlISy5ABVmU Gplhm4m1kCPN9iRcnObS24DqgJLfQbZBpUYlPXB/mT4HbQ7CtRgGObon3qbzTVV54lZT Laq0Ks1emllGGHM2bu+xFZvOVvGSl638RiWvGqdstICYOxXBcByqis3fQ+v372AWxdSX WJe9qXBu3eTr9ILo0G7vE6R5zJ94FedXW3dEfQA9mTb0bVqgfiemjKXxqxVuylGjnrU1 zrNw== 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=iknaWo/C9kRaiPoGpx7TdiD50gzYqmdiZTQEqjTAg+M=; b=WoYAssHtvYXtYy0isrfDNV78gHs3Zoh+ozS/7Csi6klQ+D8WiVcTV9I70Ri2rspXOz sZ2NUopIldYYmhmY1rsaNbVhAp1XAk1pjlpkC6htfDaN2bp4XZQvkvlWALu+y3mXCln+ PvJfuyesn4bQyNdyAnJ2Ada6G1BOJarE/HjImh6BvcGqWuJtfkggylt9yU+CJdRIF/kM fOpB4MZ3cqKk/qctedWn3dIxd+uBV9gSsBeg5kAoCNqm4jtxgA3V4aO3Xj+QHgoZNrs8 9R8SubS9x4BTNZ39JCRHPVllEA5g9B7qCUBv+9XrseNNF7rNPGLnvlFynt7iK3hcb55E I2TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="x1/hRuwo"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n85-v6si24880212pfj.251.2018.09.20.11.08.27; Thu, 20 Sep 2018 11:08:44 -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=@oracle.com header.s=corp-2018-07-02 header.b="x1/hRuwo"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388038AbeITXwv (ORCPT + 99 others); Thu, 20 Sep 2018 19:52:51 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:38256 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387424AbeITXwt (ORCPT ); Thu, 20 Sep 2018 19:52:49 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8KHwqBU089809; Thu, 20 Sep 2018 18:06:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=iknaWo/C9kRaiPoGpx7TdiD50gzYqmdiZTQEqjTAg+M=; b=x1/hRuwojH5aAQtI72mzrndfGrb5CTVr/i/miVel9oTyz8PK0E6NQYJd16ylnp2U29lK YhWVI+M2V/p8X5ih/6ohenJCKP8J6xhlKndef3ANsE29eRt0LDfZtRdYAAT0Gf1JBZ5A P90AJZUlA69/uwMcL1dgjHHs/sL42CjxxioJzQo+zpOw6Nx8+gnD3UR76s2fxuDlb0iR R3HK/CrpSQTdyjN6quQWdX5Rvda6yZGWUlMmEPEy15fyavkdjrCTZbbbeLzpfY0u+1H1 gIwaYucsryA/hHlwcA+n5d3Gvwt1B5vzNBr9Q435rNnSq4VhP572dqlyndoJXJJ8jF7B ag== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2mgtqrcd80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Sep 2018 18:06:02 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8KI5xwU029204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Sep 2018 18:06:00 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8KI5p6u024791; Thu, 20 Sep 2018 18:05:51 GMT Received: from mwanda (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 20 Sep 2018 11:05:50 -0700 Date: Thu, 20 Sep 2018 21:05:29 +0300 From: Dan Carpenter To: Janusz Krzysztofik Cc: Marek Szyprowski , Andrew Lunn , Ulf Hansson , linux-doc@vger.kernel.org, linux-iio@vger.kernel.org, Linus Walleij , Dominik Brodowski , Peter Rosin , netdev@vger.kernel.org, linux-i2c@vger.kernel.org, Peter Meerwald-Stadler , devel@driverdev.osuosl.org, Florian Fainelli , Jonathan Corbet , Krzysztof Kozlowski , Kishon Vijay Abraham I , Tony Lindgren , Lukas Wunner , Geert Uytterhoeven , linux-serial@vger.kernel.org, Jiri Slaby , Michael Hennerich , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-gpio@vger.kernel.org, Russell King , Lars-Peter Clausen , Yegor Yefremov , Sebastien Bourdelin , "'Linux Samsung SOC'" , Rojhalat Ibrahim , Greg Kroah-Hartman , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Willy Tarreau , Miguel Ojeda Sandonis , Peter Korsgaard , Hartmut Knaack , "David S. Miller" , Jonathan Cameron Subject: Re: [PATCH v7 4/4] gpiolib: Implement fast processing path in get/set array Message-ID: <20180920180529.hjc54yoqmvnpvvt7@mwanda> References: <20180831225616.29221-1-jmkrzyszt@gmail.com> <20180920101151eucas1p221f5a1715b8556bb9d99bf08fe09ce6f~WE-_cEf4l0754207542eucas1p27@eucas1p2.samsung.com> <9860023.SlBYqtbjDV@z50> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9860023.SlBYqtbjDV@z50> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9022 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=456 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809200173 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 20, 2018 at 05:48:22PM +0200, Janusz Krzysztofik wrote: > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index a53d17745d21..5bc3447949c9 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -2880,7 +2880,7 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep, > __set_bit(hwgpio, mask); > > if (array_info) > - find_next_zero_bit(array_info->get_mask, > + i = find_next_zero_bit(array_info->get_mask, > array_size, i); We could mark find_next_zero_bit() and friends as a __must_check functions so we avoid this bug in the future. I have a more complicated idea how to detect these bugs in a generic way using Smatch but it will take longer to implement. regards, dan carpenter