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

video: fbdev: Fix multiple style issues in xilinxfb

All reported by from checkpatch
./scripts/checkpatch.pl --max-line-length 120 -strict -f
drivers/video/fbdev/xilinxfb.c

WARNING: Block comments should align the * on each line
WARNING: Block comments use a trailing */ on a separate line
WARNING: Block comments use * on subsequent lines
WARNING: please, no space before tabs
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: braces {} are not necessary for single statement blocks
WARNING: Missing a blank line after declarations
WARNING: struct of_device_id should normally be const
CHECK: Please don't use multiple blank lines
CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Alignment should match open parenthesis
CHECK: 'Endianess' may be misspelled - perhaps 'Endianness'?
CHECK: spaces preferred around that '*' (ctx:VxV)
ERROR: that open brace { should be on the previous line

Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Cc: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Hyun Kwon and committed by
Bartlomiej Zolnierkiewicz
00a0af9a 69de8496

+28 -28
+28 -28
drivers/video/fbdev/xilinxfb.c
··· 41 41 42 42 #define DRIVER_NAME "xilinxfb" 43 43 44 - 45 44 /* 46 45 * Xilinx calls it "TFT LCD Controller" though it can also be used for 47 46 * the VGA port on the Xilinx ML40x board. This is a hardware display ··· 91 92 u32 xvirt, yvirt; /* resolution of memory buffer */ 92 93 93 94 /* Physical address of framebuffer memory; If non-zero, driver 94 - * will use provided memory address instead of allocating one from 95 - * the consistent pool. */ 95 + * will use provided memory address instead of allocating one from 96 + * the consistent pool. 97 + */ 96 98 u32 fb_phys; 97 99 }; 98 100 ··· 128 128 .activate = FB_ACTIVATE_NOW 129 129 }; 130 130 131 - 132 131 #define BUS_ACCESS_FLAG 0x1 /* 1 = BUS, 0 = DCR */ 133 132 #define LITTLE_ENDIAN_ACCESS 0x2 /* LITTLE ENDIAN IO functions */ 134 133 135 134 struct xilinxfb_drvdata { 136 - 137 135 struct fb_info info; /* FB driver info record */ 138 136 139 137 phys_addr_t regs_phys; /* phys. address of the control 140 - registers */ 138 + * registers 139 + */ 141 140 void __iomem *regs; /* virt. address of the control 142 - registers */ 141 + * registers 142 + */ 143 143 #ifdef CONFIG_PPC_DCR 144 144 dcr_host_t dcr_host; 145 145 unsigned int dcr_len; ··· 148 148 dma_addr_t fb_phys; /* phys. address of the frame buffer */ 149 149 int fb_alloced; /* Flag, was the fb memory alloced? */ 150 150 151 - u8 flags; /* features of the driver */ 151 + u8 flags; /* features of the driver */ 152 152 153 153 u32 reg_ctrl_default; 154 154 ··· 165 165 * which bus its connected and call the appropriate write API. 166 166 */ 167 167 static void xilinx_fb_out32(struct xilinxfb_drvdata *drvdata, u32 offset, 168 - u32 val) 168 + u32 val) 169 169 { 170 170 if (drvdata->flags & BUS_ACCESS_FLAG) { 171 171 if (drvdata->flags & LITTLE_ENDIAN_ACCESS) ··· 195 195 } 196 196 197 197 static int 198 - xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, 199 - unsigned transp, struct fb_info *fbi) 198 + xilinx_fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, 199 + unsigned int blue, unsigned int transp, struct fb_info *fbi) 200 200 { 201 201 u32 *palette = fbi->pseudo_palette; 202 202 ··· 205 205 206 206 if (fbi->var.grayscale) { 207 207 /* Convert color to grayscale. 208 - * grayscale = 0.30*R + 0.59*G + 0.11*B */ 209 - red = green = blue = 210 - (red * 77 + green * 151 + blue * 28 + 127) >> 8; 208 + * grayscale = 0.30*R + 0.59*G + 0.11*B 209 + */ 210 + blue = (red * 77 + green * 151 + blue * 28 + 127) >> 8; 211 + green = blue; 212 + red = green; 211 213 } 212 214 213 215 /* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */ ··· 243 241 xilinx_fb_out32(drvdata, REG_CTRL, 0); 244 242 default: 245 243 break; 246 - 247 244 } 248 245 return 0; /* success */ 249 246 } 250 247 251 - static struct fb_ops xilinxfb_ops = 252 - { 248 + static struct fb_ops xilinxfb_ops = { 253 249 .owner = THIS_MODULE, 254 250 .fb_setcolreg = xilinx_fb_setcolreg, 255 251 .fb_blank = xilinx_fb_blank, ··· 286 286 } else { 287 287 drvdata->fb_alloced = 1; 288 288 drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize), 289 - &drvdata->fb_phys, GFP_KERNEL); 289 + &drvdata->fb_phys, 290 + GFP_KERNEL); 290 291 } 291 292 292 293 if (!drvdata->fb_virt) { ··· 301 300 /* Tell the hardware where the frame buffer is */ 302 301 xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); 303 302 rc = xilinx_fb_in32(drvdata, REG_FB_ADDR); 304 - /* Endianess detection */ 303 + /* Endianness detection */ 305 304 if (rc != drvdata->fb_phys) { 306 305 drvdata->flags |= LITTLE_ENDIAN_ACCESS; 307 306 xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); ··· 311 310 drvdata->reg_ctrl_default = REG_CTRL_ENABLE; 312 311 if (pdata->rotate_screen) 313 312 drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; 314 - xilinx_fb_out32(drvdata, REG_CTRL, 315 - drvdata->reg_ctrl_default); 313 + xilinx_fb_out32(drvdata, REG_CTRL, drvdata->reg_ctrl_default); 316 314 317 315 /* Fill struct fb_info */ 318 316 drvdata->info.device = dev; ··· 364 364 err_cmap: 365 365 if (drvdata->fb_alloced) 366 366 dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt, 367 - drvdata->fb_phys); 367 + drvdata->fb_phys); 368 368 else 369 369 iounmap(drvdata->fb_virt); 370 370 ··· 435 435 * Fill the resource structure if its direct BUS interface 436 436 * otherwise fill the dcr_host structure. 437 437 */ 438 - if (tft_access) { 438 + if (tft_access) 439 439 drvdata->flags |= BUS_ACCESS_FLAG; 440 - } 441 440 #ifdef CONFIG_PPC_DCR 442 441 else { 443 442 int start; 443 + 444 444 start = dcr_resource_start(pdev->dev.of_node, 0); 445 445 drvdata->dcr_len = dcr_resource_len(pdev->dev.of_node, 0); 446 446 drvdata->dcr_host = dcr_map(pdev->dev.of_node, start, drvdata->dcr_len); ··· 452 452 #endif 453 453 454 454 prop = of_get_property(pdev->dev.of_node, "phys-size", &size); 455 - if ((prop) && (size >= sizeof(u32)*2)) { 455 + if ((prop) && (size >= sizeof(u32) * 2)) { 456 456 pdata.screen_width_mm = prop[0]; 457 457 pdata.screen_height_mm = prop[1]; 458 458 } 459 459 460 460 prop = of_get_property(pdev->dev.of_node, "resolution", &size); 461 - if ((prop) && (size >= sizeof(u32)*2)) { 461 + if ((prop) && (size >= sizeof(u32) * 2)) { 462 462 pdata.xres = prop[0]; 463 463 pdata.yres = prop[1]; 464 464 } 465 465 466 466 prop = of_get_property(pdev->dev.of_node, "virtual-resolution", &size); 467 - if ((prop) && (size >= sizeof(u32)*2)) { 467 + if ((prop) && (size >= sizeof(u32) * 2)) { 468 468 pdata.xvirt = prop[0]; 469 469 pdata.yvirt = prop[1]; 470 470 } ··· 482 482 } 483 483 484 484 /* Match table for of_platform binding */ 485 - static struct of_device_id xilinxfb_of_match[] = { 485 + static const struct of_device_id xilinxfb_of_match[] = { 486 486 { .compatible = "xlnx,xps-tft-1.00.a", }, 487 487 { .compatible = "xlnx,xps-tft-2.00.a", }, 488 488 { .compatible = "xlnx,xps-tft-2.01.a", },