linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kbuild-all@01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Changwei Ge <ge.changwei@h3c.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: [mmotm:master 37/234] fs//ocfs2/aops.c:2437:11: warning: comparison of constant '0' with boolean expression is always false
Date: Sat, 23 Dec 2017 10:57:04 +0800	[thread overview]
Message-ID: <201712231002.nF2jnSnt%fengguang.wu@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3800 bytes --]

tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   a4f20e3ed193cd4b2f742ce37f88112c7441146f
commit: cbc718f7f0e7315ca1dd8049be0f879bdb363bb1 [37/234] ocfs2-fall-back-to-buffer-io-when-append-dio-is-disabled-with-file-hole-existing-fix
config: blackfin-allyesconfig (attached as .config)
compiler: bfin-uclinux-gcc (GCC) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout cbc718f7f0e7315ca1dd8049be0f879bdb363bb1
        # save the attached .config to linux build tree
        make.cross ARCH=blackfin 

All warnings (new ones prefixed by >>):

   fs//ocfs2/aops.c: In function 'ocfs2_range_has_holes':
>> fs//ocfs2/aops.c:2437:11: warning: comparison of constant '0' with boolean expression is always false [-Wbool-compare]
      if (ret < 0) {
              ^

vim +/0 +2437 fs//ocfs2/aops.c

c15471f79 Ryan Ding     2016-03-25  2419  
0e5218c24 Changwei Ge   2017-12-23  2420  /*
0e5218c24 Changwei Ge   2017-12-23  2421   * Will look for holes and unwritten extents in the range starting at
0e5218c24 Changwei Ge   2017-12-23  2422   * pos for count bytes (inclusive).
0e5218c24 Changwei Ge   2017-12-23  2423   */
cbc718f7f Andrew Morton 2017-12-23  2424  static bool ocfs2_range_has_holes(struct inode *inode, loff_t pos, size_t count)
0e5218c24 Changwei Ge   2017-12-23  2425  {
cbc718f7f Andrew Morton 2017-12-23  2426  	bool ret = false;
0e5218c24 Changwei Ge   2017-12-23  2427  	unsigned int extent_flags;
0e5218c24 Changwei Ge   2017-12-23  2428  	u32 cpos, clusters, extent_len, phys_cpos;
0e5218c24 Changwei Ge   2017-12-23  2429  	struct super_block *sb = inode->i_sb;
0e5218c24 Changwei Ge   2017-12-23  2430  
0e5218c24 Changwei Ge   2017-12-23  2431  	cpos = pos >> OCFS2_SB(sb)->s_clustersize_bits;
0e5218c24 Changwei Ge   2017-12-23  2432  	clusters = ocfs2_clusters_for_bytes(sb, pos + count) - cpos;
0e5218c24 Changwei Ge   2017-12-23  2433  
0e5218c24 Changwei Ge   2017-12-23  2434  	while (clusters) {
0e5218c24 Changwei Ge   2017-12-23  2435  		ret = ocfs2_get_clusters(inode, cpos, &phys_cpos, &extent_len,
0e5218c24 Changwei Ge   2017-12-23  2436  					 &extent_flags);
0e5218c24 Changwei Ge   2017-12-23 @2437  		if (ret < 0) {
0e5218c24 Changwei Ge   2017-12-23  2438  			mlog_errno(ret);
0e5218c24 Changwei Ge   2017-12-23  2439  			goto out;
0e5218c24 Changwei Ge   2017-12-23  2440  		}
0e5218c24 Changwei Ge   2017-12-23  2441  
0e5218c24 Changwei Ge   2017-12-23  2442  		if (phys_cpos == 0 || (extent_flags & OCFS2_EXT_UNWRITTEN)) {
cbc718f7f Andrew Morton 2017-12-23  2443  			ret = true;
cbc718f7f Andrew Morton 2017-12-23  2444  			goto out;
0e5218c24 Changwei Ge   2017-12-23  2445  		}
0e5218c24 Changwei Ge   2017-12-23  2446  
0e5218c24 Changwei Ge   2017-12-23  2447  		if (extent_len > clusters)
0e5218c24 Changwei Ge   2017-12-23  2448  			extent_len = clusters;
0e5218c24 Changwei Ge   2017-12-23  2449  
0e5218c24 Changwei Ge   2017-12-23  2450  		clusters -= extent_len;
0e5218c24 Changwei Ge   2017-12-23  2451  		cpos += extent_len;
0e5218c24 Changwei Ge   2017-12-23  2452  	}
0e5218c24 Changwei Ge   2017-12-23  2453  out:
0e5218c24 Changwei Ge   2017-12-23  2454  	return ret;
0e5218c24 Changwei Ge   2017-12-23  2455  }
0e5218c24 Changwei Ge   2017-12-23  2456  

:::::: The code at line 2437 was first introduced by commit
:::::: 0e5218c24f42022a11fad0117cfd472c5feb361a ocfs2: fall back to buffer IO when append dio is disabled with file hole existing

:::::: TO: Changwei Ge <ge.changwei@h3c.com>
:::::: CC: Johannes Weiner <hannes@cmpxchg.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47050 bytes --]

                 reply	other threads:[~2017-12-23  2:57 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=201712231002.nF2jnSnt%fengguang.wu@intel.com \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ge.changwei@h3c.com \
    --cc=hannes@cmpxchg.org \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox