Skip to contentSkip to conversation

staging: sm750: Rename camel case functions in sm750_cursor.*

PATCH In review Kloudifold 4 participants 4 messages Mar 10, 2023 – Mar 13, 2023

Subsystems (2)
lore
Share & tools
lore

Kloudifold

author
#0 lore raw

PATCH 1/1 staging: sm750: Rename camel case functions in sm750_cursor.*

This patch fixes the "CHECK: Avoid CamelCase" reported by checkpatch.pl by renaming camel case functions.

---
 drivers/staging/sm750fb/sm750_cursor.c | 14 +++++++-------
 drivers/staging/sm750fb/sm750_cursor.h | 12 ++++++------
 2 files changed, 13 insertions(+), 13 deletions(-)
drivers/staging/sm750fb/sm750_cursor.c +7 -7
index 43e6f52c2..ff643e33f 100644
@@ -58,13 +58,13 @@ void sm750_hw_cursor_disable(struct lynx_cursor *cursor)
 	poke32(HWC_ADDRESS, 0);
 }
 
-void sm750_hw_cursor_setSize(struct lynx_cursor *cursor, int w, int h)
+void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h)
 {
 	cursor->w = w;
 	cursor->h = h;
 }
 
-void sm750_hw_cursor_setPos(struct lynx_cursor *cursor, int x, int y)
+void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y)
 {
 	u32 reg;
 
@@ -73,7 +73,7 @@ void sm750_hw_cursor_setPos(struct lynx_cursor *cursor, int x, int y)
 	poke32(HWC_LOCATION, reg);
 }
 
-void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg)
+void sm750_hw_cursor_set_color(struct lynx_cursor *cursor, u32 fg, u32 bg)
 {
 	u32 reg = (fg << HWC_COLOR_12_2_RGB565_SHIFT) &
 		HWC_COLOR_12_2_RGB565_MASK;
@@ -82,8 +82,8 @@ void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg)
 	poke32(HWC_COLOR_3, 0xffe0);
 }
 
-void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop,
-			     const u8 *pcol, const u8 *pmsk)
+void sm750_hw_cursor_set_data(struct lynx_cursor *cursor, u16 rop,
+			      const u8 *pcol, const u8 *pmsk)
 {
 	int i, j, count, pitch, offset;
 	u8 color, mask, opr;
@@ -132,8 +132,8 @@ void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop,
 	}
 }
 
-void sm750_hw_cursor_setData2(struct lynx_cursor *cursor, u16 rop,
-			      const u8 *pcol, const u8 *pmsk)
+void sm750_hw_cursor_set_data2(struct lynx_cursor *cursor, u16 rop,
+			       const u8 *pcol, const u8 *pmsk)
 {
 	int i, j, count, pitch, offset;
 	u8 color, mask;
drivers/staging/sm750fb/sm750_cursor.h +6 -6
index b59643dd6..88fa02f63 100644
@@ -5,11 +5,11 @@
 /* hw_cursor_xxx works for voyager,718 and 750 */
 void sm750_hw_cursor_enable(struct lynx_cursor *cursor);
 void sm750_hw_cursor_disable(struct lynx_cursor *cursor);
-void sm750_hw_cursor_setSize(struct lynx_cursor *cursor, int w, int h);
-void sm750_hw_cursor_setPos(struct lynx_cursor *cursor, int x, int y);
-void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg);
-void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop,
-			     const u8 *data, const u8 *mask);
-void sm750_hw_cursor_setData2(struct lynx_cursor *cursor, u16 rop,
+void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h);
+void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y);
+void sm750_hw_cursor_set_color(struct lynx_cursor *cursor, u32 fg, u32 bg);
+void sm750_hw_cursor_set_data(struct lynx_cursor *cursor, u16 rop,
 			      const u8 *data, const u8 *mask);
+void sm750_hw_cursor_set_data2(struct lynx_cursor *cursor, u16 rop,
+			       const u8 *data, const u8 *mask);
 #endif
Signature · 1 line
2.39.2
#1 lore raw

You don't need the filename in the subject.

Quoted 39 lines · Kloudifold

This patch fixes the "CHECK: Avoid CamelCase" reported by checkpatch.pl by renaming camel case functions.

---
 drivers/staging/sm750fb/sm750_cursor.c | 14 +++++++-------
 drivers/staging/sm750fb/sm750_cursor.h | 12 ++++++------
 2 files changed, 13 insertions(+), 13 deletions(-)
