* [PATCH v4 0/5] clk drivers: Terminate clk_div_table with sentinel element
@ 2022-02-18 0:09 Jonathan Neuschäfer
2022-02-18 0:09 ` [PATCH v4 1/5] clk: actions: " Jonathan Neuschäfer
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Jonathan Neuschäfer @ 2022-02-18 0:09 UTC (permalink / raw)
To: linux-clk
Cc: linux-kernel, linux-arm-kernel, linux-mips,
Philippe Mathieu-Daudé, Jonathan Neuschäfer
I noticed that some of the clk_div_tables in different drivers are not
terminated with a sentinel element. This may cause the code in
clk-divider.c to read garbage that happens to be beyond the end.
This patchset fixed all instances of this bug that I could find, except
for a case in drivers/phy/ti/phy-j721e-wiz.c that is already fixed in
linux-next:
https://lore.kernel.org/lkml/20220117110108.4117-1-kishon@ti.com/
In this version of the patchset, I addressed Philippe Mathieu-Daudé's
style comments. As far as I found it reasonable, I simply updated the
existing patches, but in the case of the Actions Semiconductor drivers,
I made a bigger cleanup in a separate patch.
v4:
- Various style fixes
v3:
- Change the Actions patch according to Mani's comment
v2:
- Add Fixes tags
Jonathan Neuschäfer (5):
clk: actions: Terminate clk_div_table with sentinel element
clk: loongson1: Terminate clk_div_table with sentinel element
clk: hisilicon: Terminate clk_div_table with sentinel element
clk: clps711x: Terminate clk_div_table with sentinel element
clk: actions: Make sentinel elements more obvious
drivers/clk/actions/owl-s500.c | 16 ++++++++--------
drivers/clk/actions/owl-s700.c | 17 ++++++++++-------
drivers/clk/actions/owl-s900.c | 26 +++++++++++++-------------
drivers/clk/clk-clps711x.c | 2 ++
drivers/clk/hisilicon/clk-hi3559a.c | 4 ++--
drivers/clk/loongson1/clk-loongson1c.c | 1 +
6 files changed, 36 insertions(+), 30 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v4 1/5] clk: actions: Terminate clk_div_table with sentinel element 2022-02-18 0:09 [PATCH v4 0/5] clk drivers: Terminate clk_div_table with sentinel element Jonathan Neuschäfer @ 2022-02-18 0:09 ` Jonathan Neuschäfer 2022-03-12 2:16 ` Stephen Boyd 2022-02-18 0:09 ` [PATCH v4 2/5] clk: loongson1: " Jonathan Neuschäfer ` (3 subsequent siblings) 4 siblings, 1 reply; 11+ messages in thread From: Jonathan Neuschäfer @ 2022-02-18 0:09 UTC (permalink / raw) To: linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Manivannan Sadhasivam, Michael Turquette, Stephen Boyd, Andreas Färber, Saravanan Sekar, Parthiban Nallathambi, linux-actions In order that the end of a clk_div_table can be detected, it must be terminated with a sentinel element (.div = 0). In owl-s900.s, the { 0, 8 } element was probably meant to be just that, so this patch changes { 0, 8 } to { 0, 0 }. Fixes: d47317ca4ade1 ("clk: actions: Add S700 SoC clock support") Fixes: d85d20053e195 ("clk: actions: Add S900 SoC clock support") Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> --- v4: - Remove trailing commas v3: - Interpret { 0, 8 } as a typo of { 0, 0 }, the sentinel element - Add R-b tag v2: - Add Fixes tags --- drivers/clk/actions/owl-s700.c | 1 + drivers/clk/actions/owl-s900.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/actions/owl-s700.c b/drivers/clk/actions/owl-s700.c index a2f34d13fb543..6ea7da1d6d755 100644 --- a/drivers/clk/actions/owl-s700.c +++ b/drivers/clk/actions/owl-s700.c @@ -162,6 +162,7 @@ static struct clk_div_table hdmia_div_table[] = { static struct clk_div_table rmii_div_table[] = { {0, 4}, {1, 10}, + {0, 0} }; /* divider clocks */ diff --git a/drivers/clk/actions/owl-s900.c b/drivers/clk/actions/owl-s900.c index 790890978424a..5144ada2c7e1a 100644 --- a/drivers/clk/actions/owl-s900.c +++ b/drivers/clk/actions/owl-s900.c @@ -140,7 +140,7 @@ static struct clk_div_table rmii_ref_div_table[] = { static struct clk_div_table usb3_mac_div_table[] = { { 1, 2 }, { 2, 3 }, { 3, 4 }, - { 0, 8 }, + { 0, 0 } }; static struct clk_div_table i2s_div_table[] = { -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 1/5] clk: actions: Terminate clk_div_table with sentinel element 2022-02-18 0:09 ` [PATCH v4 1/5] clk: actions: " Jonathan Neuschäfer @ 2022-03-12 2:16 ` Stephen Boyd 0 siblings, 0 replies; 11+ messages in thread From: Stephen Boyd @ 2022-03-12 2:16 UTC (permalink / raw) To: Jonathan Neuschäfer, linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Manivannan Sadhasivam, Michael Turquette, Andreas Färber, Saravanan Sekar, Parthiban Nallathambi, linux-actions Quoting Jonathan Neuschäfer (2022-02-17 16:09:17) > In order that the end of a clk_div_table can be detected, it must be > terminated with a sentinel element (.div = 0). > > In owl-s900.s, the { 0, 8 } element was probably meant to be just that, > so this patch changes { 0, 8 } to { 0, 0 }. > > Fixes: d47317ca4ade1 ("clk: actions: Add S700 SoC clock support") > Fixes: d85d20053e195 ("clk: actions: Add S900 SoC clock support") > Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> > Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> > --- Applied to clk-next ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 2/5] clk: loongson1: Terminate clk_div_table with sentinel element 2022-02-18 0:09 [PATCH v4 0/5] clk drivers: Terminate clk_div_table with sentinel element Jonathan Neuschäfer 2022-02-18 0:09 ` [PATCH v4 1/5] clk: actions: " Jonathan Neuschäfer @ 2022-02-18 0:09 ` Jonathan Neuschäfer 2022-03-12 2:16 ` Stephen Boyd 2022-02-18 0:09 ` [PATCH v4 3/5] clk: hisilicon: " Jonathan Neuschäfer ` (2 subsequent siblings) 4 siblings, 1 reply; 11+ messages in thread From: Jonathan Neuschäfer @ 2022-02-18 0:09 UTC (permalink / raw) To: linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Keguang Zhang, Michael Turquette, Stephen Boyd, Yang Ling In order that the end of a clk_div_table can be detected, it must be terminated with a sentinel element (.div = 0). Fixes: b4626a7f4892 ("CLK: Add Loongson1C clock support") Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- v4: - remove trailing comma v3: - no changes v2: - Add Fixes and R-b tags --- drivers/clk/loongson1/clk-loongson1c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/loongson1/clk-loongson1c.c b/drivers/clk/loongson1/clk-loongson1c.c index 703f87622cf5f..1ebf740380efb 100644 --- a/drivers/clk/loongson1/clk-loongson1c.c +++ b/drivers/clk/loongson1/clk-loongson1c.c @@ -37,6 +37,7 @@ static const struct clk_div_table ahb_div_table[] = { [1] = { .val = 1, .div = 4 }, [2] = { .val = 2, .div = 3 }, [3] = { .val = 3, .div = 3 }, + [4] = { /* sentinel */ } }; void __init ls1x_clk_init(void) -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/5] clk: loongson1: Terminate clk_div_table with sentinel element 2022-02-18 0:09 ` [PATCH v4 2/5] clk: loongson1: " Jonathan Neuschäfer @ 2022-03-12 2:16 ` Stephen Boyd 0 siblings, 0 replies; 11+ messages in thread From: Stephen Boyd @ 2022-03-12 2:16 UTC (permalink / raw) To: Jonathan Neuschäfer, linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Keguang Zhang, Michael Turquette, Yang Ling Quoting Jonathan Neuschäfer (2022-02-17 16:09:18) > In order that the end of a clk_div_table can be detected, it must be > terminated with a sentinel element (.div = 0). > > Fixes: b4626a7f4892 ("CLK: Add Loongson1C clock support") > Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- Applied to clk-next ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 3/5] clk: hisilicon: Terminate clk_div_table with sentinel element 2022-02-18 0:09 [PATCH v4 0/5] clk drivers: Terminate clk_div_table with sentinel element Jonathan Neuschäfer 2022-02-18 0:09 ` [PATCH v4 1/5] clk: actions: " Jonathan Neuschäfer 2022-02-18 0:09 ` [PATCH v4 2/5] clk: loongson1: " Jonathan Neuschäfer @ 2022-02-18 0:09 ` Jonathan Neuschäfer 2022-03-12 2:16 ` Stephen Boyd 2022-02-18 0:09 ` [PATCH v4 4/5] clk: clps711x: " Jonathan Neuschäfer 2022-02-18 0:09 ` [PATCH v4 5/5] clk: actions: Make sentinel elements more obvious Jonathan Neuschäfer 4 siblings, 1 reply; 11+ messages in thread From: Jonathan Neuschäfer @ 2022-02-18 0:09 UTC (permalink / raw) To: linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Michael Turquette, Stephen Boyd, Dongjiu Geng In order that the end of a clk_div_table can be detected, it must be terminated with a sentinel element (.div = 0). Fixes: 6c81966107dc0 ("clk: hisilicon: Add clock driver for hi3559A SoC") Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> --- v4: - add /* sentinel */ comment into sentinel element v3: - no changes v2: - Add Fixes tag --- drivers/clk/hisilicon/clk-hi3559a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/hisilicon/clk-hi3559a.c b/drivers/clk/hisilicon/clk-hi3559a.c index 56012a3d02192..9ea1a80acbe8b 100644 --- a/drivers/clk/hisilicon/clk-hi3559a.c +++ b/drivers/clk/hisilicon/clk-hi3559a.c @@ -611,8 +611,8 @@ static struct hisi_mux_clock hi3559av100_shub_mux_clks[] = { /* shub div clk */ -static struct clk_div_table shub_spi_clk_table[] = {{0, 8}, {1, 4}, {2, 2}}; -static struct clk_div_table shub_uart_div_clk_table[] = {{1, 8}, {2, 4}}; +static struct clk_div_table shub_spi_clk_table[] = {{0, 8}, {1, 4}, {2, 2}, {/*sentinel*/}}; +static struct clk_div_table shub_uart_div_clk_table[] = {{1, 8}, {2, 4}, {/*sentinel*/}}; static struct hisi_divider_clock hi3559av100_shub_div_clks[] = { { HI3559AV100_SHUB_SPI_SOURCE_CLK, "clk_spi_clk", "shub_clk", 0, 0x20, 24, 2, -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 3/5] clk: hisilicon: Terminate clk_div_table with sentinel element 2022-02-18 0:09 ` [PATCH v4 3/5] clk: hisilicon: " Jonathan Neuschäfer @ 2022-03-12 2:16 ` Stephen Boyd 0 siblings, 0 replies; 11+ messages in thread From: Stephen Boyd @ 2022-03-12 2:16 UTC (permalink / raw) To: Jonathan Neuschäfer, linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Michael Turquette, Dongjiu Geng Quoting Jonathan Neuschäfer (2022-02-17 16:09:19) > In order that the end of a clk_div_table can be detected, it must be > terminated with a sentinel element (.div = 0). > > Fixes: 6c81966107dc0 ("clk: hisilicon: Add clock driver for hi3559A SoC") > Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> > --- Applied to clk-next ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 4/5] clk: clps711x: Terminate clk_div_table with sentinel element 2022-02-18 0:09 [PATCH v4 0/5] clk drivers: Terminate clk_div_table with sentinel element Jonathan Neuschäfer ` (2 preceding siblings ...) 2022-02-18 0:09 ` [PATCH v4 3/5] clk: hisilicon: " Jonathan Neuschäfer @ 2022-02-18 0:09 ` Jonathan Neuschäfer 2022-03-12 2:16 ` Stephen Boyd 2022-02-18 0:09 ` [PATCH v4 5/5] clk: actions: Make sentinel elements more obvious Jonathan Neuschäfer 4 siblings, 1 reply; 11+ messages in thread From: Jonathan Neuschäfer @ 2022-02-18 0:09 UTC (permalink / raw) To: linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Michael Turquette, Stephen Boyd, Alexander Shiyan, Mike Turquette, Arnd Bergmann In order that the end of a clk_div_table can be detected, it must be terminated with a sentinel element (.div = 0). Fixes: 631c53478973d ("clk: Add CLPS711X clk driver") Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> --- v4: - Change style to { /* sentinel */ } v3: - no changes v2: - Add Fixes tag --- drivers/clk/clk-clps711x.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/clk-clps711x.c b/drivers/clk/clk-clps711x.c index a2c6486ef1708..f8417ee2961aa 100644 --- a/drivers/clk/clk-clps711x.c +++ b/drivers/clk/clk-clps711x.c @@ -28,11 +28,13 @@ static const struct clk_div_table spi_div_table[] = { { .val = 1, .div = 8, }, { .val = 2, .div = 2, }, { .val = 3, .div = 1, }, + { /* sentinel */ } }; static const struct clk_div_table timer_div_table[] = { { .val = 0, .div = 256, }, { .val = 1, .div = 1, }, + { /* sentinel */ } }; struct clps711x_clk { -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 4/5] clk: clps711x: Terminate clk_div_table with sentinel element 2022-02-18 0:09 ` [PATCH v4 4/5] clk: clps711x: " Jonathan Neuschäfer @ 2022-03-12 2:16 ` Stephen Boyd 0 siblings, 0 replies; 11+ messages in thread From: Stephen Boyd @ 2022-03-12 2:16 UTC (permalink / raw) To: Jonathan Neuschäfer, linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Michael Turquette, Alexander Shiyan, Mike Turquette, Arnd Bergmann Quoting Jonathan Neuschäfer (2022-02-17 16:09:20) > In order that the end of a clk_div_table can be detected, it must be > terminated with a sentinel element (.div = 0). > > Fixes: 631c53478973d ("clk: Add CLPS711X clk driver") > Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> > --- Applied to clk-next ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 5/5] clk: actions: Make sentinel elements more obvious 2022-02-18 0:09 [PATCH v4 0/5] clk drivers: Terminate clk_div_table with sentinel element Jonathan Neuschäfer ` (3 preceding siblings ...) 2022-02-18 0:09 ` [PATCH v4 4/5] clk: clps711x: " Jonathan Neuschäfer @ 2022-02-18 0:09 ` Jonathan Neuschäfer 2022-03-12 2:17 ` Stephen Boyd 4 siblings, 1 reply; 11+ messages in thread From: Jonathan Neuschäfer @ 2022-02-18 0:09 UTC (permalink / raw) To: linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Michael Turquette, Stephen Boyd, Andreas Färber, Manivannan Sadhasivam, linux-actions The sentinel elements of various tables in drivers/clk/actions can be a bit hard to recognize. Make them easier to see by changing the style from { 0, 0 } to { /* sentinel */ }. Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> --- v4: - New patch --- drivers/clk/actions/owl-s500.c | 16 ++++++++-------- drivers/clk/actions/owl-s700.c | 18 ++++++++++-------- drivers/clk/actions/owl-s900.c | 26 +++++++++++++------------- 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/drivers/clk/actions/owl-s500.c b/drivers/clk/actions/owl-s500.c index 57d06e183dff4..c69a7e2f06457 100644 --- a/drivers/clk/actions/owl-s500.c +++ b/drivers/clk/actions/owl-s500.c @@ -95,7 +95,7 @@ static const struct clk_pll_table clk_audio_pll_table[] = { { 0, 45158400 }, { 1, 49152000 }, - { 0, 0 }, + { /* sentinel */ } }; /* pll clocks */ @@ -138,46 +138,46 @@ static struct clk_factor_table sd_factor_table[] = { { 272, 1, 17 * 128 }, { 273, 1, 18 * 128 }, { 274, 1, 19 * 128 }, { 275, 1, 20 * 128 }, { 276, 1, 21 * 128 }, { 277, 1, 22 * 128 }, { 278, 1, 23 * 128 }, { 279, 1, 24 * 128 }, { 280, 1, 25 * 128 }, - { 0, 0, 0 }, + { /* sentinel */ } }; static struct clk_factor_table de_factor_table[] = { { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 2, 5 }, { 4, 1, 3 }, { 5, 1, 4 }, { 6, 1, 6 }, { 7, 1, 8 }, { 8, 1, 12 }, - { 0, 0, 0 }, + { /* sentinel */ } }; static struct clk_factor_table hde_factor_table[] = { { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 2, 5 }, { 4, 1, 3 }, { 5, 1, 4 }, { 6, 1, 6 }, { 7, 1, 8 }, - { 0, 0, 0 }, + { /* sentinel */ } }; static struct clk_div_table rmii_ref_div_table[] = { { 0, 4 }, { 1, 10 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_div_table std12rate_div_table[] = { { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 8 }, { 8, 9 }, { 9, 10 }, { 10, 11 }, { 11, 12 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_div_table i2s_div_table[] = { { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 6 }, { 5, 8 }, { 6, 12 }, { 7, 16 }, { 8, 24 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_div_table nand_div_table[] = { { 0, 1 }, { 1, 2 }, { 2, 4 }, { 3, 6 }, { 4, 8 }, { 5, 10 }, { 6, 12 }, { 7, 14 }, { 8, 16 }, { 9, 18 }, { 10, 20 }, { 11, 22 }, - { 0, 0 }, + { /* sentinel */ } }; /* mux clock */ diff --git a/drivers/clk/actions/owl-s700.c b/drivers/clk/actions/owl-s700.c index 6ea7da1d6d755..3e48105602aa0 100644 --- a/drivers/clk/actions/owl-s700.c +++ b/drivers/clk/actions/owl-s700.c @@ -73,7 +73,7 @@ static struct clk_pll_table clk_audio_pll_table[] = { {0, 45158400}, {1, 49152000}, - {0, 0}, + { /* sentinel */ } }; static struct clk_pll_table clk_cvbs_pll_table[] = { @@ -82,7 +82,8 @@ static struct clk_pll_table clk_cvbs_pll_table[] = { {33, 35 * 12000000}, {34, 36 * 12000000}, {35, 37 * 12000000}, {36, 38 * 12000000}, {37, 39 * 12000000}, {38, 40 * 12000000}, {39, 41 * 12000000}, {40, 42 * 12000000}, {41, 43 * 12000000}, - {42, 44 * 12000000}, {43, 45 * 12000000}, {0, 0}, + {42, 44 * 12000000}, {43, 45 * 12000000}, + { /* sentinel */ } }; /* pll clocks */ @@ -137,7 +138,7 @@ static struct clk_factor_table sd_factor_table[] = { {276, 1, 21 * 128}, {277, 1, 22 * 128}, {278, 1, 23 * 128}, {279, 1, 24 * 128}, {280, 1, 25 * 128}, {281, 1, 26 * 128}, - {0, 0}, + { /* sentinel */ } }; static struct clk_factor_table lcd_factor_table[] = { @@ -150,19 +151,19 @@ static struct clk_factor_table lcd_factor_table[] = { {256, 1, 1 * 7}, {257, 1, 2 * 7}, {258, 1, 3 * 7}, {259, 1, 4 * 7}, {260, 1, 5 * 7}, {261, 1, 6 * 7}, {262, 1, 7 * 7}, {263, 1, 8 * 7}, {264, 1, 9 * 7}, {265, 1, 10 * 7}, {266, 1, 11 * 7}, {267, 1, 12 * 7}, - {0, 0}, + { /* sentinel */ } }; static struct clk_div_table hdmia_div_table[] = { {0, 1}, {1, 2}, {2, 3}, {3, 4}, {4, 6}, {5, 8}, {6, 12}, {7, 16}, {8, 24}, - {0, 0}, + { /* sentinel */ } }; static struct clk_div_table rmii_div_table[] = { {0, 4}, {1, 10}, - {0, 0} + { /* sentinel */ } }; /* divider clocks */ @@ -179,13 +180,14 @@ static OWL_DIVIDER(clk_rmii_ref, "rmii_ref", "ethernet_pll", CMU_ETHERNETPLL, 2, static struct clk_factor_table de_factor_table[] = { {0, 1, 1}, {1, 2, 3}, {2, 1, 2}, {3, 2, 5}, {4, 1, 3}, {5, 1, 4}, {6, 1, 6}, {7, 1, 8}, - {8, 1, 12}, {0, 0, 0}, + {8, 1, 12}, + { /* sentinel */ } }; static struct clk_factor_table hde_factor_table[] = { {0, 1, 1}, {1, 2, 3}, {2, 1, 2}, {3, 2, 5}, {4, 1, 3}, {5, 1, 4}, {6, 1, 6}, {7, 1, 8}, - {0, 0, 0}, + { /* sentinel */ } }; /* gate clocks */ diff --git a/drivers/clk/actions/owl-s900.c b/drivers/clk/actions/owl-s900.c index 5144ada2c7e1a..7dc6e07fb60ea 100644 --- a/drivers/clk/actions/owl-s900.c +++ b/drivers/clk/actions/owl-s900.c @@ -73,12 +73,12 @@ static struct clk_pll_table clk_audio_pll_table[] = { { 0, 45158400 }, { 1, 49152000 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_pll_table clk_edp_pll_table[] = { { 0, 810000000 }, { 1, 135000000 }, { 2, 270000000 }, - { 0, 0 }, + { /* sentinel */ } }; /* pll clocks */ @@ -120,41 +120,41 @@ static struct clk_div_table nand_div_table[] = { { 4, 8 }, { 5, 10 }, { 6, 12 }, { 7, 14 }, { 8, 16 }, { 9, 18 }, { 10, 20 }, { 11, 22 }, { 12, 24 }, { 13, 26 }, { 14, 28 }, { 15, 30 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_div_table apb_div_table[] = { { 1, 2 }, { 2, 3 }, { 3, 4 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_div_table eth_mac_div_table[] = { { 0, 2 }, { 1, 4 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_div_table rmii_ref_div_table[] = { { 0, 4 }, { 1, 10 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_div_table usb3_mac_div_table[] = { { 1, 2 }, { 2, 3 }, { 3, 4 }, - { 0, 0 } + { /* sentinel */ } }; static struct clk_div_table i2s_div_table[] = { { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 6 }, { 5, 8 }, { 6, 12 }, { 7, 16 }, { 8, 24 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_div_table hdmia_div_table[] = { { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 6 }, { 5, 8 }, { 6, 12 }, { 7, 16 }, { 8, 24 }, - { 0, 0 }, + { /* sentinel */ } }; /* divider clocks */ @@ -185,24 +185,24 @@ static struct clk_factor_table sd_factor_table[] = { { 280, 1, 25 * 128 }, { 281, 1, 26 * 128 }, { 282, 1, 27 * 128 }, { 283, 1, 28 * 128 }, { 284, 1, 29 * 128 }, { 285, 1, 30 * 128 }, { 286, 1, 31 * 128 }, { 287, 1, 32 * 128 }, - { 0, 0 }, + { /* sentinel */ } }; static struct clk_factor_table dmm_factor_table[] = { { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 1, 3 }, { 4, 1, 4 }, - { 0, 0, 0 }, + { /* sentinel */ } }; static struct clk_factor_table noc_factor_table[] = { { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 1, 3 }, { 4, 1, 4 }, - { 0, 0, 0 }, + { /* sentinel */ } }; static struct clk_factor_table bisp_factor_table[] = { { 0, 1, 1 }, { 1, 2, 3 }, { 2, 1, 2 }, { 3, 2, 5 }, { 4, 1, 3 }, { 5, 1, 4 }, { 6, 1, 6 }, { 7, 1, 8 }, - { 0, 0, 0 }, + { /* sentinel */ } }; /* factor clocks */ -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 5/5] clk: actions: Make sentinel elements more obvious 2022-02-18 0:09 ` [PATCH v4 5/5] clk: actions: Make sentinel elements more obvious Jonathan Neuschäfer @ 2022-03-12 2:17 ` Stephen Boyd 0 siblings, 0 replies; 11+ messages in thread From: Stephen Boyd @ 2022-03-12 2:17 UTC (permalink / raw) To: Jonathan Neuschäfer, linux-clk Cc: linux-kernel, linux-arm-kernel, linux-mips, Philippe Mathieu-Daudé, Jonathan Neuschäfer, Michael Turquette, Andreas Färber, Manivannan Sadhasivam, linux-actions Quoting Jonathan Neuschäfer (2022-02-17 16:09:21) > The sentinel elements of various tables in drivers/clk/actions can be a > bit hard to recognize. Make them easier to see by changing the style > from { 0, 0 } to { /* sentinel */ }. > > Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> > --- Applied to clk-next ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2022-03-12 2:17 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-02-18 0:09 [PATCH v4 0/5] clk drivers: Terminate clk_div_table with sentinel element Jonathan Neuschäfer 2022-02-18 0:09 ` [PATCH v4 1/5] clk: actions: " Jonathan Neuschäfer 2022-03-12 2:16 ` Stephen Boyd 2022-02-18 0:09 ` [PATCH v4 2/5] clk: loongson1: " Jonathan Neuschäfer 2022-03-12 2:16 ` Stephen Boyd 2022-02-18 0:09 ` [PATCH v4 3/5] clk: hisilicon: " Jonathan Neuschäfer 2022-03-12 2:16 ` Stephen Boyd 2022-02-18 0:09 ` [PATCH v4 4/5] clk: clps711x: " Jonathan Neuschäfer 2022-03-12 2:16 ` Stephen Boyd 2022-02-18 0:09 ` [PATCH v4 5/5] clk: actions: Make sentinel elements more obvious Jonathan Neuschäfer 2022-03-12 2:17 ` Stephen Boyd
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).