All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'
@ 2020-09-11 17:51 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-09-11 17:51 UTC (permalink / raw)
  To: kbuild, Aya Levin
  Cc: lkp, kbuild-all, linux-kernel, Saeed Mahameed, Eran Ben Elisha

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   581cb3a26baf846ee9636214afaa5333919875b1
commit: 2132b71f78d207b63974fc7d6eced9c5e886c405 net/mlx5e: Advertise globaly supported FEC modes
config: powerpc-randconfig-m031-20200911 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2132b71f78d207b63974fc7d6eced9c5e886c405
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2132b71f78d207b63974fc7d6eced9c5e886c405
vim +453 drivers/net/ethernet/mellanox/mlx5/core/en/port.c

2132b71f78d207 Aya Levin     2020-02-11  444  bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy)
                                              ^^^^

2095b264147753 Shay Agroskin 2018-10-10  445  {
2095b264147753 Shay Agroskin 2018-10-10  446  	u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  447  	u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  448  	int sz = MLX5_ST_SZ_BYTES(pplm_reg);
2095b264147753 Shay Agroskin 2018-10-10  449  	int err;
2132b71f78d207 Aya Levin     2020-02-11  450  	int i;
2095b264147753 Shay Agroskin 2018-10-10  451  
2095b264147753 Shay Agroskin 2018-10-10  452  	if (!MLX5_CAP_GEN(dev, pcam_reg))
2095b264147753 Shay Agroskin 2018-10-10 @453  		return -EOPNOTSUPP;
                                                        ^^^^^^^^^^^^^^^^^^

2095b264147753 Shay Agroskin 2018-10-10  454  
2095b264147753 Shay Agroskin 2018-10-10  455  	if (!MLX5_CAP_PCAM_REG(dev, pplm))
2095b264147753 Shay Agroskin 2018-10-10  456  		return -EOPNOTSUPP;
                                                        ^^^^^^^^^^^^^^^^^^
These become "return true;"

2095b264147753 Shay Agroskin 2018-10-10  457  
2095b264147753 Shay Agroskin 2018-10-10  458  	MLX5_SET(pplm_reg, in, local_port, 1);
2095b264147753 Shay Agroskin 2018-10-10  459  	err =  mlx5_core_access_reg(dev, in, sz, out, sz, MLX5_REG_PPLM, 0, 0);
2095b264147753 Shay Agroskin 2018-10-10  460  	if (err)
2132b71f78d207 Aya Levin     2020-02-11  461  		return false;
2095b264147753 Shay Agroskin 2018-10-10  462  
2132b71f78d207 Aya Levin     2020-02-11  463  	for (i = 0; i < MLX5E_FEC_SUPPORTED_SPEEDS; i++) {
2132b71f78d207 Aya Levin     2020-02-11  464  		u8 fec_caps;
2095b264147753 Shay Agroskin 2018-10-10  465  
2132b71f78d207 Aya Levin     2020-02-11  466  		mlx5e_get_fec_cap_field(out, &fec_caps, fec_supported_speeds[i]);
2132b71f78d207 Aya Levin     2020-02-11  467  		if (fec_caps & fec_policy)
2132b71f78d207 Aya Levin     2020-02-11  468  			return true;
2132b71f78d207 Aya Levin     2020-02-11  469  	}
2132b71f78d207 Aya Levin     2020-02-11  470  	return false;
2095b264147753 Shay Agroskin 2018-10-10  471  }

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'
@ 2020-09-11 17:51 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-09-11 17:51 UTC (permalink / raw)
  To: kbuild

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   581cb3a26baf846ee9636214afaa5333919875b1
commit: 2132b71f78d207b63974fc7d6eced9c5e886c405 net/mlx5e: Advertise globaly supported FEC modes
config: powerpc-randconfig-m031-20200911 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2132b71f78d207b63974fc7d6eced9c5e886c405
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2132b71f78d207b63974fc7d6eced9c5e886c405
vim +453 drivers/net/ethernet/mellanox/mlx5/core/en/port.c

2132b71f78d207 Aya Levin     2020-02-11  444  bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy)
                                              ^^^^

2095b264147753 Shay Agroskin 2018-10-10  445  {
2095b264147753 Shay Agroskin 2018-10-10  446  	u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  447  	u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  448  	int sz = MLX5_ST_SZ_BYTES(pplm_reg);
2095b264147753 Shay Agroskin 2018-10-10  449  	int err;
2132b71f78d207 Aya Levin     2020-02-11  450  	int i;
2095b264147753 Shay Agroskin 2018-10-10  451  
2095b264147753 Shay Agroskin 2018-10-10  452  	if (!MLX5_CAP_GEN(dev, pcam_reg))
2095b264147753 Shay Agroskin 2018-10-10 @453  		return -EOPNOTSUPP;
                                                        ^^^^^^^^^^^^^^^^^^

2095b264147753 Shay Agroskin 2018-10-10  454  
2095b264147753 Shay Agroskin 2018-10-10  455  	if (!MLX5_CAP_PCAM_REG(dev, pplm))
2095b264147753 Shay Agroskin 2018-10-10  456  		return -EOPNOTSUPP;
                                                        ^^^^^^^^^^^^^^^^^^
These become "return true;"

2095b264147753 Shay Agroskin 2018-10-10  457  
2095b264147753 Shay Agroskin 2018-10-10  458  	MLX5_SET(pplm_reg, in, local_port, 1);
2095b264147753 Shay Agroskin 2018-10-10  459  	err =  mlx5_core_access_reg(dev, in, sz, out, sz, MLX5_REG_PPLM, 0, 0);
2095b264147753 Shay Agroskin 2018-10-10  460  	if (err)
2132b71f78d207 Aya Levin     2020-02-11  461  		return false;
2095b264147753 Shay Agroskin 2018-10-10  462  
2132b71f78d207 Aya Levin     2020-02-11  463  	for (i = 0; i < MLX5E_FEC_SUPPORTED_SPEEDS; i++) {
2132b71f78d207 Aya Levin     2020-02-11  464  		u8 fec_caps;
2095b264147753 Shay Agroskin 2018-10-10  465  
2132b71f78d207 Aya Levin     2020-02-11  466  		mlx5e_get_fec_cap_field(out, &fec_caps, fec_supported_speeds[i]);
2132b71f78d207 Aya Levin     2020-02-11  467  		if (fec_caps & fec_policy)
2132b71f78d207 Aya Levin     2020-02-11  468  			return true;
2132b71f78d207 Aya Levin     2020-02-11  469  	}
2132b71f78d207 Aya Levin     2020-02-11  470  	return false;
2095b264147753 Shay Agroskin 2018-10-10  471  }

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'
@ 2020-09-11 17:51 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-09-11 17:51 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   581cb3a26baf846ee9636214afaa5333919875b1
commit: 2132b71f78d207b63974fc7d6eced9c5e886c405 net/mlx5e: Advertise globaly supported FEC modes
config: powerpc-randconfig-m031-20200911 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2132b71f78d207b63974fc7d6eced9c5e886c405
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2132b71f78d207b63974fc7d6eced9c5e886c405
vim +453 drivers/net/ethernet/mellanox/mlx5/core/en/port.c

2132b71f78d207 Aya Levin     2020-02-11  444  bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy)
                                              ^^^^

2095b264147753 Shay Agroskin 2018-10-10  445  {
2095b264147753 Shay Agroskin 2018-10-10  446  	u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  447  	u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  448  	int sz = MLX5_ST_SZ_BYTES(pplm_reg);
2095b264147753 Shay Agroskin 2018-10-10  449  	int err;
2132b71f78d207 Aya Levin     2020-02-11  450  	int i;
2095b264147753 Shay Agroskin 2018-10-10  451  
2095b264147753 Shay Agroskin 2018-10-10  452  	if (!MLX5_CAP_GEN(dev, pcam_reg))
2095b264147753 Shay Agroskin 2018-10-10 @453  		return -EOPNOTSUPP;
                                                        ^^^^^^^^^^^^^^^^^^

2095b264147753 Shay Agroskin 2018-10-10  454  
2095b264147753 Shay Agroskin 2018-10-10  455  	if (!MLX5_CAP_PCAM_REG(dev, pplm))
2095b264147753 Shay Agroskin 2018-10-10  456  		return -EOPNOTSUPP;
                                                        ^^^^^^^^^^^^^^^^^^
These become "return true;"

2095b264147753 Shay Agroskin 2018-10-10  457  
2095b264147753 Shay Agroskin 2018-10-10  458  	MLX5_SET(pplm_reg, in, local_port, 1);
2095b264147753 Shay Agroskin 2018-10-10  459  	err =  mlx5_core_access_reg(dev, in, sz, out, sz, MLX5_REG_PPLM, 0, 0);
2095b264147753 Shay Agroskin 2018-10-10  460  	if (err)
2132b71f78d207 Aya Levin     2020-02-11  461  		return false;
2095b264147753 Shay Agroskin 2018-10-10  462  
2132b71f78d207 Aya Levin     2020-02-11  463  	for (i = 0; i < MLX5E_FEC_SUPPORTED_SPEEDS; i++) {
2132b71f78d207 Aya Levin     2020-02-11  464  		u8 fec_caps;
2095b264147753 Shay Agroskin 2018-10-10  465  
2132b71f78d207 Aya Levin     2020-02-11  466  		mlx5e_get_fec_cap_field(out, &fec_caps, fec_supported_speeds[i]);
2132b71f78d207 Aya Levin     2020-02-11  467  		if (fec_caps & fec_policy)
2132b71f78d207 Aya Levin     2020-02-11  468  			return true;
2132b71f78d207 Aya Levin     2020-02-11  469  	}
2132b71f78d207 Aya Levin     2020-02-11  470  	return false;
2095b264147753 Shay Agroskin 2018-10-10  471  }

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'
@ 2020-09-11 16:07 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2020-09-11 16:07 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Aya Levin <ayal@mellanox.com>
CC: Saeed Mahameed <saeedm@mellanox.com>
CC: Eran Ben Elisha <eranbe@mellanox.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   581cb3a26baf846ee9636214afaa5333919875b1
commit: 2132b71f78d207b63974fc7d6eced9c5e886c405 net/mlx5e: Advertise globaly supported FEC modes
date:   7 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 7 months ago
config: powerpc-randconfig-m031-20200911 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'

Old smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/en/port.c:456 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2132b71f78d207b63974fc7d6eced9c5e886c405
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2132b71f78d207b63974fc7d6eced9c5e886c405
vim +453 drivers/net/ethernet/mellanox/mlx5/core/en/port.c

2095b264147753 Shay Agroskin 2018-10-10  443  
2132b71f78d207 Aya Levin     2020-02-11  444  bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy)
2095b264147753 Shay Agroskin 2018-10-10  445  {
2095b264147753 Shay Agroskin 2018-10-10  446  	u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  447  	u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  448  	int sz = MLX5_ST_SZ_BYTES(pplm_reg);
2095b264147753 Shay Agroskin 2018-10-10  449  	int err;
2132b71f78d207 Aya Levin     2020-02-11  450  	int i;
2095b264147753 Shay Agroskin 2018-10-10  451  
2095b264147753 Shay Agroskin 2018-10-10  452  	if (!MLX5_CAP_GEN(dev, pcam_reg))
2095b264147753 Shay Agroskin 2018-10-10 @453  		return -EOPNOTSUPP;
2095b264147753 Shay Agroskin 2018-10-10  454  
2095b264147753 Shay Agroskin 2018-10-10  455  	if (!MLX5_CAP_PCAM_REG(dev, pplm))
2095b264147753 Shay Agroskin 2018-10-10  456  		return -EOPNOTSUPP;
2095b264147753 Shay Agroskin 2018-10-10  457  
2095b264147753 Shay Agroskin 2018-10-10  458  	MLX5_SET(pplm_reg, in, local_port, 1);
2095b264147753 Shay Agroskin 2018-10-10  459  	err =  mlx5_core_access_reg(dev, in, sz, out, sz, MLX5_REG_PPLM, 0, 0);
2095b264147753 Shay Agroskin 2018-10-10  460  	if (err)
2132b71f78d207 Aya Levin     2020-02-11  461  		return false;
2095b264147753 Shay Agroskin 2018-10-10  462  
2132b71f78d207 Aya Levin     2020-02-11  463  	for (i = 0; i < MLX5E_FEC_SUPPORTED_SPEEDS; i++) {
2132b71f78d207 Aya Levin     2020-02-11  464  		u8 fec_caps;
2095b264147753 Shay Agroskin 2018-10-10  465  
2132b71f78d207 Aya Levin     2020-02-11  466  		mlx5e_get_fec_cap_field(out, &fec_caps, fec_supported_speeds[i]);
2132b71f78d207 Aya Levin     2020-02-11  467  		if (fec_caps & fec_policy)
2132b71f78d207 Aya Levin     2020-02-11  468  			return true;
2132b71f78d207 Aya Levin     2020-02-11  469  	}
2132b71f78d207 Aya Levin     2020-02-11  470  	return false;
2095b264147753 Shay Agroskin 2018-10-10  471  }
2095b264147753 Shay Agroskin 2018-10-10  472  

:::::: The code@line 453 was first introduced by commit
:::::: 2095b264147753eee0f122b8c0c9f035a32f0a25 net/mlx5e: Add port FEC get/set functions

:::::: TO: Shay Agroskin <shayag@mellanox.com>
:::::: CC: Saeed Mahameed <saeedm@mellanox.com>

---
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: 34773 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-11 17:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 17:51 drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)' Dan Carpenter
2020-09-11 17:51 ` Dan Carpenter
2020-09-11 17:51 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2020-09-11 16:07 kernel test robot

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.