CC: kbuild-...@lists.01.org
BCC: l...@intel.com
In-Reply-To: <20220313192952.12058-2-tzimmerm...@suse.de>
References: <20220313192952.12058-2-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: 7 hours ago
:::::: commit date: 7 hours ago
config: i386-randconfig-m021 
(https://download.01.org/0day-ci/archive/20220314/202203141008.l3jtrr7u-...@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/sysimgblt.c:274 fast_imageblit() error: uninitialized 
symbol 'j'.

vim +/j +274 drivers/video/fbdev/core/sysimgblt.c

68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  177  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  178  /*
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  179   * fast_imageblit - optimized monochrome color expansion
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  180   *
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  181   * Only if:  bits_per_pixel == 8, 16, or 32
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  182   *           image->width is divisible by pixel/dword (ppw);
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  183   *           fix->line_legth is divisible by 4;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  184   *           beginning and end of a scanline is dword aligned
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  185   */
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  186  static void fast_imageblit(const struct fb_image *image, 
struct fb_info *p,
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  187                                    void *dst1, u32 fgcolor, u32 
bgcolor)
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  188  {
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  189          u32 fgx = fgcolor, bgx = bgcolor, bpp = 
p->var.bits_per_pixel;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  190          u32 ppw = 32/bpp, spitch = (image->width + 7)/8;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  191          u32 bit_mask, eorx, shift;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  192          const char *s = image->data, *src;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  193          u32 *dst;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  194          const u32 *tab;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  195          size_t tablen;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  196          u32 colortab[16];
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  197          int i, j, k;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  198  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  199          switch (bpp) {
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  200          case 8:
e4c690e061b909 drivers/video/sysimgblt.c            Anton Vorontsov    
2008-04-28  201                  tab = fb_be_math(p) ? cfb_tab8_be : 
cfb_tab8_le;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  202                  tablen = 16;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  203                  break;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  204          case 16:
e4c690e061b909 drivers/video/sysimgblt.c            Anton Vorontsov    
2008-04-28  205                  tab = fb_be_math(p) ? cfb_tab16_be : 
cfb_tab16_le;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  206                  tablen = 4;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  207                  break;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  208          case 32:
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  209                  tab = cfb_tab32;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  210                  tablen = 2;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  211                  break;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  212          default:
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  213                  return;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  214          }
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  215  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  216          for (i = ppw-1; i--; ) {
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  217                  fgx <<= bpp;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  218                  bgx <<= bpp;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  219                  fgx |= fgcolor;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  220                  bgx |= bgcolor;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  221          }
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  222  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  223          bit_mask = (1 << ppw) - 1;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  224          eorx = fgx ^ bgx;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  225          k = image->width/ppw;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  226  
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  227          for (i = 0; i < tablen; ++i)
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  228                  colortab[i] = (tab[i] & eorx) ^ bgx;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  229  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  230          for (i = image->height; i--; ) {
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  231                  dst = dst1;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  232                  shift = 8;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  233                  src = s;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  234  
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  235                  /*
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  236                   * Manually unroll the per-line copying loop 
for better
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  237                   * performance. This works until we processed 
the last
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  238                   * completely filled source byte (inclusive).
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  239                   */
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  240                  switch (ppw) {
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  241                  case 4: /* 8 bpp */
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  242                          for (j = k; j >= 2; j -= 2, ++src) {
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  243                                  *dst++ = colortab[(*src >> 4) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  244                                  *dst++ = colortab[(*src >> 0) 
& bit_mask];
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  245                          }
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  246                          break;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  247                  case 2: /* 16 bpp */
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  248                          for (j = k; j >= 4; j -= 4, ++src) {
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  249                                  *dst++ = colortab[(*src >> 6) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  250                                  *dst++ = colortab[(*src >> 4) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  251                                  *dst++ = colortab[(*src >> 2) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  252                                  *dst++ = colortab[(*src >> 0) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  253                          }
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  254                          break;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  255                  case 1: /* 32 bpp */
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  256                          for (j = k; j >= 8; j -= 8, ++src) {
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  257                                  *dst++ = colortab[(*src >> 7) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  258                                  *dst++ = colortab[(*src >> 6) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  259                                  *dst++ = colortab[(*src >> 5) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  260                                  *dst++ = colortab[(*src >> 4) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  261                                  *dst++ = colortab[(*src >> 3) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  262                                  *dst++ = colortab[(*src >> 2) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  263                                  *dst++ = colortab[(*src >> 1) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  264                                  *dst++ = colortab[(*src >> 0) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  265                          }
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  266                          break;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  267                  }
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  268  
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  269                  /*
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  270                   * For image widths that are not a multiple of 
8, there
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  271                   * are trailing pixels left on the current 
line. Print
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  272                   * them as well.
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  273                   */
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13 @274                  for (; j--; ) {
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  275                          shift -= ppw;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  276                          *dst++ = colortab[(*src >> shift) & 
bit_mask];
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  277                          if (!shift) {
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  278                                  shift = 8;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  279                                  ++src;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  280                          }
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  281                  }
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  282  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  283                  dst1 += p->fix.line_length;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  284                  s += spitch;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  285          }
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  286  }
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  287  

---
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