All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [leon-rdma:auxbus 3/12] drivers/net/ethernet/mellanox/mlx5/core/main.c:239:74: sparse: sparse: cast truncates bits from constant value (50a becomes a)
Date: Wed, 04 Nov 2020 01:41:55 +0800	[thread overview]
Message-ID: <202011040152.SE38s2Az-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git auxbus
head:   ce7e1f65f7922627b386d5f30b1bbd54a456687b
commit: 7fcfbdeefb9326a73e4de5024aef37b9e36ff8aa [3/12] net/mlx5: Properly convey driver version to firmware
config: sparc64-randconfig-s032-20201103 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-76-gf680124b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?id=7fcfbdeefb9326a73e4de5024aef37b9e36ff8aa
        git remote add leon-rdma https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git
        git fetch --no-tags leon-rdma auxbus
        git checkout 7fcfbdeefb9326a73e4de5024aef37b9e36ff8aa
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sparc64 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/ethernet/mellanox/mlx5/core/main.c:239:74: sparse: sparse: cast truncates bits from constant value (50a becomes a)

vim +239 drivers/net/ethernet/mellanox/mlx5/core/main.c

   211	
   212	static void mlx5_set_driver_version(struct mlx5_core_dev *dev)
   213	{
   214		int driver_ver_sz = MLX5_FLD_SZ_BYTES(set_driver_version_in,
   215						      driver_version);
   216		u8 in[MLX5_ST_SZ_BYTES(set_driver_version_in)] = {};
   217		int remaining_size = driver_ver_sz;
   218		char *string;
   219	
   220		if (!MLX5_CAP_GEN(dev, driver_version))
   221			return;
   222	
   223		string = MLX5_ADDR_OF(set_driver_version_in, in, driver_version);
   224	
   225		strncpy(string, "Linux", remaining_size);
   226	
   227		remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
   228		strncat(string, ",", remaining_size);
   229	
   230		remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
   231		strncat(string, DRIVER_NAME, remaining_size);
   232	
   233		remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
   234		strncat(string, ",", remaining_size);
   235	
   236		remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
   237	
   238		snprintf(string + strlen(string), remaining_size, "%u.%u.%u",
 > 239			 (u8)(LINUX_VERSION_CODE >> 16), (u8)(LINUX_VERSION_CODE >> 8),
   240			 (u16)(LINUX_VERSION_CODE & 0xff));
   241	
   242		/*Send the command*/
   243		MLX5_SET(set_driver_version_in, in, opcode,
   244			 MLX5_CMD_OP_SET_DRIVER_VERSION);
   245	
   246		mlx5_cmd_exec_in(dev, set_driver_version, in);
   247	}
   248	

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

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

                 reply	other threads:[~2020-11-03 17:41 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=202011040152.SE38s2Az-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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 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.