* [chao:bugfix/common 10/10] fs/f2fs/compress.c:1245:40: warning: suggest parentheses around '-' inside '<<'
@ 2025-08-01 9:21 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-08-01 9:21 UTC (permalink / raw)
To: Chao Yu, Chao Yu; +Cc: oe-kbuild-all, Chao Yu, Chao Yu
tree: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git bugfix/common
head: 4aa8c9b233e491f55b9608d4212b5eb7c6f3338a
commit: 4aa8c9b233e491f55b9608d4212b5eb7c6f3338a [10/10] f2fs: clean up f2fs_truncate_partial_cluster()
config: arc-randconfig-001-20250801 (https://download.01.org/0day-ci/archive/20250801/202508011723.hopSkVCa-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250801/202508011723.hopSkVCa-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508011723.hopSkVCa-lkp@intel.com/
All warnings (new ones prefixed by >>):
fs/f2fs/compress.c: In function 'f2fs_truncate_partial_cluster':
>> fs/f2fs/compress.c:1245:40: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
1245 | for (i = 1 << log_cluster_size - 1; i >= 0; i--) {
| ~~~~~~~~~~~~~~~~~^~~
vim +1245 fs/f2fs/compress.c
1213
1214 int f2fs_truncate_partial_cluster(struct inode *inode, u64 from, bool lock)
1215 {
1216 void *fsdata = NULL;
1217 struct page *pagep;
1218 struct page **rpages;
1219 int log_cluster_size = F2FS_I(inode)->i_log_cluster_size;
1220 pgoff_t start_idx = from >> (PAGE_SHIFT + log_cluster_size) <<
1221 log_cluster_size;
1222 int i;
1223 int err;
1224
1225 err = f2fs_is_compressed_cluster(inode, start_idx);
1226 if (err < 0)
1227 return err;
1228
1229 /* truncate normal cluster */
1230 if (!err)
1231 return f2fs_do_truncate_blocks(inode, from, lock);
1232
1233 /* truncate compressed cluster */
1234 err = f2fs_prepare_compress_overwrite(inode, &pagep,
1235 start_idx, &fsdata);
1236
1237 /* should not be a normal cluster */
1238 f2fs_bug_on(F2FS_I_SB(inode), err == 0);
1239
1240 if (err <= 0)
1241 return err;
1242
1243 rpages = fsdata;
1244
> 1245 for (i = 1 << log_cluster_size - 1; i >= 0; i--) {
1246 struct folio *folio = page_folio(rpages[i]);
1247 loff_t start = (loff_t)folio->index << PAGE_SHIFT;
1248
1249 if (from > start) {
1250 folio_zero_segment(folio, from - start,
1251 folio_size(folio));
1252 break;
1253 }
1254 folio_zero_segment(folio, 0, folio_size(folio));
1255 }
1256
1257 f2fs_compress_write_end(inode, fsdata, start_idx, true);
1258 return 0;
1259 }
1260
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-01 9:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01 9:21 [chao:bugfix/common 10/10] fs/f2fs/compress.c:1245:40: warning: suggest parentheses around '-' inside '<<' 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.