Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

staging: sm750fb: Clean up variable names

Variables in sm750_accel.c follow a mix of camelCase convention
and Hungarian shorthands. Rename it to adhere to kernel's snake_case
naming convention and improve readability.

Signed-off-by: Christine Ramacha <christine.rv4573@gmail.com>
Link: https://patch.msgid.link/20260204145107.5521-1-christine.rv4573@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Christine Ramacha and committed by
Greg Kroah-Hartman
ab67d4c6 41460a19

+58 -58
+58 -58
drivers/staging/sm750fb/sm750_accel.c
··· 27 27 return readl(accel->dpr_base + offset); 28 28 } 29 29 30 - static inline void write_dpPort(struct lynx_accel *accel, u32 data) 30 + static inline void write_dp_port(struct lynx_accel *accel, u32 data) 31 31 { 32 32 writel(data, accel->dp_port_base); 33 33 } ··· 132 132 /** 133 133 * sm750_hw_copyarea 134 134 * @accel: Acceleration device data 135 - * @sBase: Address of source: offset in frame buffer 136 - * @sPitch: Pitch value of source surface in BYTE 135 + * @source_base: Address of source: offset in frame buffer 136 + * @source_pitch: Pitch value of source surface in BYTE 137 137 * @sx: Starting x coordinate of source surface 138 138 * @sy: Starting y coordinate of source surface 139 - * @dBase: Address of destination: offset in frame buffer 140 - * @dPitch: Pitch value of destination surface in BYTE 139 + * @dest_base: Address of destination: offset in frame buffer 140 + * @dest_pitch: Pitch value of destination surface in BYTE 141 141 * @Bpp: Color depth of destination surface 142 142 * @dx: Starting x coordinate of destination surface 143 143 * @dy: Starting y coordinate of destination surface ··· 146 146 * @rop2: ROP value 147 147 */ 148 148 int sm750_hw_copyarea(struct lynx_accel *accel, 149 - unsigned int sBase, unsigned int sPitch, 149 + unsigned int source_base, unsigned int source_pitch, 150 150 unsigned int sx, unsigned int sy, 151 - unsigned int dBase, unsigned int dPitch, 151 + unsigned int dest_base, unsigned int dest_pitch, 152 152 unsigned int Bpp, unsigned int dx, unsigned int dy, 153 153 unsigned int width, unsigned int height, 154 154 unsigned int rop2) 155 155 { 156 - unsigned int nDirection, de_ctrl; 156 + unsigned int direction, de_ctrl; 157 157 158 - nDirection = LEFT_TO_RIGHT; 158 + direction = LEFT_TO_RIGHT; 159 159 /* Direction of ROP2 operation: 1 = Left to Right, (-1) = Right to Left */ 160 160 de_ctrl = 0; 161 161 162 162 /* If source and destination are the same surface, need to check for overlay cases */ 163 - if (sBase == dBase && sPitch == dPitch) { 163 + if (source_base == dest_base && source_pitch == dest_pitch) { 164 164 /* Determine direction of operation */ 165 165 if (sy < dy) { 166 166 /* +----------+ ··· 173 173 * +----------+ 174 174 */ 175 175 176 - nDirection = BOTTOM_TO_TOP; 176 + direction = BOTTOM_TO_TOP; 177 177 } else if (sy > dy) { 178 178 /* +----------+ 179 179 * |D | ··· 185 185 * +----------+ 186 186 */ 187 187 188 - nDirection = TOP_TO_BOTTOM; 188 + direction = TOP_TO_BOTTOM; 189 189 } else { 190 190 /* sy == dy */ 191 191 ··· 198 198 * +------+---+------+ 199 199 */ 200 200 201 - nDirection = RIGHT_TO_LEFT; 201 + direction = RIGHT_TO_LEFT; 202 202 } else { 203 203 /* sx > dx */ 204 204 ··· 210 210 * +------+---+------+ 211 211 */ 212 212 213 - nDirection = LEFT_TO_RIGHT; 213 + direction = LEFT_TO_RIGHT; 214 214 } 215 215 } 216 216 } 217 217 218 - if ((nDirection == BOTTOM_TO_TOP) || (nDirection == RIGHT_TO_LEFT)) { 218 + if ((direction == BOTTOM_TO_TOP) || (direction == RIGHT_TO_LEFT)) { 219 219 sx += width - 1; 220 220 sy += height - 1; 221 221 dx += width - 1; ··· 234 234 * It is an address offset (128 bit aligned) 235 235 * from the beginning of frame buffer. 236 236 */ 237 - write_dpr(accel, DE_WINDOW_SOURCE_BASE, sBase); /* dpr40 */ 237 + write_dpr(accel, DE_WINDOW_SOURCE_BASE, source_base); /* dpr40 */ 238 238 239 239 /* 240 240 * 2D Destination Base. 241 241 * It is an address offset (128 bit aligned) 242 242 * from the beginning of frame buffer. 243 243 */ 244 - write_dpr(accel, DE_WINDOW_DESTINATION_BASE, dBase); /* dpr44 */ 244 + write_dpr(accel, DE_WINDOW_DESTINATION_BASE, dest_base); /* dpr44 */ 245 245 246 246 /* 247 247 * Program pitch (distance between the 1st points of two adjacent lines). ··· 249 249 * pixel values. Need Byte to pixel conversion. 250 250 */ 251 251 write_dpr(accel, DE_PITCH, 252 - ((dPitch / Bpp << DE_PITCH_DESTINATION_SHIFT) & 252 + ((dest_pitch / Bpp << DE_PITCH_DESTINATION_SHIFT) & 253 253 DE_PITCH_DESTINATION_MASK) | 254 - (sPitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */ 254 + (source_pitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */ 255 255 256 256 /* 257 257 * Screen Window width in Pixels. ··· 259 259 * for a given point. 260 260 */ 261 261 write_dpr(accel, DE_WINDOW_WIDTH, 262 - ((dPitch / Bpp << DE_WINDOW_WIDTH_DST_SHIFT) & 262 + ((dest_pitch / Bpp << DE_WINDOW_WIDTH_DST_SHIFT) & 263 263 DE_WINDOW_WIDTH_DST_MASK) | 264 - (sPitch / Bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr3c */ 264 + (source_pitch / Bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr3c */ 265 265 266 266 if (accel->de_wait() != 0) 267 267 return -1; ··· 277 277 (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */ 278 278 279 279 de_ctrl = (rop2 & DE_CONTROL_ROP_MASK) | DE_CONTROL_ROP_SELECT | 280 - ((nDirection == RIGHT_TO_LEFT) ? DE_CONTROL_DIRECTION : 0) | 280 + ((direction == RIGHT_TO_LEFT) ? DE_CONTROL_DIRECTION : 0) | 281 281 DE_CONTROL_COMMAND_BITBLT | DE_CONTROL_STATUS; 282 282 write_dpr(accel, DE_CONTROL, de_ctrl); /* dpr0c */ 283 283 ··· 299 299 /** 300 300 * sm750_hw_imageblit 301 301 * @accel: Acceleration device data 302 - * @pSrcbuf: pointer to start of source buffer in system memory 303 - * @srcDelta: Pitch value (in bytes) of the source buffer, +ive means top down 302 + * @src_buf: pointer to start of source buffer in system memory 303 + * @src_delta: Pitch value (in bytes) of the source buffer, +ive means top down 304 304 * and -ive mean button up 305 - * @startBit: Mono data can start at any bit in a byte, this value should be 305 + * @start_bit: Mono data can start at any bit in a byte, this value should be 306 306 * 0 to 7 307 - * @dBase: Address of destination: offset in frame buffer 308 - * @dPitch: Pitch value of destination surface in BYTE 309 - * @bytePerPixel: Color depth of destination surface 307 + * @dest_base: Address of destination: offset in frame buffer 308 + * @dest_pitch: Pitch value of destination surface in BYTE 309 + * @byte_per_pixel: Color depth of destination surface 310 310 * @dx: Starting x coordinate of destination surface 311 311 * @dy: Starting y coordinate of destination surface 312 312 * @width: width of rectangle in pixel value 313 313 * @height: height of rectangle in pixel value 314 - * @fColor: Foreground color (corresponding to a 1 in the monochrome data 315 - * @bColor: Background color (corresponding to a 0 in the monochrome data 314 + * @fg_color: Foreground color (corresponding to a 1 in the monochrome data 315 + * @bg_color: Background color (corresponding to a 0 in the monochrome data 316 316 * @rop2: ROP value 317 317 */ 318 - int sm750_hw_imageblit(struct lynx_accel *accel, const char *pSrcbuf, 319 - u32 srcDelta, u32 startBit, u32 dBase, u32 dPitch, 320 - u32 bytePerPixel, u32 dx, u32 dy, u32 width, 321 - u32 height, u32 fColor, u32 bColor, u32 rop2) 318 + int sm750_hw_imageblit(struct lynx_accel *accel, const char *src_buf, 319 + u32 src_delta, u32 start_bit, u32 dest_base, u32 dest_pitch, 320 + u32 byte_per_pixel, u32 dx, u32 dy, u32 width, 321 + u32 height, u32 fg_color, u32 bg_color, u32 rop2) 322 322 { 323 - unsigned int ulBytesPerScan; 324 - unsigned int ul4BytesPerScan; 325 - unsigned int ulBytesRemain; 323 + unsigned int bytes_per_scan; 324 + unsigned int words_per_scan; 325 + unsigned int bytes_remain; 326 326 unsigned int de_ctrl = 0; 327 - unsigned char ajRemain[4]; 327 + unsigned char remain[4]; 328 328 int i, j; 329 329 330 - startBit &= 7; /* Just make sure the start bit is within legal range */ 331 - ulBytesPerScan = (width + startBit + 7) / 8; 332 - ul4BytesPerScan = ulBytesPerScan & ~3; 333 - ulBytesRemain = ulBytesPerScan & 3; 330 + start_bit &= 7; /* Just make sure the start bit is within legal range */ 331 + bytes_per_scan = (width + start_bit + 7) / 8; 332 + words_per_scan = bytes_per_scan & ~3; 333 + bytes_remain = bytes_per_scan & 3; 334 334 335 335 if (accel->de_wait() != 0) 336 336 return -1; ··· 345 345 * It is an address offset (128 bit aligned) 346 346 * from the beginning of frame buffer. 347 347 */ 348 - write_dpr(accel, DE_WINDOW_DESTINATION_BASE, dBase); 348 + write_dpr(accel, DE_WINDOW_DESTINATION_BASE, dest_base); 349 349 350 350 /* 351 351 * Program pitch (distance between the 1st points of two adjacent ··· 353 353 * register uses pixel values. Need Byte to pixel conversion. 354 354 */ 355 355 write_dpr(accel, DE_PITCH, 356 - ((dPitch / bytePerPixel << DE_PITCH_DESTINATION_SHIFT) & 356 + ((dest_pitch / byte_per_pixel << DE_PITCH_DESTINATION_SHIFT) & 357 357 DE_PITCH_DESTINATION_MASK) | 358 - (dPitch / bytePerPixel & DE_PITCH_SOURCE_MASK)); /* dpr10 */ 358 + (dest_pitch / byte_per_pixel & DE_PITCH_SOURCE_MASK)); /* dpr10 */ 359 359 360 360 /* 361 361 * Screen Window width in Pixels. ··· 363 363 * in frame buffer for a given point. 364 364 */ 365 365 write_dpr(accel, DE_WINDOW_WIDTH, 366 - ((dPitch / bytePerPixel << DE_WINDOW_WIDTH_DST_SHIFT) & 366 + ((dest_pitch / byte_per_pixel << DE_WINDOW_WIDTH_DST_SHIFT) & 367 367 DE_WINDOW_WIDTH_DST_MASK) | 368 - (dPitch / bytePerPixel & DE_WINDOW_WIDTH_SRC_MASK)); 368 + (dest_pitch / byte_per_pixel & DE_WINDOW_WIDTH_SRC_MASK)); 369 369 370 370 /* 371 371 * Note: For 2D Source in Host Write, only X_K1_MONO field is needed, 372 372 * and Y_K2 field is not used. 373 - * For mono bitmap, use startBit for X_K1. 373 + * For mono bitmap, use start_bit for X_K1. 374 374 */ 375 375 write_dpr(accel, DE_SOURCE, 376 - (startBit << DE_SOURCE_X_K1_SHIFT) & 376 + (start_bit << DE_SOURCE_X_K1_SHIFT) & 377 377 DE_SOURCE_X_K1_MONO_MASK); /* dpr00 */ 378 378 379 379 write_dpr(accel, DE_DESTINATION, ··· 384 384 ((width << DE_DIMENSION_X_SHIFT) & DE_DIMENSION_X_MASK) | 385 385 (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */ 386 386 387 - write_dpr(accel, DE_FOREGROUND, fColor); 388 - write_dpr(accel, DE_BACKGROUND, bColor); 387 + write_dpr(accel, DE_FOREGROUND, fg_color); 388 + write_dpr(accel, DE_BACKGROUND, bg_color); 389 389 390 390 de_ctrl = (rop2 & DE_CONTROL_ROP_MASK) | 391 391 DE_CONTROL_ROP_SELECT | DE_CONTROL_COMMAND_HOST_WRITE | ··· 396 396 /* Write MONO data (line by line) to 2D Engine data port */ 397 397 for (i = 0; i < height; i++) { 398 398 /* For each line, send the data in chunks of 4 bytes */ 399 - for (j = 0; j < (ul4BytesPerScan / 4); j++) 400 - write_dpPort(accel, *(unsigned int *)(pSrcbuf + (j * 4))); 399 + for (j = 0; j < (words_per_scan / 4); j++) 400 + write_dp_port(accel, *(unsigned int *)(src_buf + (j * 4))); 401 401 402 - if (ulBytesRemain) { 403 - memcpy(ajRemain, pSrcbuf + ul4BytesPerScan, 404 - ulBytesRemain); 405 - write_dpPort(accel, *(unsigned int *)ajRemain); 402 + if (bytes_remain) { 403 + memcpy(remain, src_buf + words_per_scan, 404 + bytes_remain); 405 + write_dp_port(accel, *(unsigned int *)remain); 406 406 } 407 407 408 - pSrcbuf += srcDelta; 408 + src_buf += src_delta; 409 409 } 410 410 411 411 return 0;