All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: David Lechner <david@lechnology.com>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] pinctrl: pinctrl-single: Fix pcs_request_gpio() when bits_per_mux != 0
Date: Tue, 23 Jan 2018 09:45:19 -0800	[thread overview]
Message-ID: <20180123174519.GF4180@atomide.com> (raw)
In-Reply-To: <CAHp75VetRjLioS1zAubZshggKTiWJ-KJ+HjTSkoK=6LVP6SY2g@mail.gmail.com>

* Andy Shevchenko <andy.shevchenko@gmail.com> [180123 09:25]:
> On Mon, Jan 22, 2018 at 7:06 PM, David Lechner <david@lechnology.com> wrote:
> > On 01/22/2018 08:49 AM, Andy Shevchenko wrote:
> >> On Mon, Jan 22, 2018 at 1:03 AM, David Lechner <david@lechnology.com>
> >> wrote:
> 
> >>> Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure
> >>> multiple pins of different modules")
> 
> >> One line?
> 
> > One line is more important that wrapping to 75 chars?
> 
> It's *special* line, i.e. tag. Tag per line is a rule I know, did I
> miss any new change to that?

I think the rule for merge commits is to try to limit them to 75
characters for git log.

> >>> +                       byte_num = (pcs->bits_per_pin * pin) /
> >>> BITS_PER_BYTE;
> >>> +                       offset = (byte_num / mux_bytes) * mux_bytes;
> >>> +                       pin_shift = pin % (pcs->width /
> >>> pcs->bits_per_pin) *
> >>> +                                   pcs->bits_per_pin;
> 
> >> Sounds like playing around pretty well defined macro and functions,
> >> e.g. DIV_ROUND_UP(), round_up().
> 
> > I admit, I just copied existing code (which may be a reason to leave this
> > the
> > way it is).
> 
> Ah, fair enough.
> 
> >  But, I only see once place to do this:
> >
> >         offset = round_down(byte_num, mux_bytes);
> >
> > Did I miss another?
> 
> I meant that you may use macros to make code cleaner. Though, taking
> above into consideration, it would be done as a separate patch later.

Yeah makes sense to me to do them separately. It would be good to
get Haojian's ack or tested-by on this one, I don't think I have
hardware where I can test the GPIO features with this driver.

Regards,

Tony

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: pinctrl-single: Fix pcs_request_gpio() when bits_per_mux != 0
Date: Tue, 23 Jan 2018 09:45:19 -0800	[thread overview]
Message-ID: <20180123174519.GF4180@atomide.com> (raw)
In-Reply-To: <CAHp75VetRjLioS1zAubZshggKTiWJ-KJ+HjTSkoK=6LVP6SY2g@mail.gmail.com>

* Andy Shevchenko <andy.shevchenko@gmail.com> [180123 09:25]:
> On Mon, Jan 22, 2018 at 7:06 PM, David Lechner <david@lechnology.com> wrote:
> > On 01/22/2018 08:49 AM, Andy Shevchenko wrote:
> >> On Mon, Jan 22, 2018 at 1:03 AM, David Lechner <david@lechnology.com>
> >> wrote:
> 
> >>> Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure
> >>> multiple pins of different modules")
> 
> >> One line?
> 
> > One line is more important that wrapping to 75 chars?
> 
> It's *special* line, i.e. tag. Tag per line is a rule I know, did I
> miss any new change to that?

I think the rule for merge commits is to try to limit them to 75
characters for git log.

> >>> +                       byte_num = (pcs->bits_per_pin * pin) /
> >>> BITS_PER_BYTE;
> >>> +                       offset = (byte_num / mux_bytes) * mux_bytes;
> >>> +                       pin_shift = pin % (pcs->width /
> >>> pcs->bits_per_pin) *
> >>> +                                   pcs->bits_per_pin;
> 
> >> Sounds like playing around pretty well defined macro and functions,
> >> e.g. DIV_ROUND_UP(), round_up().
> 
> > I admit, I just copied existing code (which may be a reason to leave this
> > the
> > way it is).
> 
> Ah, fair enough.
> 
> >  But, I only see once place to do this:
> >
> >         offset = round_down(byte_num, mux_bytes);
> >
> > Did I miss another?
> 
> I meant that you may use macros to make code cleaner. Though, taking
> above into consideration, it would be done as a separate patch later.

Yeah makes sense to me to do them separately. It would be good to
get Haojian's ack or tested-by on this one, I don't think I have
hardware where I can test the GPIO features with this driver.

Regards,

Tony

  reply	other threads:[~2018-01-23 17:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-21 23:03 [PATCH] pinctrl: pinctrl-single: Fix pcs_request_gpio() when bits_per_mux != 0 David Lechner
2018-01-21 23:03 ` David Lechner
2018-01-21 23:03 ` David Lechner
2018-01-22 14:49 ` Andy Shevchenko
2018-01-22 14:49   ` Andy Shevchenko
2018-01-22 14:49   ` Andy Shevchenko
2018-01-22 17:06   ` David Lechner
2018-01-22 17:06     ` David Lechner
2018-01-23  9:25     ` Andy Shevchenko
2018-01-23  9:25       ` Andy Shevchenko
2018-01-23 17:45       ` Tony Lindgren [this message]
2018-01-23 17:45         ` Tony Lindgren

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=20180123174519.GF4180@atomide.com \
    --to=tony@atomide.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=david@lechnology.com \
    --cc=haojian.zhuang@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.