lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VetRjLioS1zAubZshggKTiWJ-KJ+HjTSkoK=6LVP6SY2g@mail.gmail.com>
Date:   Tue, 23 Jan 2018 11:25:05 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     David Lechner <david@...hnology.com>
Cc:     linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        Linux OMAP Mailing List <linux-omap@...r.kernel.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Tony Lindgren <tony@...mide.com>,
        Haojian Zhuang <haojian.zhuang@...aro.org>,
        Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH] pinctrl: pinctrl-single: Fix pcs_request_gpio() when
 bits_per_mux != 0

On Mon, Jan 22, 2018 at 7:06 PM, David Lechner <david@...hnology.com> wrote:
> On 01/22/2018 08:49 AM, Andy Shevchenko wrote:
>> On Mon, Jan 22, 2018 at 1:03 AM, David Lechner <david@...hnology.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?

>>> +                       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.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