* [xiang-linux:erofs/compr_cfgs 6/6] fs/erofs/super.c:202:17: sparse: sparse: restricted __le16 degrades to integer
@ 2021-02-27 19:08 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-27 19:08 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3292 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git erofs/compr_cfgs
head: 5a5727580c28124069723d6166dc6551acc1adf2
commit: 5a5727580c28124069723d6166dc6551acc1adf2 [6/6] erofs: introduce on-disk compression options
config: x86_64-randconfig-s021-20210228 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-241-geaceeafa-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git/commit/?id=5a5727580c28124069723d6166dc6551acc1adf2
git remote add xiang-linux https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git
git fetch --no-tags xiang-linux erofs/compr_cfgs
git checkout 5a5727580c28124069723d6166dc6551acc1adf2
# 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 <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> fs/erofs/super.c:202:17: sparse: sparse: restricted __le16 degrades to integer
vim +202 fs/erofs/super.c
187
188 #ifdef CONFIG_EROFS_FS_ZIP
189 static int erofs_load_compr_cfgs(struct super_block *sb,
190 struct erofs_super_block *dsb)
191 {
192 struct erofs_sb_info *sbi;
193 struct page *page;
194 unsigned int algs, alg;
195 erofs_off_t offset;
196 int size, ret;
197
198 sbi = EROFS_SB(sb);
199 sbi->available_compr_algs = le16_to_cpu(dsb->u1.available_compr_algs);
200
201 if (sbi->available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS) {
> 202 erofs_err(sb,
203 "try to load compressed image with unsupported algorithms %x",
204 dsb->u1.available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS);
205 return -EINVAL;
206 }
207
208 offset = EROFS_SUPER_OFFSET + sbi->sb_size;
209 page = NULL;
210 alg = 0;
211 ret = 0;
212
213 for (algs = sbi->available_compr_algs; algs; algs >>= 1, ++alg) {
214 void *data;
215
216 if (!(algs & 1))
217 continue;
218
219 data = erofs_read_metadata(sb, &page, &offset, &size);
220 if (IS_ERR(data)) {
221 ret = PTR_ERR(data);
222 goto err;
223 }
224
225 switch (alg) {
226 case Z_EROFS_COMPRESSION_LZ4:
227 ret = z_erofs_load_lz4_config(sb, dsb, data, size);
228 break;
229 default:
230 DBG_BUGON(1);
231 ret = -EFAULT;
232 }
233 kfree(data);
234 if (ret)
235 goto err;
236 }
237 err:
238 if (page) {
239 unlock_page(page);
240 put_page(page);
241 }
242 return ret;
243 }
244 #else
245 static int erofs_load_compr_cfgs(struct super_block *sb,
246 struct erofs_super_block *dsb)
247 {
248 if (dsb->u1.available_compr_algs) {
249 erofs_err(sb,
250 "try to load compressed image when compression is disabled");
251 return -EINVAL;
252 }
253 return 0;
254 }
255 #endif
256
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 48087 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-02-27 19:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27 19:08 [xiang-linux:erofs/compr_cfgs 6/6] fs/erofs/super.c:202:17: sparse: sparse: restricted __le16 degrades to integer kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.