Received: by 10.192.165.148 with SMTP id m20csp435162imm; Fri, 20 Apr 2018 01:40:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx49fdK8WNCrJbmC85A1jQo47TI20NZC/RXYf+6mugG9HauVBz5oxzGdBwfvIxejRgxMXWJH9 X-Received: by 10.167.130.151 with SMTP id s23mr8878073pfm.106.1524213629869; Fri, 20 Apr 2018 01:40:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524213629; cv=none; d=google.com; s=arc-20160816; b=j+L08gXx2k5TTe9OwGqhOSgjzIwszC7aDGEpmJRVr+Lodj8118T/tfZcEbdGtehxUC tP14LNkThiUVRb05453FbVLm8GVYX30zAjzJ4+6COogQSRJRQWJJgcTr2c8qjbLOx7HF ZPDwjd1MSXjUI+oI8HyoVWH0Vv00FwnouziFRryDI0OwoBV7nixdIDxgatcEWW4rXS36 0vlZjE+aB0jVBcUVhFm+OFsWt7Q37VNOLUTxVrd2HbuAshVB9NEtGmMba3ApFRxT6gRU hly7V4iwaT1j0QZdH6BN4xTU+3zdRX9a1FtjSRvKhJ8OFVmflmOmpFsEcX/8ZXe7mlYk +NmA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Mw1PMbCVe48HUyjoHwN7irSCUhCbtR+2sg87uh1QtiM=; b=Od3TigcfWoP0/OdQ67HBmrpsvpk0u/T9Dl5hGgcJ9MWTEYvefABeiBKElI3lHsqnUo yeDcT78RyxR8alE0lhMfbQC85narb3EHo2k5kcOEB6q+lYuTQax6jMnq21jF/aWzmIx5 VNNqKQDixi8UJ6eRW78NdbxNGNKcGojBARivkPrrSej40J/VNv2MT/hpj6LZwdtsfzwj lAk4bCEgOtVX5NzVWd5WH1UUvxBtS2K0bhZKt3Tl1cshd6S+izAtZU7/MAsZpaG6Qfbq cZaU4TYw6EJBOvQtzVW8OCUFx3UmLCVUTkzBGgHqO6AW5z7ENzW7t9xp3s3kmmHzVjJI EmaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WUFJg92T; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p85si5008423pfk.77.2018.04.20.01.40.15; Fri, 20 Apr 2018 01:40:29 -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=@linaro.org header.s=google header.b=WUFJg92T; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754149AbeDTIjP (ORCPT + 99 others); Fri, 20 Apr 2018 04:39:15 -0400 Received: from mail-wr0-f181.google.com ([209.85.128.181]:43945 "EHLO mail-wr0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753918AbeDTIjN (ORCPT ); Fri, 20 Apr 2018 04:39:13 -0400 Received: by mail-wr0-f181.google.com with SMTP id v15-v6so2664870wrm.10 for ; Fri, 20 Apr 2018 01:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Mw1PMbCVe48HUyjoHwN7irSCUhCbtR+2sg87uh1QtiM=; b=WUFJg92T3jCnEVEKNJAnMbRzuaM36MtbtRrf/SGQeLvMrBPLUAqWCFNBPx94zmIa52 nt+8PyYUinxj9h1fP/Ms/w5tNm4CcMZVtlc+dollRBizYpl+yiMP8bItDfsvxRvD6X+C CdH6fAbLVY4C8/g/9f1WzPlXO7a+QTJ+IpUx4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Mw1PMbCVe48HUyjoHwN7irSCUhCbtR+2sg87uh1QtiM=; b=n5ZtWyVSNZ9j6ED73bY0J8zWYO1JarYz++A5TUZQXjzWvzQpppCEbOwN4Yw5XRDfFl d3u0X1eXtlzinOgkpuVxg7C3cm4FxJQfh4h3I+mrlmSJQtbJQwFuUt5wMo0iTaVIJFo3 XWk5O6Gjg6/AaIYP4RGlqw+TJUYGGX8LDOPDgF/dfDED7AzVgO8hyl+WgSXvIt3nFiIi k1H0+FiMRaoCyb3sv0XcPlSu+q+3j9iq3SPbaCcSxj6KlsMambsrtgiBjUhUodidSHtI EXlZB9/rQ7VAGqZ2u2LyrRlC9k/+LXkM89+a1PDo76hAdJSKubL7u8GYFZte+/YZBIH6 KeFA== X-Gm-Message-State: ALQs6tAv/ETL/o/2g13gftqQnA3+KYnio748J65j/DA069WDNf/pcRs3 Isl7K/tAxnGLStmrIu6PMMmjuKMha4U= X-Received: by 10.28.28.85 with SMTP id c82mr1314503wmc.69.1524213552195; Fri, 20 Apr 2018 01:39:12 -0700 (PDT) Received: from dell ([2.27.167.70]) by smtp.gmail.com with ESMTPSA id d28sm2467478wmh.29.2018.04.20.01.39.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Apr 2018 01:39:11 -0700 (PDT) Date: Fri, 20 Apr 2018 09:39:09 +0100 From: Lee Jones To: Dan Carpenter 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: <20180420083909.66a6t63s5q6vpwp7@dell> References: <20180419134634.GA19793@mwanda> <20180420080943.jdbf7vtnkc33vbvd@dell> <20180420082150.u2oovqr4b4fd6vrq@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180420082150.u2oovqr4b4fd6vrq@mwanda> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog