drivers/mtd/maps/vmu-flash.c:722:24: error: 'struct mtd_info' has no member named 'usecount'

From: kernel test robot
Date: Mon Oct 02 2023 - 06:24:54 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa
commit: 19bfa9ebebb5ec0695def57eb1d80de7e9cab369 mtd: use refcount to prevent corruption
date: 3 months ago
config: sh-randconfig-c034-20221009 (https://download.01.org/0day-ci/archive/20231002/202310021816.G41lF9xc-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231002/202310021816.G41lF9xc-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310021816.G41lF9xc-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from drivers/mtd/maps/vmu-flash.c:12:
include/linux/maple.h:81:23: error: field 'dev' has incomplete type
81 | struct device dev;
| ^~~
include/linux/maple.h:86:30: error: field 'drv' has incomplete type
86 | struct device_driver drv;
| ^~~
drivers/mtd/maps/vmu-flash.c: In function 'vmu_can_unload':
>> drivers/mtd/maps/vmu-flash.c:722:24: error: 'struct mtd_info' has no member named 'usecount'
722 | if (mtd->usecount > 0)
| ^~
In file included from include/linux/init.h:5,
from drivers/mtd/maps/vmu-flash.c:8:
drivers/mtd/maps/vmu-flash.c: In function 'probe_maple_vmu':
include/linux/compiler_types.h:338:27: error: expression in static assertion is not an integer
338 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/maple.h:100:25: note: in expansion of macro 'container_of'
100 | #define to_maple_dev(n) container_of(n, struct maple_device, dev)
| ^~~~~~~~~~~~
drivers/mtd/maps/vmu-flash.c:775:37: note: in expansion of macro 'to_maple_dev'
775 | struct maple_device *mdev = to_maple_dev(dev);
| ^~~~~~~~~~~~
include/linux/compiler_types.h:338:27: error: expression in static assertion is not an integer
338 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/maple.h:101:28: note: in expansion of macro 'container_of'
101 | #define to_maple_driver(n) container_of(n, struct maple_driver, drv)
| ^~~~~~~~~~~~
drivers/mtd/maps/vmu-flash.c:776:37: note: in expansion of macro 'to_maple_driver'
776 | struct maple_driver *mdrv = to_maple_driver(dev->driver);
| ^~~~~~~~~~~~~~~
drivers/mtd/maps/vmu-flash.c: In function 'remove_maple_vmu':
include/linux/compiler_types.h:338:27: error: expression in static assertion is not an integer
338 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:20:9: note: in expansion of macro 'static_assert'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/maple.h:100:25: note: in expansion of macro 'container_of'
100 | #define to_maple_dev(n) container_of(n, struct maple_device, dev)
| ^~~~~~~~~~~~
drivers/mtd/maps/vmu-flash.c:787:37: note: in expansion of macro 'to_maple_dev'
787 | struct maple_device *mdev = to_maple_dev(dev);
| ^~~~~~~~~~~~


vim +722 drivers/mtd/maps/vmu-flash.c

47a72688fae729 Adrian McMenamin 2009-03-04 709
47a72688fae729 Adrian McMenamin 2009-03-04 710 /* Callback to handle eccentricities of both mtd subsystem
47a72688fae729 Adrian McMenamin 2009-03-04 711 * and general flakyness of Dreamcast VMUs
47a72688fae729 Adrian McMenamin 2009-03-04 712 */
47a72688fae729 Adrian McMenamin 2009-03-04 713 static int vmu_can_unload(struct maple_device *mdev)
47a72688fae729 Adrian McMenamin 2009-03-04 714 {
47a72688fae729 Adrian McMenamin 2009-03-04 715 struct memcard *card;
47a72688fae729 Adrian McMenamin 2009-03-04 716 int x;
47a72688fae729 Adrian McMenamin 2009-03-04 717 struct mtd_info *mtd;
47a72688fae729 Adrian McMenamin 2009-03-04 718
47a72688fae729 Adrian McMenamin 2009-03-04 719 card = maple_get_drvdata(mdev);
47a72688fae729 Adrian McMenamin 2009-03-04 720 for (x = 0; x < card->partitions; x++) {
47a72688fae729 Adrian McMenamin 2009-03-04 721 mtd = &((card->mtd)[x]);
47a72688fae729 Adrian McMenamin 2009-03-04 @722 if (mtd->usecount > 0)
47a72688fae729 Adrian McMenamin 2009-03-04 723 return 0;
47a72688fae729 Adrian McMenamin 2009-03-04 724 }
47a72688fae729 Adrian McMenamin 2009-03-04 725 return 1;
47a72688fae729 Adrian McMenamin 2009-03-04 726 }
47a72688fae729 Adrian McMenamin 2009-03-04 727

:::::: The code at line 722 was first introduced by commit
:::::: 47a72688fae7298e1ad5fdc9bff7e04b6a549620 mtd: flash mapping support for Dreamcast VMU.

:::::: TO: Adrian McMenamin <adrian@xxxxxxxxxxxxxxxxxxxxxxxx>
:::::: CC: Paul Mundt <lethal@xxxxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki