linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>,
	gregkh@linuxfoundation.org, realwakka@gmail.com
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] staging: pi433: validate max bit_rate based on modulation used
Date: Sun, 16 Jan 2022 22:06:26 +0800	[thread overview]
Message-ID: <202201162116.8r1xEw9q-lkp@intel.com> (raw)
In-Reply-To: <20220116002333.GA23305@mail.google.com>

Hi Paulo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/Paulo-Miguel-Almeida/staging-pi433-validate-min-max-bit-rate-settings/20220116-082432
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git fa783154524a71ab74e293cd8251155e5971952b
config: i386-randconfig-a002 (https://download.01.org/0day-ci/archive/20220116/202201162116.8r1xEw9q-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c63a3175c2947e8c1a2d3bbe16a8586600705c54)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/4bbc9e444fd3bab38d93ae4261102db64385a26c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Paulo-Miguel-Almeida/staging-pi433-validate-min-max-bit-rate-settings/20220116-082432
        git checkout 4bbc9e444fd3bab38d93ae4261102db64385a26c
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/staging/pi433/

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

All warnings (new ones prefixed by >>):

>> drivers/staging/pi433/rf69.c:238:30: warning: result of comparison of constant 300000 with expression of type 'u16' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
               (mod == FSK && bit_rate > 300000) ||
                              ~~~~~~~~ ^ ~~~~~~
   1 warning generated.


vim +238 drivers/staging/pi433/rf69.c

   220	
   221	int rf69_set_bit_rate(struct spi_device *spi, u16 bit_rate)
   222	{
   223		int retval;
   224		u32 bit_rate_reg;
   225		u8 msb;
   226		u8 lsb;
   227		enum modulation mod;
   228	
   229		// check if modulation is configured
   230		mod = rf69_get_modulation(spi);
   231		if (mod == UNDEF) {
   232			dev_dbg(&spi->dev, "setBitRate: modulation is undefined");
   233			return -EINVAL;
   234		}
   235	
   236		// check input value
   237		if (bit_rate < 1200 ||
 > 238		    (mod == FSK && bit_rate > 300000) ||
   239		    (mod == OOK && bit_rate > 32768)) {
   240			dev_dbg(&spi->dev, "setBitRate: illegal input param");
   241			return -EINVAL;
   242		}
   243	
   244		// calculate reg settings
   245		bit_rate_reg = (F_OSC / bit_rate);
   246	
   247		msb = (bit_rate_reg & 0xff00) >> 8;
   248		lsb = (bit_rate_reg & 0xff);
   249	
   250		// transmit to RF 69
   251		retval = rf69_write_reg(spi, REG_BITRATE_MSB, msb);
   252		if (retval)
   253			return retval;
   254		retval = rf69_write_reg(spi, REG_BITRATE_LSB, lsb);
   255		if (retval)
   256			return retval;
   257	
   258		return 0;
   259	}
   260	

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

  reply	other threads:[~2022-01-16 14:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-16  0:17 [PATCH 0/3] staging: pi433: validate min/max bit rate settings Paulo Miguel Almeida
2022-01-16  0:21 ` [PATCH 1/3] staging: pi433: fix validation for min bit rate supported by the device Paulo Miguel Almeida
2022-01-16  0:22 ` [PATCH 2/3] staging: pi433: change order in which driver config the rf69 chip Paulo Miguel Almeida
2022-01-16  0:23 ` [PATCH 3/3] staging: pi433: validate max bit_rate based on modulation used Paulo Miguel Almeida
2022-01-16 14:06   ` kernel test robot [this message]
2022-01-17  5:58     ` [PATCH v2 0/3] staging: pi433: validate min/max bit rate settings Paulo Miguel Almeida
2022-01-17  6:00       ` [PATCH v2 1/3] staging: pi433: fix validation for min bit rate supported by the device Paulo Miguel Almeida
2022-01-17  6:01       ` [PATCH v2 2/3] staging: pi433: change order in which driver config the rf69 chip Paulo Miguel Almeida
2022-01-17  6:02       ` [PATCH v2 3/3] staging: pi433: validate max bit_rate based on modulation used Paulo Miguel Almeida
2022-01-18 13:59         ` Dan Carpenter
2022-01-18 19:34           ` Paulo Miguel Almeida
2022-01-18 23:03             ` [PATCH v3 0/3] staging: pi433: validate min/max bit rate settings Paulo Miguel Almeida
2022-01-18 23:04               ` [PATCH v3 1/3] staging: pi433: fix validation for min bit rate supported by the device Paulo Miguel Almeida
2022-01-18 23:05               ` [PATCH v3 2/3] staging: pi433: change order in which driver config the rf69 chip Paulo Miguel Almeida
2022-01-18 23:05               ` [PATCH v3 3/3] staging: pi433: validate max bit_rate based on modulation used Paulo Miguel Almeida
2022-01-19  6:04               ` [PATCH v3 0/3] staging: pi433: validate min/max bit rate settings Dan Carpenter
2022-01-23  7:43                 ` Paulo Miguel Almeida
2022-01-24  8:53                   ` Dan Carpenter
2022-01-19  5:34             ` [PATCH v2 3/3] staging: pi433: validate max bit_rate based on modulation used Dan Carpenter

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=202201162116.8r1xEw9q-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=llvm@lists.linux.dev \
    --cc=paulo.miguel.almeida.rodenas@gmail.com \
    --cc=realwakka@gmail.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).