CC: kbuild-...@lists.01.org
BCC: l...@intel.com
In-Reply-To: <20220313192952.12058-3-tzimmerm...@suse.de>
References: <20220313192952.12058-3-tzimmerm...@suse.de>
TO: Thomas Zimmermann <tzimmerm...@suse.de>
TO: dan...@ffwll.ch
TO: del...@gmx.de
TO: m.szyprow...@samsung.com
TO: ge...@linux-m68k.org
TO: javi...@redhat.com
TO: s...@ravnborg.org
CC: linux-fb...@vger.kernel.org
CC: dri-de...@lists.freedesktop.org
CC: Thomas Zimmermann <tzimmerm...@suse.de>

Hi Thomas,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20220310]
[cannot apply to linus/master v5.17-rc7 v5.17-rc6 v5.17-rc5 v5.17-rc8]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/fbdev-Fix-image-blitting-for-arbitrary-image-widths/20220314-033209
base:    71941773e143369a73c9c4a3b62fbb60736a1182
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: i386-randconfig-m021 
(https://download.01.org/0day-ci/archive/20220314/202203141119.bzsawa1k-...@intel.com/config)
compiler: gcc-9 (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <l...@intel.com>
Reported-by: Dan Carpenter <dan.carpen...@oracle.com>

smatch warnings:
drivers/video/fbdev/core/cfbimgblt.c:304 fast_imageblit() error: uninitialized 
symbol 'j'.

vim +/j +304 drivers/video/fbdev/core/cfbimgblt.c

^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  206  
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  207  /*
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  208   * fast_imageblit - optimized monochrome color expansion
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  209   *
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  210   * Only if:  bits_per_pixel == 8, 16, or 32
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  211   *           image->width is divisible by pixel/dword (ppw);
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  212   *           fix->line_legth is divisible by 4;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  213   *           beginning and end of a scanline is dword aligned
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  214   */
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  215  static inline void fast_imageblit(const struct fb_image 
*image, struct fb_info *p,
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  216                             u8 __iomem *dst1, u32 fgcolor,
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  217                             u32 bgcolor)
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  218  {
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  219   u32 fgx = fgcolor, bgx = bgcolor, bpp = p->var.bits_per_pixel;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  220   u32 ppw = 32/bpp, spitch = (image->width + 7)/8;
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  221   u32 bit_mask, eorx, shift;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  222   const char *s = image->data, *src;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  223   u32 __iomem *dst;
d95159cf1b12e8 drivers/video/cfbimgblt.c            Helge Deller      
2006-12-08  224   const u32 *tab = NULL;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  225   size_t tablen;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  226   u32 colortab[16];
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  227   int i, j, k;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  228  
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  229   switch (bpp) {
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  230   case 8:
e4c690e061b909 drivers/video/cfbimgblt.c            Anton Vorontsov   
2008-04-28  231           tab = fb_be_math(p) ? cfb_tab8_be : cfb_tab8_le;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  232           tablen = 16;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  233           break;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  234   case 16:
e4c690e061b909 drivers/video/cfbimgblt.c            Anton Vorontsov   
2008-04-28  235           tab = fb_be_math(p) ? cfb_tab16_be : cfb_tab16_le;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  236           tablen = 4;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  237           break;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  238   case 32:
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  239           tab = cfb_tab32;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  240           tablen = 2;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  241           break;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  242   default:
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  243           return;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  244   }
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  245  
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  246   for (i = ppw-1; i--; ) {
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  247           fgx <<= bpp;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  248           bgx <<= bpp;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  249           fgx |= fgcolor;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  250           bgx |= bgcolor;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  251   }
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  252  
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  253   bit_mask = (1 << ppw) - 1;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  254   eorx = fgx ^ bgx;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  255   k = image->width/ppw;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  256  
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  257   for (i = 0; i < tablen; ++i)
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  258           colortab[i] = (tab[i] & eorx) ^ bgx;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  259  
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  260   for (i = image->height; i--; ) {
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  261           dst = (u32 __iomem *)dst1;
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  262           shift = 8;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  263           src = s;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  264  
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  265           /*
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  266            * Manually unroll the per-line copying loop for 
better
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  267            * performance. This works until we processed the last
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  268            * completely filled source byte (inclusive).
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  269            */
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  270           switch (ppw) {
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  271           case 4: /* 8 bpp */
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  272                   for (j = k; j >= 2; j -= 2, ++src) {
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  273                           FB_WRITEL(colortab[(*src >> 4) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  274                           FB_WRITEL(colortab[(*src >> 0) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  275                   }
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  276                   break;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  277           case 2: /* 16 bpp */
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  278                   for (j = k; j >= 4; j -= 4, ++src) {
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  279                           FB_WRITEL(colortab[(*src >> 6) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  280                           FB_WRITEL(colortab[(*src >> 4) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  281                           FB_WRITEL(colortab[(*src >> 2) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  282                           FB_WRITEL(colortab[(*src >> 0) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  283                   }
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  284                   break;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  285           case 1: /* 32 bpp */
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  286                   for (j = k; j >= 8; j -= 8, ++src) {
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  287                           FB_WRITEL(colortab[(*src >> 7) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  288                           FB_WRITEL(colortab[(*src >> 6) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  289                           FB_WRITEL(colortab[(*src >> 5) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  290                           FB_WRITEL(colortab[(*src >> 4) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  291                           FB_WRITEL(colortab[(*src >> 3) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  292                           FB_WRITEL(colortab[(*src >> 2) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  293                           FB_WRITEL(colortab[(*src >> 1) & 
bit_mask], dst++);
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  294                           FB_WRITEL(colortab[(*src >> 0) & 
bit_mask], dst++);
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  295                   }
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  296                   break;
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  297           }
0d03011894d232 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  298  
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  299           /*
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  300            * For image widths that are not a multiple of 8, 
there
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  301            * are trailing pixels left on the current line. Print
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  302            * them as well.
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  303            */
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13 @304           for (; j--; ) {
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  305                   shift -= ppw;
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  306                   FB_WRITEL(colortab[(*src >> shift) & 
bit_mask], dst++);
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  307                   if (!shift) {
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  308                           shift = 8;
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  309                           ++src;
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  310                   }
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  311           }
9410e2f8731c22 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  312  
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  313           dst1 += p->fix.line_length;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  314           s += spitch;
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  315   }
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  316  }
^1da177e4c3f41 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  317  

---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to