Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] i40evf: create a generic config RSS function
@ 2015-12-08 19:42 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-12-08 19:42 UTC (permalink / raw)
  To: intel-wired-lan

Hello Helin Zhang,

The patch 2c86ac3c7079: "i40evf: create a generic config RSS
function" from Oct 27, 2015, leads to the following static checker
warning:

	drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c:691 i40evf_set_rxfh()
	warn: we tested 'key' before and it was 'false'

drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
   676  static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir,
   677                             const u8 *key, const u8 hfunc)
   678  {
   679          struct i40evf_adapter *adapter = netdev_priv(netdev);
   680          struct i40e_vsi *vsi = &adapter->vsi;
   681          u8 *seed = NULL;
   682          u16 i;
   683  
   684          /* We do not allow change in unsupported parameters */
   685          if (key ||
                    ^^^
If key is non-NULL then we return.  Maybe this is a || vs && typo?

   686              (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP))
   687                  return -EOPNOTSUPP;
   688          if (!indir)
   689                  return 0;
   690  
   691          if (key) {

Since we know key is NULL that means this is dead code.

   692                  if (!vsi->rss_hkey_user) {
   693                          vsi->rss_hkey_user = kzalloc(I40EVF_HKEY_ARRAY_SIZE,
   694                                                       GFP_KERNEL);
   695                          if (!vsi->rss_hkey_user)
   696                                  return -ENOMEM;
   697                  }
   698                  memcpy(vsi->rss_hkey_user, key, I40EVF_HKEY_ARRAY_SIZE);
   699                  seed = vsi->rss_hkey_user;
   700          }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-08 19:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08 19:42 [Intel-wired-lan] i40evf: create a generic config RSS function Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox