Received: by 10.192.165.148 with SMTP id m20csp3075271imm; Sun, 22 Apr 2018 23:28:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx48iGx0EXYu+CQ9uZN9Qj28m77qU8Yh2X6g9AcrXQzoCbFHB0C/rj3eO3eejBJW4hVvEyGtg X-Received: by 10.101.71.132 with SMTP id e4mr13002785pgs.196.1524464902711; Sun, 22 Apr 2018 23:28:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524464902; cv=none; d=google.com; s=arc-20160816; b=Bu0FQOmnlQiNcA/nqh/eotUYLt7V1/pZE1JAaxO8r8Y9m2349r/6NH1nkKkaA4tYX2 4OCUC8/9vJU4fhzguqUQhFN+rTZV/ip47Y/ac4NcJQ7pxmTuRRETrrjdUFlVXVq0ylEM Yz7CVRgzfgQ1H6P5qKyv16s9jFM8S3UBOZyxeZQAXSfzs/ZBX+D8q+IF3w5vSfUqI3hX PBqri3PvaRo+q0mpxsyuBo7aV2M1F+9aFaBTfcMm+BQ/kebQ7NNZ3HFNpvnvRyOetVCt MhoNxjjtNECWPGY9eeRXv4wURRAuKc3pAclrOlazVoJwtEUdT3N013kc83SI8pv9ugG/ jCww== 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=TyOAhBOx28znOrTKj561i8eOqv5F+FLsdGHyX6owc0o=; b=tzKzbX5tdPzU4KB8VTqzye+LZqfgMFrRyKcXAtX1XoFQ58dQOP7aZaAmHxkMvL4pUv lHYj93bE3sYGQSMBfZXOgHS+XAn3UEc+AwgH0naHQgrzwvPa9DHJnsCnu63OSMXBCXeo kQ3i3Cm+OrAWGJqdBv1GeF6VPRu0issAqsWIWqVmfnaQ1iZIGDLJyLIT2WrnGq9p8tVY AqjbCPcBMIYCLu36gihIiWGCY+fIH9910tx6npneUMl9yP1TkH3yQAHCpQ6ngxn3tq+A Avh5WjGIl0BGDl2O9KW/dQ4FBnQHQAt259mWAk8MCQWgvk1SgElbmV4diAMCHjYJjfY6 7CFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkSlI2kL; 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 n1-v6si11018887pld.280.2018.04.22.23.28.07; Sun, 22 Apr 2018 23:28:22 -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=kkSlI2kL; 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 S1751510AbeDWG04 (ORCPT + 99 others); Mon, 23 Apr 2018 02:26:56 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:34831 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318AbeDWG0y (ORCPT ); Mon, 23 Apr 2018 02:26:54 -0400 Received: by mail-wr0-f172.google.com with SMTP id w3-v6so37785289wrg.2 for ; Sun, 22 Apr 2018 23:26:54 -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=TyOAhBOx28znOrTKj561i8eOqv5F+FLsdGHyX6owc0o=; b=kkSlI2kLDQtaZ3osCgmWuXtvnyWpK5a5j9HMhiWLaIGuWX0O1e0oETerVTFpaQU8v+ q8N4bI05LTc1/dNOMP4tmD9Tk7GmfJCoTyBgV6EDDZQshB2mHKlG4hN96aYoO0BnekZI m2t6Z7ApNq9aKdU2JvcA0bXgzfO99VQNzUAss= 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=TyOAhBOx28znOrTKj561i8eOqv5F+FLsdGHyX6owc0o=; b=IbUmBqco3CpR/FB0nQiqK5KoYAucat5saMwEAhFRnZZCxIcxSwjdPOrF2eJFd3M56u GIlpnRpfY24fSX5G6/e7w/TLPcEulKTl2wzrWnbjbDrlYMT800JXL0v5uhb+k1GqfpKi MCh9uZ210hyEY5Z/464c6vRua1+r1BIxr4+KD5R18d2ip1LdEpAyFLLBHsYZYQE+ab3X vwyqgYX5TzEZ989bOxiWoEHq6VXd9kPPE/BHMJQcpycUzJVWxO1tAiJB1p+n2pQ0wfMw PCT6cHfuYZaqxuv9HqRAMUJhaQZe5SnHYNr+gCz34XXpb464VUOMeA+wWSbc3eaWpB5T qWBg== X-Gm-Message-State: ALQs6tCZIb3JiRw+kC06WFYdOMejl1DzUjKOm72X/kXrqCtGU8oi9Sz+ NzXuLlOJmWTfPBuQa6a8jDZJBSOcsY0= X-Received: by 10.80.235.148 with SMTP id y20mr11152581edr.185.1524464813610; Sun, 22 Apr 2018 23:26:53 -0700 (PDT) Received: from dell ([2.27.167.55]) by smtp.gmail.com with ESMTPSA id f5sm6826120edb.86.2018.04.22.23.26.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Apr 2018 23:26:52 -0700 (PDT) Date: Mon, 23 Apr 2018 07:26:51 +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: <20180423062651.wynt5ybgo2bhcz6g@dell> References: <20180419134634.GA19793@mwanda> <20180420080943.jdbf7vtnkc33vbvd@dell> <20180420082150.u2oovqr4b4fd6vrq@mwanda> <20180420083909.66a6t63s5q6vpwp7@dell> <20180420090104.pwejjqdjh2d2jlv3@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180420090104.pwejjqdjh2d2jlv3@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: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. I guess that's the call of the hardware engineer/datasheet author? -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog