Skip to contentSkip to conversation

m68k: coldfire:Add const to clk_ops

PATCH In review Xiang wangx 3 participants 3 messages May 30, 2022 – May 31, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k: coldfire:Add const to clk_ops

Struct clk_ops should normally be const.

---
 arch/m68k/coldfire/clk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/m68k/coldfire/clk.c +2 -2
index d03b6c4aa86b..a0cd4c79f0ee 100644
@@ -50,7 +50,7 @@ static void __clk_disable0(struct clk *clk)
 	__raw_writeb(clk->slot, MCFPM_PPMSR0);
 }
 
-struct clk_ops clk_ops0 = {
+struct const clk_ops clk_ops0 = {
 	.enable		= __clk_enable0,
 	.disable	= __clk_disable0,
 };
@@ -66,7 +66,7 @@ static void __clk_disable1(struct clk *clk)
 	__raw_writeb(clk->slot, MCFPM_PPMSR1);
 }
 
-struct clk_ops clk_ops1 = {
+struct const clk_ops clk_ops1 = {
 	.enable		= __clk_enable1,
 	.disable	= __clk_disable1,
 };
Signature · 1 line
2.36.1
#1 lore raw

Hi Xiang,

Quoted 3 lines · Xiang wangx

Struct clk_ops should normally be const.

Thanks for your patch!

arch/m68k/coldfire/clk.c static void __clk_disable0(struct clk *clk) · line 53

Quoted 8 lines
arch/m68k/coldfire/clk.c +1 -1
@@ -50,7 +50,7 @@ static void __clk_disable0(struct clk *clk)
        __raw_writeb(clk->slot, MCFPM_PPMSR0);
 }
 
-struct clk_ops clk_ops0 = {
+struct const clk_ops clk_ops0 = {

The "const" should be first on the line.
Please test-compile your patches before submitting them.

arch/m68k/coldfire/clk.c static void __clk_disable0(struct clk *clk) · line 56

Quoted 3 lines
arch/m68k/coldfire/clk.c +0 -0
        .enable         = __clk_enable0,
        .disable        = __clk_disable0,
 };

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
In reply to Xiang wangx
Thank you for the patch! Yet something to improve:

Hi Xiang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on gerg-m68knommu/for-next]
[also build test ERROR on geert-m68k/for-next v5.18 next-20220531] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Xiang-wangx/m68k-coldfire-Add-const-to-clk_ops/20220530-105531
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git for-next
config: m68k-allnoconfig (https://download.01.org/0day-ci/archive/20220531/[email protected]/config)
compiler: m68k-linux-gcc (GCC) 11.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/e44f3b73f214f99802c9a010145922eb0a126933
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Xiang-wangx/m68k-coldfire-Add-const-to-clk_ops/20220530-105531
git checkout e44f3b73f214f99802c9a010145922eb0a126933
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash arch/m68k/coldfire/

If you fix the issue, kindly add following tag where applicable

All errors (new ones prefixed by >>):

>> arch/m68k/coldfire/clk.c:53:8: error: expected '{' before 'const'
      53 | struct const clk_ops clk_ops0 = {
         |        ^~~~~

arch/m68k/coldfire/clk.c:48:13: warning: '__clk_disable0' defined but not used [-Wunused-function]
48 | static void __clk_disable0(struct clk *clk)
| ^~~~~~~~~~~~~~
arch/m68k/coldfire/clk.c:43:13: warning: '__clk_enable0' defined but not used [-Wunused-function]
43 | static void __clk_enable0(struct clk *clk)
| ^~~~~~~~~~~~~

vim +53 arch/m68k/coldfire/clk.c

    52	
  > 53	struct const clk_ops clk_ops0 = {
    54		.enable		= __clk_enable0,
    55		.disable	= __clk_disable0,
    56	};
    57	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp