mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: kbuild-all@lists.01.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Trond@black.fi.intel.com,
	Myklebust@black.fi.intel.com, trond.myklebust@hammerspace.com,
	Anna Schumaker <anna.schumaker@netapp.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v2 2/2] kernel.h: Split out mathematical helpers
Date: Wed, 5 Feb 2020 09:57:07 +0800	[thread overview]
Message-ID: <202002050944.Bw319kgR%lkp@intel.com> (raw)
In-Reply-To: <20200204170412.30106-2-andriy.shevchenko@linux.intel.com>

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

Hi Andy,

I love your patch! Yet something to improve:

[auto build test ERROR on next-20200203]
[cannot apply to nfs/linux-next rcu/dev linux/master linus/master v5.5 v5.5-rc7 v5.5-rc6 v5.5]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Andy-Shevchenko/kernel-h-Split-out-min-max-et-al-helpers/20200205-040141
base:    cee5a42837d4a6c4189f06f7bf355b97a24c3c93
config: m68k-multi_defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   lib/math/div64.c: In function 'div64_u64_rem':
>> lib/math/div64.c:112:11: error: implicit declaration of function 'fls' [-Werror=implicit-function-declaration]
      int n = fls(high);
              ^~~
   cc1: some warnings being treated as errors

vim +/fls +112 lib/math/div64.c

2418f4f28f8467 lib/div64.c Roman Zippel      2008-05-01   89  
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   90  /**
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   91   * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   92   * @dividend:	64bit dividend
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   93   * @divisor:	64bit divisor
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   94   * @remainder:  64bit remainder
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   95   *
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   96   * This implementation is a comparable to algorithm used by div64_u64.
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   97   * But this operation, which includes math for calculating the remainder,
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   98   * is kept distinct to avoid slowing down the div64_u64 operation on 32bit
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20   99   * systems.
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  100   */
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  101  #ifndef div64_u64_rem
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  102  u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder)
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  103  {
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  104  	u32 high = divisor >> 32;
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  105  	u64 quot;
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  106  
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  107  	if (high == 0) {
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  108  		u32 rem32;
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  109  		quot = div_u64_rem(dividend, divisor, &rem32);
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  110  		*remainder = rem32;
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  111  	} else {
cdc94a37493135 lib/div64.c Stanislaw Gruszka 2019-03-07 @112  		int n = fls(high);
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  113  		quot = div_u64(dividend >> n, divisor >> n);
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  114  
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  115  		if (quot != 0)
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  116  			quot--;
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  117  
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  118  		*remainder = dividend - quot * divisor;
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  119  		if (*remainder >= divisor) {
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  120  			quot++;
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  121  			*remainder -= divisor;
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  122  		}
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  123  	}
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  124  
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  125  	return quot;
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  126  }
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  127  EXPORT_SYMBOL(div64_u64_rem);
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  128  #endif
eb18cba78c2b92 lib/div64.c Mike Snitzer      2013-08-20  129  

:::::: The code at line 112 was first introduced by commit
:::::: cdc94a37493135e355dfc0b0e086d84e3eadb50d lib/div64.c: off by one in shift

:::::: TO: Stanislaw Gruszka <sgruszka@redhat.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

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

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

  reply	other threads:[~2020-02-05  1:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 17:04 [PATCH v2 1/2] kernel.h: Split out min()/max() et al helpers Andy Shevchenko
2020-02-04 17:04 ` [PATCH v2 2/2] kernel.h: Split out mathematical helpers Andy Shevchenko
2020-02-05  1:57   ` kbuild test robot [this message]
2020-02-04 23:23 ` [PATCH v2 1/2] kernel.h: Split out min()/max() et al helpers Rasmus Villemoes
2020-02-05  1:17   ` Joe Perches
2020-02-05 11:17     ` Andy Shevchenko
2020-02-06 11:32   ` Andy Shevchenko

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=202002050944.Bw319kgR%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Myklebust@black.fi.intel.com \
    --cc=Trond@black.fi.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anna.schumaker@netapp.com \
    --cc=arnd@arndb.de \
    --cc=josh@joshtriplett.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=trond.myklebust@hammerspace.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®