LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mfd: tps65911-comparator: Fix an off by one bug
Date: Fri, 20 Apr 2018 12:01:04 +0300	[thread overview]
Message-ID: <20180420090104.pwejjqdjh2d2jlv3@mwanda> (raw)
In-Reply-To: <20180420083909.66a6t63s5q6vpwp7@dell>

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

  reply	other threads:[~2018-04-20  9:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 13:46 Dan Carpenter
2018-04-20  8:09 ` Lee Jones
2018-04-20  8:21   ` Dan Carpenter
2018-04-20  8:24     ` Dan Carpenter
2018-04-20  8:39     ` Lee Jones
2018-04-20  9:01       ` Dan Carpenter [this message]
2018-04-23  6:26         ` Lee Jones
2018-04-20  9:09       ` [PATCH v2] " Dan Carpenter
2018-04-23  6:44         ` Lee Jones
2018-04-23 10:27           ` Dan Carpenter
2018-04-24  5:45             ` Lee Jones
2018-04-20  8:59 ` [PATCH] " Dan Carpenter
2018-04-20  9:21   ` [PATCH] mfd: tps65911-comparator: Fix a build error Dan Carpenter
2018-04-23 18:13     ` Rhyland Klein
2018-04-24  5:46     ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180420090104.pwejjqdjh2d2jlv3@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=jedu@slimlogic.co.uk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] mfd: tps65911-comparator: Fix an off by one bug' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).