Hi Kees, I love your patch! Perhaps something to improve: [auto build test WARNING on staging/staging-testing] [also build test WARNING on linus/master v5.14-rc3] [cannot apply to wireless-drivers-next/master wireless-drivers/master next-20210730] [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/Kees-Cook/Introduce-strict-memcpy-bounds-checking/20210728-053749 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 39f9137268ee3df0047706df4e9b7357a40ffc98 config: x86_64-randconfig-s021-20210728 (attached as .config) compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.3-341-g8af24329-dirty # https://github.com/0day-ci/linux/commit/ebf3f346baf4e0ddaf9e36fc6041bdc9ac43c3ed git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Kees-Cook/Introduce-strict-memcpy-bounds-checking/20210728-053749 git checkout ebf3f346baf4e0ddaf9e36fc6041bdc9ac43c3ed # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> drivers/video/fbdev/hgafb.c:496:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] dest @@ drivers/video/fbdev/hgafb.c:496:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:496:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] dest >> drivers/video/fbdev/hgafb.c:496:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] src @@ drivers/video/fbdev/hgafb.c:496:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:496:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] src >> drivers/video/fbdev/hgafb.c:496:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] dest @@ drivers/video/fbdev/hgafb.c:496:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:496:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] dest >> drivers/video/fbdev/hgafb.c:496:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] src @@ drivers/video/fbdev/hgafb.c:496:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:496:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] src >> drivers/video/fbdev/hgafb.c:496:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] dest @@ drivers/video/fbdev/hgafb.c:496:25: sparse: expected void * drivers/video/fbdev/hgafb.c:496:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] dest drivers/video/fbdev/hgafb.c:496:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] src @@ drivers/video/fbdev/hgafb.c:496:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:496:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] src drivers/video/fbdev/hgafb.c:507:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] dest @@ drivers/video/fbdev/hgafb.c:507:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:507:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] dest drivers/video/fbdev/hgafb.c:507:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] src @@ drivers/video/fbdev/hgafb.c:507:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:507:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] src drivers/video/fbdev/hgafb.c:507:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] dest @@ drivers/video/fbdev/hgafb.c:507:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:507:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] dest drivers/video/fbdev/hgafb.c:507:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] src @@ drivers/video/fbdev/hgafb.c:507:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:507:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] src drivers/video/fbdev/hgafb.c:507:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] dest @@ drivers/video/fbdev/hgafb.c:507:25: sparse: expected void * drivers/video/fbdev/hgafb.c:507:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] dest drivers/video/fbdev/hgafb.c:507:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *[assigned] src @@ drivers/video/fbdev/hgafb.c:507:25: sparse: expected void const * drivers/video/fbdev/hgafb.c:507:25: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] src vim +496 drivers/video/fbdev/hgafb.c ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 482 ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 483 static void hgafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 484 { ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 485 u_int rows, y1, y2; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 486 u8 __iomem *src; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 487 u8 __iomem *dest; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 488 ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 489 if (area->dy <= area->sy) { ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 490 y1 = area->sy; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 491 y2 = area->dy; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 492 ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 493 for (rows = area->height; rows--; ) { ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 494 src = rowaddr(info, y1) + (area->sx >> 3); ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 495 dest = rowaddr(info, y2) + (area->dx >> 3); 529ed806d4540d drivers/video/hgafb.c Brent Cook 2010-12-31 @496 memmove(dest, src, (area->width >> 3)); ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 497 y1++; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 498 y2++; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 499 } ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 500 } else { ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 501 y1 = area->sy + area->height - 1; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 502 y2 = area->dy + area->height - 1; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 503 ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 504 for (rows = area->height; rows--;) { ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 505 src = rowaddr(info, y1) + (area->sx >> 3); ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 506 dest = rowaddr(info, y2) + (area->dx >> 3); 529ed806d4540d drivers/video/hgafb.c Brent Cook 2010-12-31 507 memmove(dest, src, (area->width >> 3)); ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 508 y1--; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 509 y2--; ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 510 } ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 511 } ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 512 } ^1da177e4c3f41 drivers/video/hgafb.c Linus Torvalds 2005-04-16 513 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org