GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
* [ammarfaizi2-block:google/android/kernel/common/android-4.19-q-release 3921/7614] drivers/md/dm-bow.c:97:10: sparse: sparse: symbol 'range_top' was not declared. Should it be static?
@ 2023-03-03 19:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-03 19:25 UTC (permalink / raw)
  To: Ammar Faizi, GNU/Weeb Mailing List; +Cc: oe-kbuild-all

tree:   https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android-4.19-q-release
head:   39793952000376f86462e9cfc33766da2aa57084
commit: 45bc7d86e7d04f8ef944ca509e225df392e36642 [3921/7614] ANDROID: dm-bow: Add dm-bow feature
config: alpha-randconfig-s052-20230302 (https://download.01.org/0day-ci/archive/20230304/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/ammarfaizi2/linux-block/commit/45bc7d86e7d04f8ef944ca509e225df392e36642
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android-4.19-q-release
        git checkout 45bc7d86e7d04f8ef944ca509e225df392e36642
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash crypto/asymmetric_keys/ drivers/md/ fs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
>> drivers/md/dm-bow.c:97:10: sparse: sparse: symbol 'range_top' was not declared. Should it be static?
>> drivers/md/dm-bow.c:148:6: sparse: sparse: symbol 'add_before' was not declared. Should it be static?
>> drivers/md/dm-bow.c:178:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:178:24: sparse:     expected int
   drivers/md/dm-bow.c:178:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:186:32: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:186:32: sparse:     expected int
   drivers/md/dm-bow.c:186:32: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:205:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:205:24: sparse:     expected int
   drivers/md/dm-bow.c:205:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:281:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:281:24: sparse:     expected int
   drivers/md/dm-bow.c:281:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:393:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:393:24: sparse:     expected int
   drivers/md/dm-bow.c:393:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:337:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:337:24: sparse:     expected int
   drivers/md/dm-bow.c:337:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:342:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:342:24: sparse:     expected int
   drivers/md/dm-bow.c:342:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:348:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:348:24: sparse:     expected int
   drivers/md/dm-bow.c:348:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:356:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:356:24: sparse:     expected int
   drivers/md/dm-bow.c:356:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:420:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:420:24: sparse:     expected int
   drivers/md/dm-bow.c:420:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:425:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:425:24: sparse:     expected int
   drivers/md/dm-bow.c:425:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:435:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:435:24: sparse:     expected int
   drivers/md/dm-bow.c:435:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:441:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:441:24: sparse:     expected int
   drivers/md/dm-bow.c:441:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:459:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:459:24: sparse:     expected int
   drivers/md/dm-bow.c:459:24: sparse:     got restricted blk_status_t [usertype]
>> drivers/md/dm-bow.c:550:53: sparse: sparse: Using plain integer as NULL pointer
   drivers/md/dm-bow.c:752:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:752:24: sparse:     expected int
   drivers/md/dm-bow.c:752:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:771:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:771:24: sparse:     expected int
   drivers/md/dm-bow.c:771:24: sparse:     got restricted blk_status_t [usertype]
   drivers/md/dm-bow.c:863:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted blk_status_t [usertype] @@
   drivers/md/dm-bow.c:863:24: sparse:     expected int
   drivers/md/dm-bow.c:863:24: sparse:     got restricted blk_status_t [usertype]
>> drivers/md/dm-bow.c:899:32: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted blk_status_t [usertype] bi_status @@     got int [assigned] ret @@
   drivers/md/dm-bow.c:899:32: sparse:     expected restricted blk_status_t [usertype] bi_status
   drivers/md/dm-bow.c:899:32: sparse:     got int [assigned] ret
>> drivers/md/dm-bow.c:1025:5: sparse: sparse: symbol 'remap_unless_illegal_trim' was not declared. Should it be static?
>> drivers/md/dm-bow.c:1179:5: sparse: sparse: symbol 'dm_bow_prepare_ioctl' was not declared. Should it be static?
>> drivers/md/dm-bow.c:1209:12: sparse: sparse: symbol 'dm_bow_init' was not declared. Should it be static?
>> drivers/md/dm-bow.c:1218:6: sparse: sparse: symbol 'dm_bow_exit' was not declared. Should it be static?
   drivers/md/dm-bow.c:97:10: warning: no previous prototype for 'range_top' [-Wmissing-prototypes]
      97 | sector_t range_top(struct bow_range *br)
         |          ^~~~~~~~~
   drivers/md/dm-bow.c:103:5: warning: no previous prototype for 'range_size' [-Wmissing-prototypes]
     103 | u64 range_size(struct bow_range *br)
         |     ^~~~~~~~~~
   drivers/md/dm-bow.c:148:6: warning: no previous prototype for 'add_before' [-Wmissing-prototypes]
     148 | void add_before(struct rb_root *ranges, struct bow_range *new_br,
         |      ^~~~~~~~~~
   drivers/md/dm-bow.c:1025:5: warning: no previous prototype for 'remap_unless_illegal_trim' [-Wmissing-prototypes]
    1025 | int remap_unless_illegal_trim(struct bow_context *bc, struct bio *bio)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/dm-bow.c: In function 'dm_bow_map':
   drivers/md/dm-bow.c:1061:51: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
    1061 |                                 /* pass-through */;
         |                                                   ^
   drivers/md/dm-bow.c:1068:51: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
    1068 |                                 /* pass-through */;
         |                                                   ^
   drivers/md/dm-bow.c: At top level:
   drivers/md/dm-bow.c:1179:5: warning: no previous prototype for 'dm_bow_prepare_ioctl' [-Wmissing-prototypes]
    1179 | int dm_bow_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
         |     ^~~~~~~~~~~~~~~~~~~~
   drivers/md/dm-bow.c:1209:12: warning: no previous prototype for 'dm_bow_init' [-Wmissing-prototypes]
    1209 | int __init dm_bow_init(void)
         |            ^~~~~~~~~~~
   drivers/md/dm-bow.c:1218:6: warning: no previous prototype for 'dm_bow_exit' [-Wmissing-prototypes]
    1218 | void dm_bow_exit(void)
         |      ^~~~~~~~~~~

vim +/range_top +97 drivers/md/dm-bow.c

    96	
  > 97	sector_t range_top(struct bow_range *br)
    98	{
    99		return container_of(rb_next(&br->node), struct bow_range, node)
   100			->sector;
   101	}
   102	
   103	u64 range_size(struct bow_range *br)
   104	{
   105		return (range_top(br) - br->sector) * SECTOR_SIZE;
   106	}
   107	
   108	static sector_t bvec_top(struct bvec_iter *bi_iter)
   109	{
   110		return bi_iter->bi_sector + bi_iter->bi_size / SECTOR_SIZE;
   111	}
   112	
   113	/*
   114	 * Find the first range that overlaps with bi_iter
   115	 * bi_iter is set to the size of the overlapping sub-range
   116	 */
   117	static struct bow_range *find_first_overlapping_range(struct rb_root *ranges,
   118							      struct bvec_iter *bi_iter)
   119	{
   120		struct rb_node *node = ranges->rb_node;
   121		struct bow_range *br;
   122	
   123		while (node) {
   124			br = container_of(node, struct bow_range, node);
   125	
   126			if (br->sector <= bi_iter->bi_sector
   127			    && bi_iter->bi_sector < range_top(br))
   128				break;
   129	
   130			if (bi_iter->bi_sector < br->sector)
   131				node = node->rb_left;
   132			else
   133				node = node->rb_right;
   134		}
   135	
   136		WARN_ON(!node);
   137		if (!node)
   138			return NULL;
   139	
   140		if (range_top(br) - bi_iter->bi_sector
   141		    < bi_iter->bi_size >> SECTOR_SHIFT)
   142			bi_iter->bi_size = (range_top(br) - bi_iter->bi_sector)
   143				<< SECTOR_SHIFT;
   144	
   145		return br;
   146	}
   147	
 > 148	void add_before(struct rb_root *ranges, struct bow_range *new_br,
   149			struct bow_range *existing)
   150	{
   151		struct rb_node *parent = &(existing->node);
   152		struct rb_node **link = &(parent->rb_left);
   153	
   154		while (*link) {
   155			parent = *link;
   156			link = &((*link)->rb_right);
   157		}
   158	
   159		rb_link_node(&new_br->node, parent, link);
   160		rb_insert_color(&new_br->node, ranges);
   161	}
   162	
   163	/*
   164	 * Given a range br returned by find_first_overlapping_range, split br into a
   165	 * leading range, a range matching the bi_iter and a trailing range.
   166	 * Leading and trailing may end up size 0 and will then be deleted. The
   167	 * new range matching the bi_iter is then returned and should have its type
   168	 * and type specific fields populated.
   169	 * If bi_iter runs off the end of the range, bi_iter is truncated accordingly
   170	 */
   171	static int split_range(struct bow_context *bc, struct bow_range **br,
   172			       struct bvec_iter *bi_iter)
   173	{
   174		struct bow_range *new_br;
   175	
   176		if (bi_iter->bi_sector < (*br)->sector) {
   177			WARN_ON(true);
 > 178			return BLK_STS_IOERR;
   179		}
   180	
   181		if (bi_iter->bi_sector > (*br)->sector) {
   182			struct bow_range *leading_br =
   183				kzalloc(sizeof(*leading_br), GFP_KERNEL);
   184	
   185			if (!leading_br)
   186				return BLK_STS_RESOURCE;
   187	
   188			*leading_br = **br;
   189			if (leading_br->type == TRIMMED)
   190				list_add(&leading_br->trimmed_list, &bc->trimmed_list);
   191	
   192			add_before(&bc->ranges, leading_br, *br);
   193			(*br)->sector = bi_iter->bi_sector;
   194		}
   195	
   196		if (bvec_top(bi_iter) >= range_top(*br)) {
   197			bi_iter->bi_size = (range_top(*br) - (*br)->sector)
   198						* SECTOR_SIZE;
   199			return BLK_STS_OK;
   200		}
   201	
   202		/* new_br will be the beginning, existing br will be the tail */
   203		new_br = kzalloc(sizeof(*new_br), GFP_KERNEL);
   204		if (!new_br)
   205			return BLK_STS_RESOURCE;
   206	
   207		new_br->sector = (*br)->sector;
   208		(*br)->sector = bvec_top(bi_iter);
   209		add_before(&bc->ranges, new_br, *br);
   210		*br = new_br;
   211	
   212		return BLK_STS_OK;
   213	}
   214	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-03 19:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 19:25 [ammarfaizi2-block:google/android/kernel/common/android-4.19-q-release 3921/7614] drivers/md/dm-bow.c:97:10: sparse: sparse: symbol 'range_top' was not declared. Should it be static? kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox