staging: sm750fb: cleanup `sm750_hw_copyarea`
cover staging: sm750fb: cleanup `sm750_hw_copyarea`
This patchset covers style cleanups in sm750_hw_copyarea defined in drivers/staging/sm750fb/sm750_accel.c
PATCH #1: staging: sm750fb: rename sBase parameter PATCH #2: staging: sm750fb: rename sPitch parameter PATCH #3: staging: sm750fb: rename dBase parameter PATCH #4: staging: sm750fb: rename dPitch parameter PATCH #5: staging: sm750fb: rename Bpp parameter PATCH #6: staging: sm750fb: Rename local var nDirection
Eric Florin (6):
staging: sm750fb: rename sBase parameter
staging: sm750fb: rename sPitch parameter
staging: sm750fb: rename dBase parameter
staging: sm750fb: rename dPitch parameter
staging: sm750fb: rename Bpp parameter
staging: sm750fb: Rename local var nDirection
drivers/staging/sm750fb/sm750_accel.c | 46 +++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-)
Signature · 1 line
2.49.0.1151.ga128411c76-goog
PATCH 1/6 staging: sm750fb: rename `sBase` parameter
Rename sBase to s_base in sm750_hw_copyarea to conform with style guidelines as reported by checkpatch.pl
CHECK: Avoid CamelCase: <sBase>
--- drivers/staging/sm750fb/sm750_accel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/sm750fb/sm750_accel.c +4 -4
@@ -132,7 +132,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,/** * sm750_hw_copyarea * @accel: Acceleration device data -* @sBase: Address of source: offset in frame buffer +* @s_base: Address of source: offset in frame buffer * @sPitch: Pitch value of source surface in BYTE * @sx: Starting x coordinate of source surface * @sy: Starting y coordinate of source surface
@@ -146,7 +146,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* @rop2: ROP value */ int sm750_hw_copyarea(struct lynx_accel *accel, - unsigned int sBase, unsigned int sPitch, + unsigned int s_base, unsigned int sPitch, unsigned int sx, unsigned int sy, unsigned int dBase, unsigned int dPitch, unsigned int Bpp, unsigned int dx, unsigned int dy,
@@ -160,7 +160,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, de_ctrl =0 ;/* If source and destination are the same surface, need to check for overlay cases */ -if (sBase == dBase && sPitch == dPitch) { +if (s_base == dBase && sPitch == dPitch) {/* Determine direction of operation */ if (sy < dy) {/* +----------+
@@ -234,7 +234,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* It is an address offset (128 bit aligned) * from the beginning of frame buffer. */ -write_dpr (accel,DE_WINDOW_SOURCE_BASE , sBase);/* dpr40 */ +write_dpr (accel,DE_WINDOW_SOURCE_BASE , s_base);/* dpr40 */ /* * 2D Destination Base.
Signature · 1 line
2.49.0.1151.ga128411c76-goog
Greg KH
maintainerRe: [PATCH 1/6] staging: sm750fb: rename `sBase` parameter
Quoted 15 lines · Eric Florin
Rename
sBasetos_baseinsm750_hw_copyareato conform with style guidelines as reported by checkpatch.plCHECK: Avoid CamelCase: <sBase>
Signed-off-by Eric Florin <[email protected]>--- drivers/staging/sm750fb/sm750_accel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/staging/sm750fb/sm750_accel.c +0
-0
drivers/staging/sm750fb/sm750_accel.c int sm750_hw_fillrect(struct lynx_accel *accel, · line 135
Quoted 5 lines
drivers/staging/sm750fb/sm750_accel.c +1
-1@@ -132,7 +132,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,/** * sm750_hw_copyarea * @accel: Acceleration device data -* @sBase: Address of source: offset in frame buffer +* @s_base: Address of source: offset in frame buffer
Wouldn't a better name be "source_base"?
thanks,
greg k-h
PATCH 2/6 staging: sm750fb: rename `sPitch` parameter
In reply to Eric FlorinRename sPitch to s_pitch in sm750_hw_copyarea to conform with kernel style guidelines as reported by checkpatch.pl
CHECK: Avoid CamelCase: <sPitch>
--- drivers/staging/sm750fb/sm750_accel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/sm750fb/sm750_accel.c +5 -5
@@ -133,7 +133,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* sm750_hw_copyarea * @accel: Acceleration device data * @s_base: Address of source: offset in frame buffer -* @sPitch: Pitch value of source surface in BYTE +* @s_pitch: Pitch value of source surface in BYTE * @sx: Starting x coordinate of source surface * @sy: Starting y coordinate of source surface * @dBase: Address of destination: offset in frame buffer
@@ -146,7 +146,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* @rop2: ROP value */ int sm750_hw_copyarea(struct lynx_accel *accel, - unsigned int s_base, unsigned int sPitch, + unsigned int s_base, unsigned int s_pitch, unsigned int sx, unsigned int sy, unsigned int dBase, unsigned int dPitch, unsigned int Bpp, unsigned int dx, unsigned int dy,
@@ -160,7 +160,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, de_ctrl =0 ;/* If source and destination are the same surface, need to check for overlay cases */ -if (s_base == dBase && sPitch == dPitch) { +if (s_base == dBase && s_pitch == dPitch) {/* Determine direction of operation */ if (sy < dy) {/* +----------+
@@ -251,7 +251,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,write_dpr (accel,DE_PITCH , ((dPitch / Bpp <<DE_PITCH_DESTINATION_SHIFT ) &DE_PITCH_DESTINATION_MASK ) | - (sPitch / Bpp &DE_PITCH_SOURCE_MASK ));/* dpr10 */ + (s_pitch / Bpp &DE_PITCH_SOURCE_MASK ));/* dpr10 */ /* * Screen Window width in Pixels.
@@ -261,7 +261,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,write_dpr (accel,DE_WINDOW_WIDTH , ((dPitch / Bpp <<DE_WINDOW_WIDTH_DST_SHIFT ) &DE_WINDOW_WIDTH_DST_MASK ) | - (sPitch / Bpp &DE_WINDOW_WIDTH_SRC_MASK ));/* dpr3c */ + (s_pitch / Bpp &DE_WINDOW_WIDTH_SRC_MASK ));/* dpr3c */ if (accel->de_wait () !=0 )return -1 ;
Signature · 1 line
2.49.0.1151.ga128411c76-goog
Greg KH
maintainerRe: [PATCH 2/6] staging: sm750fb: rename `sPitch` parameter
Quoted 15 lines · Eric Florin
Rename
sPitchtos_pitchinsm750_hw_copyareato conform with kernel style guidelines as reported by checkpatch.plCHECK: Avoid CamelCase: <sPitch>
Signed-off-by Eric Florin <[email protected]>--- drivers/staging/sm750fb/sm750_accel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/staging/sm750fb/sm750_accel.c +0
-0
drivers/staging/sm750fb/sm750_accel.c int sm750_hw_fillrect(struct lynx_accel *accel, · line 136
Quoted 5 lines
drivers/staging/sm750fb/sm750_accel.c +1
-1@@ -133,7 +133,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* sm750_hw_copyarea * @accel: Acceleration device data * @s_base: Address of source: offset in frame buffer -* @sPitch: Pitch value of source surface in BYTE +* @s_pitch: Pitch value of source surface in BYTE
"source_pitch"?
PATCH 3/6 staging: sm750fb: rename `dBase` parameter
In reply to Eric FlorinRename dBase to d_base in sm750_hw_copyarea to conform with kernel style guidelines as reported by checkpatch.pl
CHECK: Avoid CamelCase: <dBase>
--- drivers/staging/sm750fb/sm750_accel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/sm750fb/sm750_accel.c +4 -4
@@ -136,7 +136,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* @s_pitch: Pitch value of source surface in BYTE * @sx: Starting x coordinate of source surface * @sy: Starting y coordinate of source surface -* @dBase: Address of destination: offset in frame buffer +* @d_base: Address of destination: offset in frame buffer * @dPitch: Pitch value of destination surface in BYTE * @Bpp: Color depth of destination surface * @dx: Starting x coordinate of destination surface
@@ -148,7 +148,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,int sm750_hw_copyarea (struct lynx_accel *accel,unsigned int s_base,unsigned int s_pitch,unsigned int sx,unsigned int sy, -unsigned int dBase,unsigned int dPitch, +unsigned int d_base,unsigned int dPitch,unsigned int Bpp,unsigned int dx,unsigned int dy,unsigned int width,unsigned int height,unsigned int rop2)
@@ -160,7 +160,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, de_ctrl =0 ;/* If source and destination are the same surface, need to check for overlay cases */ -if (s_base == dBase && s_pitch == dPitch) { +if (s_base == d_base && s_pitch == dPitch) {/* Determine direction of operation */ if (sy < dy) {/* +----------+
@@ -241,7 +241,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* It is an address offset (128 bit aligned) * from the beginning of frame buffer. */ -write_dpr (accel,DE_WINDOW_DESTINATION_BASE , dBase);/* dpr44 */ +write_dpr (accel,DE_WINDOW_DESTINATION_BASE , d_base);/* dpr44 */ /* * Program pitch (distance between the 1st points of two adjacent lines).
Signature · 1 line
2.49.0.1151.ga128411c76-goog
Greg KH
maintainerRe: [PATCH 3/6] staging: sm750fb: rename `dBase` parameter
Quoted 15 lines · Eric Florin
Rename
dBasetod_baseinsm750_hw_copyareato conform with kernel style guidelines as reported by checkpatch.plCHECK: Avoid CamelCase: <dBase>
Signed-off-by Eric Florin <[email protected]>--- drivers/staging/sm750fb/sm750_accel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/staging/sm750fb/sm750_accel.c +0
-0
drivers/staging/sm750fb/sm750_accel.c int sm750_hw_fillrect(struct lynx_accel *accel, · line 139
Quoted 5 lines
drivers/staging/sm750fb/sm750_accel.c +1
-1@@ -136,7 +136,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* @s_pitch: Pitch value of source surface in BYTE * @sx: Starting x coordinate of source surface * @sy: Starting y coordinate of source surface -* @dBase: Address of destination: offset in frame buffer +* @d_base: Address of destination: offset in frame buffer
"dest_base"?
PATCH 4/6 staging: sm750fb: rename `dPitch` parameter
In reply to Eric FlorinRename dPitch to d_pitch in sm750_hw_copyarea to conform with kernel style guidelines as reported by checkpatch.pl
CHECK: Avoid CamelCase: <dPitch>
--- drivers/staging/sm750fb/sm750_accel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/sm750fb/sm750_accel.c +5 -5
@@ -137,7 +137,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* @sx: Starting x coordinate of source surface * @sy: Starting y coordinate of source surface * @d_base: Address of destination: offset in frame buffer -* @dPitch: Pitch value of destination surface in BYTE +* @d_pitch: Pitch value of destination surface in BYTE * @Bpp: Color depth of destination surface * @dx: Starting x coordinate of destination surface * @dy: Starting y coordinate of destination surface
@@ -148,7 +148,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,int sm750_hw_copyarea (struct lynx_accel *accel,unsigned int s_base,unsigned int s_pitch,unsigned int sx,unsigned int sy, -unsigned int d_base,unsigned int dPitch, +unsigned int d_base,unsigned int d_pitch,unsigned int Bpp,unsigned int dx,unsigned int dy,unsigned int width,unsigned int height,unsigned int rop2)
@@ -160,7 +160,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, de_ctrl =0 ;/* If source and destination are the same surface, need to check for overlay cases */ -if (s_base == d_base && s_pitch == dPitch) { +if (s_base == d_base && s_pitch == d_pitch) {/* Determine direction of operation */ if (sy < dy) {/* +----------+
@@ -249,7 +249,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* pixel values. Need Byte to pixel conversion. */ write_dpr (accel,DE_PITCH , - ((dPitch / Bpp <<DE_PITCH_DESTINATION_SHIFT ) & + ((d_pitch / Bpp <<DE_PITCH_DESTINATION_SHIFT ) &DE_PITCH_DESTINATION_MASK ) | (s_pitch / Bpp &DE_PITCH_SOURCE_MASK ));/* dpr10 */
@@ -259,7 +259,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* for a given point. */ write_dpr (accel,DE_WINDOW_WIDTH , - ((dPitch / Bpp <<DE_WINDOW_WIDTH_DST_SHIFT ) & + ((d_pitch / Bpp <<DE_WINDOW_WIDTH_DST_SHIFT ) &DE_WINDOW_WIDTH_DST_MASK ) | (s_pitch / Bpp &DE_WINDOW_WIDTH_SRC_MASK ));/* dpr3c */
Signature · 1 line
2.49.0.1151.ga128411c76-goog
Greg KH
maintainerRe: [PATCH 4/6] staging: sm750fb: rename `dPitch` parameter
Quoted 15 lines · Eric Florin
Rename
dPitchtod_pitchinsm750_hw_copyareato conform with kernel style guidelines as reported by checkpatch.plCHECK: Avoid CamelCase: <dPitch>
Signed-off-by Eric Florin <[email protected]>--- drivers/staging/sm750fb/sm750_accel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/staging/sm750fb/sm750_accel.c +0
-0
drivers/staging/sm750fb/sm750_accel.c int sm750_hw_fillrect(struct lynx_accel *accel, · line 140
Quoted 5 lines
drivers/staging/sm750fb/sm750_accel.c +1
-1@@ -137,7 +137,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* @sx: Starting x coordinate of source surface * @sy: Starting y coordinate of source surface * @d_base: Address of destination: offset in frame buffer -* @dPitch: Pitch value of destination surface in BYTE +* @d_pitch: Pitch value of destination surface in BYTE
"dest_pitch"?
PATCH 5/6 staging: sm750fb: rename `Bpp` parameter
In reply to Eric FlorinRename Bpp to bpp in sm750_hw_copyarea to conform with kernel style guidelines.
--- drivers/staging/sm750fb/sm750_accel.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/sm750fb/sm750_accel.c +6 -6
@@ -138,7 +138,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* @sy: Starting y coordinate of source surface * @d_base: Address of destination: offset in frame buffer * @d_pitch: Pitch value of destination surface in BYTE -* @Bpp: Color depth of destination surface +* @bpp: Color depth of destination surface * @dx: Starting x coordinate of destination surface * @dy: Starting y coordinate of destination surface * @width: width of rectangle in pixel value
@@ -149,7 +149,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, unsigned int s_base, unsigned int s_pitch, unsigned int sx, unsigned int sy, unsigned int d_base, unsigned int d_pitch, - unsigned int Bpp, unsigned int dx, unsigned int dy, + unsigned int bpp, unsigned int dx, unsigned int dy, unsigned int width, unsigned int height, unsigned int rop2) {
@@ -249,9 +249,9 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* pixel values. Need Byte to pixel conversion. */ write_dpr (accel,DE_PITCH , - ((d_pitch / Bpp <<DE_PITCH_DESTINATION_SHIFT ) & + ((d_pitch / bpp <<DE_PITCH_DESTINATION_SHIFT ) &DE_PITCH_DESTINATION_MASK ) | - (s_pitch / Bpp &DE_PITCH_SOURCE_MASK ));/* dpr10 */ + (s_pitch / bpp &DE_PITCH_SOURCE_MASK ));/* dpr10 */ /* * Screen Window width in Pixels.
@@ -259,9 +259,9 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* for a given point. */ write_dpr (accel,DE_WINDOW_WIDTH , - ((d_pitch / Bpp <<DE_WINDOW_WIDTH_DST_SHIFT ) & + ((d_pitch / bpp <<DE_WINDOW_WIDTH_DST_SHIFT ) &DE_WINDOW_WIDTH_DST_MASK ) | - (s_pitch / Bpp &DE_WINDOW_WIDTH_SRC_MASK ));/* dpr3c */ + (s_pitch / bpp &DE_WINDOW_WIDTH_SRC_MASK ));/* dpr3c */ if (accel->de_wait () !=0 )return -1 ;
Signature · 1 line
2.49.0.1151.ga128411c76-goog
Greg KH
maintainerRe: [PATCH 5/6] staging: sm750fb: rename `Bpp` parameter
Quoted 13 lines · Eric Florin
Rename
Bpptobppinsm750_hw_copyareato conform with kernel style guidelines.Signed-off-by Eric Florin <[email protected]>--- drivers/staging/sm750fb/sm750_accel.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/staging/sm750fb/sm750_accel.c +0
-0
drivers/staging/sm750fb/sm750_accel.c int sm750_hw_fillrect(struct lynx_accel *accel, · line 141
Quoted 5 lines
drivers/staging/sm750fb/sm750_accel.c +1
-1@@ -138,7 +138,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,* @sy: Starting y coordinate of source surface * @d_base: Address of destination: offset in frame buffer * @d_pitch: Pitch value of destination surface in BYTE -* @Bpp: Color depth of destination surface +* @bpp: Color depth of destination surface
What does "bpp" mean here? How about "dest_depth"?
PATCH 6/6 staging: sm750fb: Rename local var `nDirection`
In reply to Eric FlorinRename local variable nDirection to n_direction in sm750_hw_copyarea to conform with kernel style guidelines as reported by checkpatch.pl
CHECK: Avoid CamelCase: <nDirection>
--- drivers/staging/sm750fb/sm750_accel.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/sm750fb/sm750_accel.c +8 -8
@@ -153,9 +153,9 @@ int sm750_hw_copyarea(struct lynx_accel *accel, unsigned int width, unsigned int height, unsigned int rop2) { - unsigned int nDirection, de_ctrl; + unsigned int n_direction, de_ctrl; - nDirection =LEFT_TO_RIGHT ; + n_direction =LEFT_TO_RIGHT ;/* Direction of ROP2 operation: 1 = Left to Right, (-1) = Right to Left */ de_ctrl =0 ;
@@ -173,7 +173,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* +----------+ */ - nDirection =BOTTOM_TO_TOP ; + n_direction =BOTTOM_TO_TOP ; }else if (sy > dy) {/* +----------+ * |D |
@@ -185,7 +185,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* +----------+ */ - nDirection =TOP_TO_BOTTOM ; + n_direction =TOP_TO_BOTTOM ; }else {/* sy == dy */
@@ -198,7 +198,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* +------+---+------+ */ - nDirection =RIGHT_TO_LEFT ; + n_direction =RIGHT_TO_LEFT ; }else {/* sx > dx */
@@ -210,12 +210,12 @@ int sm750_hw_copyarea(struct lynx_accel *accel,* +------+---+------+ */ - nDirection =LEFT_TO_RIGHT ; + n_direction =LEFT_TO_RIGHT ; } } } -if ((nDirection ==BOTTOM_TO_TOP ) || (nDirection ==RIGHT_TO_LEFT )) { +if ((n_direction ==BOTTOM_TO_TOP ) || (n_direction ==RIGHT_TO_LEFT )) { sx += width -1 ; sy += height -1 ; dx += width -1 ;
@@ -277,7 +277,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */ de_ctrl = (rop2 &DE_CONTROL_ROP_MASK ) |DE_CONTROL_ROP_SELECT | - ((nDirection ==RIGHT_TO_LEFT ) ?DE_CONTROL_DIRECTION :0 ) | + ((n_direction ==RIGHT_TO_LEFT ) ?DE_CONTROL_DIRECTION :0 ) |DE_CONTROL_COMMAND_BITBLT |DE_CONTROL_STATUS ;write_dpr (accel,DE_CONTROL , de_ctrl);/* dpr0c */
Signature · 1 line
2.49.0.1151.ga128411c76-goog
Greg KH
maintainerRe: [PATCH 6/6] staging: sm750fb: Rename local var `nDirection`
Quoted 16 lines · Eric Florin
Rename local variable
nDirectionton_directioninsm750_hw_copyareato conform with kernel style guidelines as reported by checkpatch.plCHECK: Avoid CamelCase: <nDirection>
Signed-off-by Eric Florin <[email protected]>--- drivers/staging/sm750fb/sm750_accel.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)drivers/staging/sm750fb/sm750_accel.c +0
-0
drivers/staging/sm750fb/sm750_accel.c int sm750_hw_copyarea(struct lynx_accel *accel, · line 156
Quoted 5 lines
drivers/staging/sm750fb/sm750_accel.c +1
-1@@ -153,9 +153,9 @@ int sm750_hw_copyarea(struct lynx_accel *accel, unsigned int width, unsigned int height, unsigned int rop2) { - unsigned int nDirection, de_ctrl; + unsigned int n_direction, de_ctrl;
Why keep the "n" at all?