Received: by 10.192.165.148 with SMTP id m20csp10892imm; Fri, 20 Apr 2018 02:02:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+zTyVRNMfUZRygy6I0J1R4djUOH4J2FAfsct5M9+lE31cXXoL+FYwNkz/8PDTWWi3Jmpgk X-Received: by 2002:a17:902:33a5:: with SMTP id b34-v6mr9514264plc.232.1524214961413; Fri, 20 Apr 2018 02:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524214961; cv=none; d=google.com; s=arc-20160816; b=vRckzt/XOjOxaZOF9slbGavJovnakCu41cZDRaBbtItkEG7OTmG/FgNSep64A2Borr hR37NUkqCNDaH/WDaL/TNSC48CYqzQuicN8Ibzn2lY5UyLlRptyrlV9tZFLKszr26BZS 2vvh65hOWJ4HjFvtvpvwZOxNyTy0R8ni7cyEJ63XeihoQR5PpE3z6B//LkSKzjCcpF4Z w+bnk6tu12BZ4EmzIS6ljmm6lcMbAmWVhUQ+ZOkf8DLXR0qODzhmrPdlmf4gYNr5C0x+ e/5u/vygeGp5E0b7uGfQvSeDbVTvK1ACWO+x8lZasH/jXfBeBSpLxHQOPud8ehBljLk+ 4cKQ== 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:arc-authentication-results; bh=0fC2lds3gTir+0+V5JMmcmguXTbA8MSitF+I5b3Laco=; b=VuGXsnASUsILFtuMOlC0CLh8k6sAy5gO1mlEf+kvdANdk16ppMDzkH/uvQFwzp2Vyz GY6aMK9XdEuU5lNOmt++7qeAwuMYxhnlShh+rmO3tR+1DBicvuz6eupPze1/UIAbg0oW q91ozluo7xis+NAk1JfYCei2kzI8CaAE2YVAQQpgpROrQMWyCGkcFB+QF/mNl9B4L53n hc0FD50A0A4CNra3idKeyOmPxRqUyWEmGoyDn8Zv8MjGrlalE9/bz2a//pql/WLkzGbX ixD5b1fIegndljoewO0zBYppKRpkQtYtDFigf8AZthYaruiIZ4Q0vqVo3Q/r2TeuWlyn HM2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ArEAvgn7; 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 s72si5081184pfa.252.2018.04.20.02.02.27; Fri, 20 Apr 2018 02:02:41 -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-2017-10-26 header.b=ArEAvgn7; 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 S1754204AbeDTJBR (ORCPT + 99 others); Fri, 20 Apr 2018 05:01:17 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57352 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754074AbeDTJBQ (ORCPT ); Fri, 20 Apr 2018 05:01:16 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3K8tuw1092803; Fri, 20 Apr 2018 09:01:13 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-2017-10-26; bh=0fC2lds3gTir+0+V5JMmcmguXTbA8MSitF+I5b3Laco=; b=ArEAvgn7rm+uVmr/iah67bcKx0cVRIn1n17zR1CHuqtt43GQnnML2nUvAraR5IoSFjdc BTLjgUgRJ1QiB+sGLLmZFCfzwNXXbIP0aOKMJ7gOyqq2bmTJYzTjbEufXXF/+Bw1huZ6 D+z68kI/+VwyJlBOZd02Xw6YM0LArREBCEZJmmAHFEE41MW0sC+twDMIon/R04ishTpF x+tzLPxDD54kfSG0gwSil2HJaQ5q2Lqt70HoVIrUa4ulj0QAp/EI8urs9FrrFWxM4mgp ic8kW/ZYb3zfZDMTX6fKPqltfsYwwjoU/wC8sKQhFS8LnGAQbZFzRKOnLEpFsLUD8GP5 vg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2hf7ams302-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Apr 2018 09:01:12 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3K91C93004383 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Apr 2018 09:01:12 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3K91BMr029760; Fri, 20 Apr 2018 09:01:11 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 20 Apr 2018 02:01:11 -0700 Date: Fri, 20 Apr 2018 12:01:04 +0300 From: Dan Carpenter To: Lee Jones Cc: Jorge Eduardo Candelaria , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] mfd: tps65911-comparator: Fix an off by one bug Message-ID: <20180420090104.pwejjqdjh2d2jlv3@mwanda> References: <20180419134634.GA19793@mwanda> <20180420080943.jdbf7vtnkc33vbvd@dell> <20180420082150.u2oovqr4b4fd6vrq@mwanda> <20180420083909.66a6t63s5q6vpwp7@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180420083909.66a6t63s5q6vpwp7@dell> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8868 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=754 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804200090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 09:39:09AM +0100, Lee Jones wrote: > On Fri, 20 Apr 2018, Dan Carpenter wrote: > > > On Fri, Apr 20, 2018 at 09:09:43AM +0100, Lee Jones wrote: > > > On Thu, 19 Apr 2018, Dan Carpenter wrote: > > > > > > > The tps_comparators[] array is used in two places. We only access the > > > > COMP1 (1) and COMP2 (2) elements. Unfortunately, we're accessing the > > > > wrong elements and also one element beyond the end of the array. There > > > > was supposed to be a zero element at the start of the array which is > > > > isn't accessed but makes the math work out nicely. > > > > > > I normally just apply patches from you, but this is a hack, right? > > > > I liked it, I thought it was nice. It uses 32 bytes but any fix was > > going to use *some* memory. I don't have strong feelings about it > > though, if you want to write a different patch I can do that instead. > > #define COMP 0 > #define COMP1 1 > #define COMP2 2 > > It's unclear what the defines mean, but if COMP really does exist (is > there a datasheet for this device?) then your solution is a suitable > one. However, if there is a COMP, then why isn't it used? > > If it doesn't actually exist then this would be more appropriate > change I think: > > #define COMP1 0 > #define COMP2 1 > I hate to define something_one as zero... Let me send a different patch for this and see what you think. regards, dan carpenter