[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vd6Ok6i3wQjT=jd3mtFAC2na1vwUs2cr-xhStQ_OjKjAg@mail.gmail.com>
Date: Wed, 25 Jul 2018 19:56:35 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Vitor Soares <Vitor.Soares@...opsys.com>
Cc: Boris Brezillon <boris.brezillon@...tlin.com>,
Wolfram Sang <wsa@...-dreams.de>,
linux-i2c <linux-i2c@...r.kernel.org>,
Jonathan Corbet <corbet@....net>,
Linux Documentation List <linux-doc@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...db.de>,
Przemyslaw Sroka <psroka@...ence.com>,
Arkadiusz Golec <agolec@...ence.com>,
Alan Douglas <adouglas@...ence.com>,
Bartosz Folta <bfolta@...ence.com>,
Damian Kos <dkos@...ence.com>,
Alicja Jurasik-Urbaniak <alicja@...ence.com>,
Cyprian Wronka <cwronka@...ence.com>,
Suresh Punnoose <sureshp@...ence.com>,
Rafal Ciepiela <rafalc@...ence.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Nishanth Menon <nm@...com>, Rob Herring <robh+dt@...nel.org>,
Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
"ijc+devicetree" <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
devicetree <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Linus Walleij <linus.walleij@...aro.org>,
Xiang Lin <Xiang.Lin@...aptics.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Sekhar Nori <nsekhar@...com>,
Przemyslaw Gaj <pgaj@...ence.com>,
Peter Rosin <peda@...ntia.se>,
Joao Pinto <Joao.Pinto@...opsys.com>
Subject: Re: [PATCH 1/3] i3c: master: Add driver for Synopsys DesignWare IP
On Wed, Jul 25, 2018 at 11:43 AM, Vitor Soares
<Vitor.Soares@...opsys.com> wrote:
> On Fri, Jul 20, 2018 at 11:57 PM, Vitor soares
> <Vitor.Soares@...opsys.com> wrote:
>
Thanks for answers, my comments below.
> This patch add driver for Synopsys DesignWare IP on top of
> I3C subsystem patchset proposal V6
...
> +#include <linux/reset.h>
> Reset API.
>
> All of them required? Why?
Thanks, got it.
> There is some header files that are already included by others header files.
> Should I add them too? it there any rule for that?
No need.
Usually we drop some "wired" headers (when we sure that one will
always include the other one, like module.h vs. init.h)
> + writel(cmd->cmd_hi, master->regs + COMMAND_QUEUE_PORT);
> + writel(cmd->cmd_lo, master->regs + COMMAND_QUEUE_PORT);
>
> hmm... writesl()?
> Is there any advantage here?
Here maybe not. Just a material to think about. If you can refactor
code to utilize them, good.
> + info->pid = (u64)readl(master->regs + SLV_PID_VALUE);
>
> Why explicit casting?
> info->pid is u64 size.
In C standard there is an integer promotion which allows you not to
use explicit casting in such cases.
> + u32 r;
> +
> +
> + core_rate = clk_get_rate(master->core_clk);
>
> Too many blank lines in between.
>
>
> For me in that way it's better to filter code parts. Do you think that is
> not readable?
The point is it's useless.
On the other hand, you have a lot of inconsistency with that style.
> + p = (ret >> 6) ^ (ret >> 5) ^ (ret >> 4) ^ (ret >> 3) ^
> + (ret >> 2) ^ (ret >> 1) ^ ret ^ 1;
> + p = p & 1;
>
> Is it parity calculus? Do we have something implemented in kernel already?
>
> Btw,
> https://urldefense.proofpoint.com/v2/url?u=https-3A__graphics.stanford.edu_-7Eseander_bithacks.html-23ParityNaive&d=DwIBaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=qVuU64u9x77Y0Kd0PhDK_lpxFgg6PK9PateHwjb_DY0&m=5FpGHBbT8tYA6PB4RT_9O6PJk3v-wYcy1MV59xoqK4I&s=FSJ3EcuoxPtRJWmsk9Yt4s_UH9kxFBam01Xvas2ZFdo&e=
> offered this
>
> v ^= v >> 4;
> v &= 0xf;
> v = (0x6996 >> v) & 1;
>
>
> I search into the kernel and I didn't find any function for that. In your
> opinion what shoud I use?
If license of the piece above is okay to use in kernel, then
definitely it would be better (even we might create a helper out of
it).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists