From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v5 07/33] clk: Add K210 clock support
Date: Wed, 4 Mar 2020 09:54:10 -0500 [thread overview]
Message-ID: <48181d64-8cd2-550a-d2d9-d3515345ae65@gmail.com> (raw)
In-Reply-To: <CAN5B=eJJj90rX4zbJyA+CB8y5n1ahL4d4yCAFEHwYpS_hE3QVw@mail.gmail.com>
On 3/4/20 1:58 AM, Rick Chen wrote:
> Hi Sean
>
>> Due to the large number of clocks, I decided to use the CCF. The overall
>> structure is modeled after the imx code. Clocks are stored in several
>> arrays. There are some translation macros (FOOIFY()) which allow for more
>> dense packing. A possible improvement could be to only store the
>> parameters we need, instead of the whole CCF struct.
>>
>> Signed-off-by: Sean Anderson <seanga2@gmail.com>
>> ---
>
> Please checkpatch and fix
> total: 4 errors, 4 warnings, 18 checks, 662 lines checked
>
> Thanks
> Rick
>
Here is the output of checkpatch
> drivers/clk/kendryte/clk.c:82: warning: static const char * array should probably be static const char * const
> drivers/clk/kendryte/clk.c:83: warning: static const char * array should probably be static const char * const
These arrays can't have both consts because it needs to have the actual
name of the in0 clock added.
> drivers/clk/kendryte/clk.c:122: check: Please use a blank line after function/struct/union/enum declarations
This is due to using macros in the style
#define FOO_LIST \
FOO(bar) \
FOO(baz)
#define FOO(x) FOO_##x,
enum foo_ids {
FOO_LIST
};
#undef FOO
I think sticking the undefinition of FOO immediately after the closing
enum bracket makes it clearer that FOO is only used with that definition
during the declaration of that enum. It is closing the scope, so to
speak. If you'd like I can add a newline after enums declared this way.
> drivers/clk/kendryte/clk.c:124: error: space prohibited before open square bracket '['
This is due to macros declared like
#define FOO(x) [FOO_##x] = { \
.y = (x), \
}
Where there is clearly a space before the [, but it is necessary for the
macro. I could declare it like
#define FOO(X) \
[FOO_##x] = { \
.y = (x), \
}
but I think that the former style is more elegant. However, this can
also be changed if needed.
> drivers/clk/kendryte/clk.c:133: check: Please use a blank line after function/struct/union/enum declarations
> drivers/clk/kendryte/clk.c:180: check: Please use a blank line after function/struct/union/enum declarations
> drivers/clk/kendryte/clk.c:182: error: space prohibited before open square bracket '['
> drivers/clk/kendryte/clk.c:189: check: Please use a blank line after function/struct/union/enum declarations
> drivers/clk/kendryte/clk.c:208: check: Please use a blank line after function/struct/union/enum declarations
> drivers/clk/kendryte/clk.c:210: error: space prohibited before open square bracket '['
> drivers/clk/kendryte/clk.c:210: check: Macro argument reuse 'parents' - possible side-effects?
No possible side-effects here, since this macro argument doesn't make
sense unless it is a compile-time constant.
> drivers/clk/kendryte/clk.c:220: check: Please use a blank line after function/struct/union/enum declarations
> drivers/clk/kendryte/clk.c:230: check: Please use a blank line after function/struct/union/enum declarations
> drivers/clk/kendryte/clk.c:235: check: Please use a blank line after function/struct/union/enum declarations
> drivers/clk/kendryte/clk.c:241: check: Macro argument reuse 'id' - possible side-effects?
> drivers/clk/kendryte/clk.c:249: check: Macro argument reuse 'id' - possible side-effects?
> drivers/clk/kendryte/clk.c:292: check: Please use a blank line after function/struct/union/enum declarations
> drivers/clk/kendryte/clk.c:306: check: Please use a blank line after function/struct/union/enum declarations
> drivers/clk/kendryte/clk.c:329: error: do not initialise statics to false
> drivers/clk/kendryte/clk.c:361: check: Macro argument reuse 'clocks' - possible side-effects?
> drivers/clk/kendryte/clk.c:386: warning: line over 80 characters
> drivers/clk/kendryte/clk.c:397: warning: line over 80 characters
Unfortunately, I don't see any way to keep these two lines under 80
characters without seriously sacrificing readability. For reference, the
lines look like
clk_dm(K210_CLK_PLL2,
clk_register_composite_struct("pll2", pll2_sels,
ARRAY_SIZE(pll2_sels),
&k210_clk_comps[COMPIFY(K210_CLK_PLL2)]));
The only way to further reduce the length would be to split the array
access over two lines, which I think harms readability too much.
> drivers/clk/kendryte/clk.c:399: check: Macro argument reuse 'id' - possible side-effects?
> drivers/clk/kendryte/clk.c:410: check: Macro argument reuse 'id' - possible side-effects?
> drivers/clk/kendryte/clk.c:438: check: Macro argument reuse 'id' - possible side-effects?
> drivers/clk/kendryte/clk.c:447: check: Macro argument reuse 'id' - possible side-effects?
> <unknown>:0: warning: DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.txt
> <unknown>:0: warning: DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.txt
AFAIK U-Boot has no such policy.
--Sean
next prev parent reply other threads:[~2020-03-04 14:54 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-28 21:05 [PATCH v5 00/33] riscv: Add Sipeed Maix support Sean Anderson
2020-02-28 21:05 ` [PATCH v5 01/33] clk: Always use the supplied struct clk Sean Anderson
2020-02-28 21:05 ` [PATCH v5 02/33] clk: Check that ops of composite clock components exist before calling Sean Anderson
2020-02-28 21:05 ` [PATCH v5 03/33] clk: Unconditionally recursively en-/dis-able clocks Sean Anderson
2020-03-04 6:50 ` Rick Chen
2020-02-28 21:05 ` [PATCH v5 04/33] clk: Add functions to register CCF clock structs Sean Anderson
2020-02-28 21:05 ` [PATCH v5 05/33] clk: Add K210 pll support Sean Anderson
2020-02-28 21:05 ` [PATCH v5 06/33] clk: Add a bypass clock for K210 Sean Anderson
2020-02-28 21:05 ` [PATCH v5 07/33] clk: Add K210 clock support Sean Anderson
2020-03-04 6:58 ` Rick Chen
2020-03-04 14:54 ` Sean Anderson [this message]
2020-02-28 21:05 ` [PATCH v5 08/33] doc: Fix typo in FIT documentation Sean Anderson
2020-03-02 2:21 ` Bin Meng
2020-02-28 21:05 ` [PATCH v5 09/33] dm: Add support for simple-pm-bus Sean Anderson
2020-02-28 21:05 ` [PATCH v5 10/33] dm: Fix error handling for dev_read_addr_ptr Sean Anderson
2020-03-02 2:22 ` Bin Meng
2020-03-02 19:46 ` Simon Glass
2020-02-28 21:05 ` [PATCH v5 11/33] reset: Add generic reset driver Sean Anderson
2020-02-28 21:05 ` [PATCH v5 12/33] lib: Always set errno in hcreate_r Sean Anderson
2020-03-02 2:24 ` Bin Meng
2020-02-28 21:05 ` [PATCH v5 13/33] pinctrl: Add support for Kendryte K210 FPIOA Sean Anderson
2020-03-04 6:47 ` Rick Chen
2020-03-04 15:00 ` Sean Anderson
2020-02-28 21:05 ` [PATCH v5 14/33] gpio: sifive: Use generic reg read function Sean Anderson
2020-03-02 2:24 ` Bin Meng
2020-02-28 21:05 ` [PATCH v5 15/33] gpio: dw: Fix warnings about casting int to pointer Sean Anderson
2020-03-02 2:27 ` Bin Meng
2020-03-02 3:50 ` Sean Anderson
2020-02-28 21:05 ` [PATCH v5 16/33] gpio: dw: Add a trailing underscore to generated name Sean Anderson
2020-02-28 21:05 ` [PATCH v5 17/33] gpio: dw: Return output value when direction is out Sean Anderson
2020-02-28 21:05 ` [PATCH v5 18/33] led: gpio: Default to using node name if label is absent Sean Anderson
2020-02-28 21:05 ` [PATCH v5 19/33] spi: dw: Add device tree properties for fields in CTRL1 Sean Anderson
2020-03-04 6:15 ` Rick Chen
2020-03-04 15:01 ` Sean Anderson
2020-02-28 21:05 ` [PATCH v5 20/33] spi: dw: Rename "cs-gpio" to "cs-gpios" Sean Anderson
2020-02-28 21:05 ` [PATCH v5 21/33] spi: dw: Use generic function to read reg address Sean Anderson
2020-02-28 21:05 ` [PATCH v5 22/33] spi: dw: Speed up transfer loops Sean Anderson
2020-02-28 21:05 ` [PATCH v5 23/33] spi: dw: Properly set rx_end when not recieving Sean Anderson
2020-02-29 17:47 ` Sean Anderson
2020-02-28 21:05 ` [PATCH v5 24/33] spi: dw: Add mem_ops Sean Anderson
2020-02-28 21:05 ` [PATCH v5 25/33] wdt: Move asm/utils.h to log2.h Sean Anderson
2020-02-28 21:46 ` Marek Vasut
2020-02-28 22:43 ` Sean Anderson
2020-02-28 23:27 ` Marek Vasut
2020-03-03 6:58 ` Rick Chen
2020-03-03 14:11 ` Sean Anderson
2020-02-28 21:05 ` [PATCH v5 26/33] riscv: Add headers for asm/global_data.h Sean Anderson
2020-02-28 21:05 ` [PATCH v5 27/33] riscv: Fix race conditions when initializing IPI Sean Anderson
2020-03-02 9:08 ` Rick Chen
2020-03-02 15:43 ` Sean Anderson
2020-03-02 23:15 ` Lukas Auer
2020-03-03 8:27 ` Rick Chen
2020-03-05 2:18 ` Rick Chen
2020-03-02 23:17 ` Lukas Auer
2020-03-02 23:43 ` Sean Anderson
2020-03-03 21:53 ` Lukas Auer
2020-03-03 21:57 ` Sean Anderson
2020-03-04 15:25 ` Lukas Auer
2020-02-28 21:05 ` [PATCH v5 28/33] riscv: Add option to support RISC-V privileged spec 1.9 Sean Anderson
2020-03-04 6:20 ` Rick Chen
2020-02-28 21:05 ` [PATCH v5 29/33] riscv: Allow use of reset drivers Sean Anderson
2020-02-28 21:05 ` [PATCH v5 30/33] riscv: Try to get cpu frequency from a "clocks" node if it exists Sean Anderson
2020-02-28 21:05 ` [PATCH v5 31/33] riscv: Enable cpu clock if it is present Sean Anderson
2020-02-28 21:05 ` [PATCH v5 32/33] riscv: Add device tree for K210 and Sipeed Maix BitM Sean Anderson
2020-02-28 21:05 ` [PATCH v5 33/33] riscv: Add Sipeed Maix support Sean Anderson
2020-03-04 6:04 ` Rick Chen
2020-03-04 7:47 ` Rick Chen
2020-03-04 15:11 ` Sean Anderson
2020-03-05 3:40 ` Bin Meng
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=48181d64-8cd2-550a-d2d9-d3515345ae65@gmail.com \
--to=seanga2@gmail.com \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox