linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Tomasz Duszynski <tomasz.duszynski@octakon.com>,
	linux-iio@vger.kernel.org
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, robh+dt@kernel.org, jic23@kernel.org,
	andy.shevchenko@gmail.com, pmeerw@pmeerw.net,
	Tomasz Duszynski <tomasz.duszynski@octakon.com>
Subject: Re: [PATCH v5 1/4] iio: chemical: scd30: add core driver
Date: Tue, 9 Jun 2020 04:18:56 +0800	[thread overview]
Message-ID: <202006090426.ENCJHJ1n%lkp@intel.com> (raw)
In-Reply-To: <20200607175812.95777-2-tomasz.duszynski@octakon.com>

Hi Tomasz,

I love your patch! Perhaps something to improve:

[auto build test WARNING on iio/togreg]
[also build test WARNING on robh/for-next linux/master v5.7]
[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/Tomasz-Duszynski/Add-support-for-SCD30-sensor/20200608-020304
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

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


cppcheck warnings: (new ones prefixed by >>)

>> drivers/iio/chemical/scd30_core.c:93:31: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
        sign = float32 & BIT(31) ? -1 : 1,
                                 ^

vim +93 drivers/iio/chemical/scd30_core.c

    87	
    88	/* simplified float to fixed point conversion with a scaling factor of 0.01 */
    89	static int scd30_float_to_fp(int float32)
    90	{
    91		int fraction, shift,
    92		    mantissa = float32 & GENMASK(22, 0),
  > 93		    sign = float32 & BIT(31) ? -1 : 1,
    94		    exp = (float32 & ~BIT(31)) >> 23;
    95	
    96		/* special case 0 */
    97		if (!exp && !mantissa)
    98			return 0;
    99	
   100		exp -= 127;
   101		if (exp < 0) {
   102			exp = -exp;
   103			/* return values ranging from 1 to 99 */
   104			return sign * ((((BIT(23) + mantissa) * 100) >> 23) >> exp);
   105		}
   106	
   107		/* return values starting at 100 */
   108		shift = 23 - exp;
   109		float32 = BIT(exp) + (mantissa >> shift);
   110		fraction = mantissa & GENMASK(shift - 1, 0);
   111	
   112		return sign * (float32 * 100 + ((fraction * 100) >> shift));
   113	}
   114	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

  reply	other threads:[~2020-06-09  0:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-07 17:58 [PATCH v5 1/4] iio: chemical: scd30: add core driver Tomasz Duszynski
2020-06-08 20:18 ` kernel test robot [this message]
2020-06-14 13:15   ` Jonathan Cameron
2020-06-20 16:25 ` Jonathan Cameron
2020-06-21 15:40   ` Tomasz Duszynski

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=202006090426.ENCJHJ1n%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=tomasz.duszynski@octakon.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;
as well as URLs for NNTP newsgroup(s).