All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chao Yu <yuchao0@huawei.com>, Chao Yu <chao@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, Chao Yu <yuchao0@huawei.com>,
	Chao Yu <chao@kernel.org>
Subject: [chao:bugfix/common 10/10] fs/f2fs/compress.c:1245:40: warning: suggest parentheses around '-' inside '<<'
Date: Fri, 1 Aug 2025 17:21:05 +0800	[thread overview]
Message-ID: <202508011723.hopSkVCa-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-08-01  9:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202508011723.hopSkVCa-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chao@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.