drivers/staging/sm750fb/sm750_cursor.c +3 -3
index 43e6f52c2..ff643e33f 100644
@@ -58,13 +58,13 @@ void sm750_hw_cursor_disable(struct lynx_cursor *cursor)
 	poke32(HWC_ADDRESS, 0);
 }
 
-void sm750_hw_cursor_setSize(struct lynx_cursor *cursor, int w, int h)
+void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h)
 {
 	cursor->w = w;
 	cursor->h = h;
 }
 
-void sm750_hw_cursor_setPos(struct lynx_cursor *cursor, int x, int y)
+void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y)
 {
 	u32 reg;
 
@@ -73,7 +73,7 @@ void sm750_hw_cursor_setPos(struct lynx_cursor *cursor, int x, int y)
 	poke32(HWC_LOCATION, reg);
 }
 
-void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg)
+void sm750_hw_cursor_set_color(struct lynx_cursor *cursor, u32 fg, u32 bg)
 {
 	u32 reg = (fg << HWC_COLOR_12_2_RGB565_SHIFT) &
 		HWC_COLOR_12_2_RGB565_MASK;

drivers/staging/sm750fb/sm750_cursor.c void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg) · line 86

Quoted 7 lines
drivers/staging/sm750fb/sm750_cursor.c +2 -2
@@ -82,8 +82,8 @@ void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg)
 	poke32(HWC_COLOR_3, 0xffe0);
 }
 
-void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop,
-			     const u8 *pcol, const u8 *pmsk)
+void sm750_hw_cursor_set_data(struct lynx_cursor *cursor, u16 rop,
+			      const u8 *pcol, const u8 *pmsk)

The indentation of the second line looks random. It's not a multiple of the tabs, and it doesn't line up with the right side of the (. So there doesn't seem to be any need to change it for this patch.

drivers/staging/sm750fb/sm750_cursor.c void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop, · line 136

Quoted 11 lines
drivers/staging/sm750fb/sm750_cursor.c +2 -2
 {
 	int i, j, count, pitch, offset;
 	u8 color, mask, opr;
@@ -132,8 +132,8 @@ void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop,
 	}
 }
 
-void sm750_hw_cursor_setData2(struct lynx_cursor *cursor, u16 rop,
-			      const u8 *pcol, const u8 *pmsk)
+void sm750_hw_cursor_set_data2(struct lynx_cursor *cursor, u16 rop,
+			       const u8 *pcol, const u8 *pmsk)

Likewise.

Quoted 14 lines
drivers/staging/sm750fb/sm750_cursor.c +0 -0
 {
 	int i, j, count, pitch, offset;
 	u8 color, mask;
drivers/staging/sm750fb/sm750_cursor.h +0 -3
index b59643dd6..88fa02f63 100644
@@ -5,11 +5,11 @@
 /* hw_cursor_xxx works for voyager,718 and 750 */
 void sm750_hw_cursor_enable(struct lynx_cursor *cursor);
 void sm750_hw_cursor_disable(struct lynx_cursor *cursor);
-void sm750_hw_cursor_setSize(struct lynx_cursor *cursor, int w, int h);
-void sm750_hw_cursor_setPos(struct lynx_cursor *cursor, int x, int y);
-void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg);

drivers/staging/sm750fb/sm750_cursor.h line 14

Quoted 10 lines
drivers/staging/sm750fb/sm750_cursor.h +6 -3
-void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop,
-			     const u8 *data, const u8 *mask);
-void sm750_hw_cursor_setData2(struct lynx_cursor *cursor, u16 rop,
+void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h);
+void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y);
+void sm750_hw_cursor_set_color(struct lynx_cursor *cursor, u32 fg, u32 bg);
+void sm750_hw_cursor_set_data(struct lynx_cursor *cursor, u16 rop,
 			      const u8 *data, const u8 *mask);
+void sm750_hw_cursor_set_data2(struct lynx_cursor *cursor, u16 rop,
+			       const u8 *data, const u8 *mask);

Likewise.

julia

Quoted 6 lines
drivers/staging/sm750fb/sm750_cursor.h +0 -1
 #endif
--

2.39.2

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

Hi Kloudifold,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Kloudifold/staging-sm750-Rename-camel-case-functions-in-sm750_cursor/20230311-053447
patch link:    https://lore.kernel.org/r/ZAuiDTDT8dmBcRoH%40CloudiRingWorld
patch subject: [PATCH] staging: sm750: Rename camel case functions in sm750_cursor.*
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20230311/[email protected]/config)
compiler: sparc64-linux-gcc (GCC) 12.1.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/c82f66fbd5902ae486c4e2227e5071a59c49a05a
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Kloudifold/staging-sm750-Rename-camel-case-functions-in-sm750_cursor/20230311-053447 git checkout c82f66fbd5902ae486c4e2227e5071a59c49a05a
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc SHELL=/bin/bash drivers/staging/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/staging/sm750fb/sm750.c: In function 'lynxfb_ops_cursor':

>> drivers/staging/sm750fb/sm750.c:124:17: error: implicit declaration of function 'sm750_hw_cursor_setSize'; did you mean 'sm750_hw_cursor_set_size'? [-Werror=implicit-function-declaration]
     124 |                 sm750_hw_cursor_setSize(cursor,
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
         |                 sm750_hw_cursor_set_size
>> drivers/staging/sm750fb/sm750.c:129:17: error: implicit declaration of function 'sm750_hw_cursor_setPos'; did you mean 'sm750_hw_cursor_set_pos'? [-Werror=implicit-function-declaration]
     129 |                 sm750_hw_cursor_setPos(cursor,
         |                 ^~~~~~~~~~~~~~~~~~~~~~
         |                 sm750_hw_cursor_set_pos
>> drivers/staging/sm750fb/sm750.c:145:17: error: implicit declaration of function 'sm750_hw_cursor_setColor'; did you mean 'sm750_hw_cursor_set_color'? [-Werror=implicit-function-declaration]
     145 |                 sm750_hw_cursor_setColor(cursor, fg, bg);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~
         |                 sm750_hw_cursor_set_color
>> drivers/staging/sm750fb/sm750.c:149:17: error: implicit declaration of function 'sm750_hw_cursor_setData'; did you mean 'sm750_hw_cursor_set_data'? [-Werror=implicit-function-declaration]
     149 |                 sm750_hw_cursor_setData(cursor,
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
         |                 sm750_hw_cursor_set_data

cc1: some warnings being treated as errors

vim +124 drivers/staging/sm750fb/sm750.c

81dee67e215b23 Sudip Mukherjee      2015-03-03  104  
81dee67e215b23 Sudip Mukherjee      2015-03-03  105  /* no hardware cursor supported under version 2.6.10, kernel bug */
81dee67e215b23 Sudip Mukherjee      2015-03-03  106  static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
81dee67e215b23 Sudip Mukherjee      2015-03-03  107  {
81dee67e215b23 Sudip Mukherjee      2015-03-03  108  	struct lynxfb_par *par;
81dee67e215b23 Sudip Mukherjee      2015-03-03  109  	struct lynxfb_crtc *crtc;
81dee67e215b23 Sudip Mukherjee      2015-03-03  110  	struct lynx_cursor *cursor;
81dee67e215b23 Sudip Mukherjee      2015-03-03  111  
81dee67e215b23 Sudip Mukherjee      2015-03-03  112  	par = info->par;
81dee67e215b23 Sudip Mukherjee      2015-03-03  113  	crtc = &par->crtc;
81dee67e215b23 Sudip Mukherjee      2015-03-03  114  	cursor = &crtc->cursor;
81dee67e215b23 Sudip Mukherjee      2015-03-03  115  
39f9137268ee3d Benjamin Philip      2021-07-26  116  	if (fbcursor->image.width > cursor->max_w ||
cfdafb7608b4cf Benjamin Philip      2021-07-26  117  	    fbcursor->image.height > cursor->max_h ||
81dee67e215b23 Sudip Mukherjee      2015-03-03  118  	    fbcursor->image.depth > 1) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  119  		return -ENXIO;
81dee67e215b23 Sudip Mukherjee      2015-03-03  120  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  121  
52d0744d751d8f Arnd Bergmann        2016-11-09  122  	sm750_hw_cursor_disable(cursor);
f46a04c75605fd Michel von Czettritz 2015-03-27  123  	if (fbcursor->set & FB_CUR_SETSIZE)
52d0744d751d8f Arnd Bergmann        2016-11-09 @124  		sm750_hw_cursor_setSize(cursor,
3318bb5e945f70 Michel von Czettritz 2015-03-26  125  					fbcursor->image.width,
3318bb5e945f70 Michel von Czettritz 2015-03-26  126  					fbcursor->image.height);
81dee67e215b23 Sudip Mukherjee      2015-03-03  127  
3318bb5e945f70 Michel von Czettritz 2015-03-26  128  	if (fbcursor->set & FB_CUR_SETPOS)
52d0744d751d8f Arnd Bergmann        2016-11-09 @129  		sm750_hw_cursor_setPos(cursor,
3318bb5e945f70 Michel von Czettritz 2015-03-26  130  				       fbcursor->image.dx - info->var.xoffset,
81dee67e215b23 Sudip Mukherjee      2015-03-03  131  				       fbcursor->image.dy - info->var.yoffset);
81dee67e215b23 Sudip Mukherjee      2015-03-03  132  
81dee67e215b23 Sudip Mukherjee      2015-03-03  133  	if (fbcursor->set & FB_CUR_SETCMAP) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  134  		/* get the 16bit color of kernel means */
81dee67e215b23 Sudip Mukherjee      2015-03-03  135  		u16 fg, bg;
876e5a701f17e4 Michel von Czettritz 2015-03-26  136  
81dee67e215b23 Sudip Mukherjee      2015-03-03  137  		fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800)) |
81dee67e215b23 Sudip Mukherjee      2015-03-03  138  		     ((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5) |
81dee67e215b23 Sudip Mukherjee      2015-03-03  139  		     ((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
81dee67e215b23 Sudip Mukherjee      2015-03-03  140  
81dee67e215b23 Sudip Mukherjee      2015-03-03  141  		bg = ((info->cmap.red[fbcursor->image.bg_color] & 0xf800)) |
81dee67e215b23 Sudip Mukherjee      2015-03-03  142  		     ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5) |
81dee67e215b23 Sudip Mukherjee      2015-03-03  143  		     ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11);
81dee67e215b23 Sudip Mukherjee      2015-03-03  144  
52d0744d751d8f Arnd Bergmann        2016-11-09 @145  		sm750_hw_cursor_setColor(cursor, fg, bg);
81dee67e215b23 Sudip Mukherjee      2015-03-03  146  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  147  
70407df77665c0 Michel von Czettritz 2015-03-26  148  	if (fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) {
52d0744d751d8f Arnd Bergmann        2016-11-09 @149  		sm750_hw_cursor_setData(cursor,
81dee67e215b23 Sudip Mukherjee      2015-03-03  150  					fbcursor->rop,
81dee67e215b23 Sudip Mukherjee      2015-03-03  151  					fbcursor->image.data,
81dee67e215b23 Sudip Mukherjee      2015-03-03  152  					fbcursor->mask);
81dee67e215b23 Sudip Mukherjee      2015-03-03  153  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  154  
f46a04c75605fd Michel von Czettritz 2015-03-27  155  	if (fbcursor->enable)
52d0744d751d8f Arnd Bergmann        2016-11-09  156  		sm750_hw_cursor_enable(cursor);
81dee67e215b23 Sudip Mukherjee      2015-03-03  157  
81dee67e215b23 Sudip Mukherjee      2015-03-03  158  	return 0;
81dee67e215b23 Sudip Mukherjee      2015-03-03  159  }
81dee67e215b23 Sudip Mukherjee      2015-03-03  160  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
#3 lore raw
Quoted 24 lines · kernel test robot

Hi Kloudifold,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Kloudifold/staging-sm750-Rename-camel-case-functions-in-sm750_cursor/20230311-053447
patch link:    https://lore.kernel.org/r/ZAuiDTDT8dmBcRoH%40CloudiRingWorld
patch subject: [PATCH] staging: sm750: Rename camel case functions in sm750_cursor.*
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20230311/[email protected]/config)
compiler: sparc64-linux-gcc (GCC) 12.1.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/c82f66fbd5902ae486c4e2227e5071a59c49a05a
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Kloudifold/staging-sm750-Rename-camel-case-functions-in-sm750_cursor/20230311-053447 git checkout c82f66fbd5902ae486c4e2227e5071a59c49a05a
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc SHELL=/bin/bash drivers/staging/

Quoted 3 lines

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Kloudifold,

As this report shows it looks like you did not compile your patch before sending it. Please do so at a minimum.

Also, when making substitutions such as this 'git grep' is your friend:

$ git grep sm750_hw_cursor_setSize
drivers/staging/sm750fb/sm750.c: sm750_hw_cursor_setSize(cursor,
drivers/staging/sm750fb/sm750_cursor.c:void sm750_hw_cursor_setSize(struct lynx_cursor *cursor, int w, int h)
drivers/staging/sm750fb/sm750_cursor.h:void sm750_hw_cursor_setSize(struct lynx_cursor *cursor, int w, int h);

Ira