Skip to contentSkip to conversation

staging: sm750fb: convert nDirection to snake_case

PATCH In review RachelOvrani 2 participants 3 messages Feb 11 – Feb 12 1 message not in the archive

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

PATCH 1/1 staging: sm750fb: convert nDirection to snake_case

Convert the variable 'nDirection' to 'n_direction' in drivers/staging/sm750fb/sm750_accel.c to comply with Linux kernel coding style guidelines.

Checked with checkpatch.pl --strict: no warnings, no errors

---
 drivers/staging/sm750fb/sm750_accel.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/sm750fb/sm750_accel.c +8 -8
index 046b9282b..e1877e5d0 100644
@@ -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.43.0
#1 lore raw
Quoted 8 lines · RachelOvrani

Convert the variable 'nDirection' to 'n_direction' in drivers/staging/sm750fb/sm750_accel.c to comply with Linux kernel coding style guidelines.

Checked with checkpatch.pl --strict: no warnings, no errors

---

What does the n_ stand for? You can probably remove it?

regards,
dan carpenter

A message that is not in the archive (sent off-list or not yet received): CAPs_yZVzsHMqiMwWqM7m_7q9CRGDwRcHiAbx4VModZnCNzc0fQ@mail.gmail.com

#3 lore raw
Quoted 7 lines · Rachel Ovrani

Thank you for the review!

The 'n_' prefix stands for "new" - the variable holds a newly calculated direction value based on the overlap between source and destination regions.

That said, if you think 'direction' would be clearer, I'm happy to submit a v2 removing the prefix.

I would have never guessed it was new_. Normally n_ means number and I couldn't think of any meaning in Hungarian notation. Naming it "new_direction" is even better.

regards,
dan carpenter