All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net v1] i40e: Fix to various static analysis warnings
  2021-06-02  0:43 [Intel-wired-lan] [PATCH net v1] i40e: Fix to various static analysis warnings =?unknown-8bit?q?J=C4=99drzej?= Jagielski
@ 2021-06-01 17:32 ` Jesse Brandeburg
  0 siblings, 0 replies; 2+ messages in thread
From: Jesse Brandeburg @ 2021-06-01 17:32 UTC (permalink / raw)
  To: intel-wired-lan

J?drzej Jagielski wrote:

> Fix static analysis warnings from sparse.

Was this on top of the series that I had already sent upstream? It just
went to net-next last week (after several months)

When I sent a series like this before, davem required that I put all
the fixed errors in the commit message (not a full text, but a
summary), and I then proceeded to put the full text of the errors in
the commit message after a "triple-dash" so they would be there for
reviewers, but gone from commit log.


> 
> Fixes: e793095e8a57 ("i40e: add parsing of flexible filter fields from userdef")
> Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
> Suggested-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_ethtool.c     | 14 +++++++-------
>  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h |  2 +-
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> index 3e822bad4..cbd640e0e 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> @@ -3138,8 +3138,8 @@ static int i40e_parse_rx_flow_user_data(struct ethtool_rx_flow_spec *fsp,
>  	if (!(fsp->flow_type & FLOW_EXT))
>  		return 0;
>  
> -	value = be64_to_cpu(*((__be64 *)fsp->h_ext.data));
> -	mask = be64_to_cpu(*((__be64 *)fsp->m_ext.data));
> +	value = be64_to_cpu(*((__force __be64 *)fsp->h_ext.data));
> +	mask = be64_to_cpu(*((__force __be64 *)fsp->m_ext.data));
>  
>  #define I40E_USERDEF_FLEX_WORD		GENMASK_ULL(15, 0)
>  #define I40E_USERDEF_FLEX_OFFSET	GENMASK_ULL(31, 16)
> @@ -3180,8 +3180,8 @@ static void i40e_fill_rx_flow_user_data(struct ethtool_rx_flow_spec *fsp,
>  	if (value || mask)
>  		fsp->flow_type |= FLOW_EXT;
>  
> -	*((__be64 *)fsp->h_ext.data) = cpu_to_be64(value);
> -	*((__be64 *)fsp->m_ext.data) = cpu_to_be64(mask);
> +	*((__force __be64 *)fsp->h_ext.data) = cpu_to_be64(value);
> +	*((__force __be64 *)fsp->m_ext.data) = cpu_to_be64(mask);
>  }
>  
>  /**
> @@ -4150,9 +4150,9 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,
>  				     struct ethtool_rx_flow_spec *fsp,
>  				     struct i40e_rx_flow_userdef *userdef)
>  {
> -	static const __be32 ipv6_full_mask[4] = {cpu_to_be32(0xffffffff),
> +	static const __be32 ipv6_full_mask[4] = {
>  		cpu_to_be32(0xffffffff), cpu_to_be32(0xffffffff),
> -		cpu_to_be32(0xffffffff)};
> +		cpu_to_be32(0xffffffff), cpu_to_be32(0xffffffff)};

This looks like just a whitespace change, why include it in this patch?

>  	struct ethtool_tcpip6_spec *tcp_ip6_spec;
>  	struct ethtool_usrip6_spec *usr_ip6_spec;
>  	struct ethtool_tcpip4_spec *tcp_ip4_spec;
> @@ -5599,7 +5599,7 @@ static int i40e_set_eee(struct net_device *netdev, struct ethtool_eee *edata)
>  		config.eeer |= cpu_to_le32(I40E_PRTPM_EEER_TX_LPI_EN_MASK);
>  	} else {
>  		config.eee_capability = 0;
> -		config.eeer &= cpu_to_le32(~I40E_PRTPM_EEER_TX_LPI_EN_MASK);
> +		config.eeer &= ~cpu_to_le32(I40E_PRTPM_EEER_TX_LPI_EN_MASK);
>  	}
>  
>  	/* Apply modified PHY configuration */
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
> index 49575a640..e406fee93 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
> @@ -77,7 +77,7 @@ struct i40e_vf {
>  	u16 stag;
>  
>  	struct virtchnl_ether_addr default_lan_addr;
> -	u16 port_vlan_id;
> +	s16 port_vlan_id;

How could vlan ever be negative? I don't think this is a good change,
it seems like it might introduce bugs, not fix them. And I don't know
why it would be useful or why you made the change.

>  	bool pf_set_mac;	/* The VMM admin set the VF MAC address */
>  	bool trusted;
>  



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

* [Intel-wired-lan] [PATCH net v1] i40e: Fix to various static analysis warnings
@ 2021-06-02  0:43 =?unknown-8bit?q?J=C4=99drzej?= Jagielski
  2021-06-01 17:32 ` Jesse Brandeburg
  0 siblings, 1 reply; 2+ messages in thread
From: =?unknown-8bit?q?J=C4=99drzej?= Jagielski @ 2021-06-02  0:43 UTC (permalink / raw)
  To: intel-wired-lan

Fix static analysis warnings from sparse.

Fixes: e793095e8a57 ("i40e: add parsing of flexible filter fields from userdef")
Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Suggested-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     | 14 +++++++-------
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 3e822bad4..cbd640e0e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -3138,8 +3138,8 @@ static int i40e_parse_rx_flow_user_data(struct ethtool_rx_flow_spec *fsp,
 	if (!(fsp->flow_type & FLOW_EXT))
 		return 0;
 
-	value = be64_to_cpu(*((__be64 *)fsp->h_ext.data));
-	mask = be64_to_cpu(*((__be64 *)fsp->m_ext.data));
+	value = be64_to_cpu(*((__force __be64 *)fsp->h_ext.data));
+	mask = be64_to_cpu(*((__force __be64 *)fsp->m_ext.data));
 
 #define I40E_USERDEF_FLEX_WORD		GENMASK_ULL(15, 0)
 #define I40E_USERDEF_FLEX_OFFSET	GENMASK_ULL(31, 16)
@@ -3180,8 +3180,8 @@ static void i40e_fill_rx_flow_user_data(struct ethtool_rx_flow_spec *fsp,
 	if (value || mask)
 		fsp->flow_type |= FLOW_EXT;
 
-	*((__be64 *)fsp->h_ext.data) = cpu_to_be64(value);
-	*((__be64 *)fsp->m_ext.data) = cpu_to_be64(mask);
+	*((__force __be64 *)fsp->h_ext.data) = cpu_to_be64(value);
+	*((__force __be64 *)fsp->m_ext.data) = cpu_to_be64(mask);
 }
 
 /**
@@ -4150,9 +4150,9 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,
 				     struct ethtool_rx_flow_spec *fsp,
 				     struct i40e_rx_flow_userdef *userdef)
 {
-	static const __be32 ipv6_full_mask[4] = {cpu_to_be32(0xffffffff),
+	static const __be32 ipv6_full_mask[4] = {
 		cpu_to_be32(0xffffffff), cpu_to_be32(0xffffffff),
-		cpu_to_be32(0xffffffff)};
+		cpu_to_be32(0xffffffff), cpu_to_be32(0xffffffff)};
 	struct ethtool_tcpip6_spec *tcp_ip6_spec;
 	struct ethtool_usrip6_spec *usr_ip6_spec;
 	struct ethtool_tcpip4_spec *tcp_ip4_spec;
@@ -5599,7 +5599,7 @@ static int i40e_set_eee(struct net_device *netdev, struct ethtool_eee *edata)
 		config.eeer |= cpu_to_le32(I40E_PRTPM_EEER_TX_LPI_EN_MASK);
 	} else {
 		config.eee_capability = 0;
-		config.eeer &= cpu_to_le32(~I40E_PRTPM_EEER_TX_LPI_EN_MASK);
+		config.eeer &= ~cpu_to_le32(I40E_PRTPM_EEER_TX_LPI_EN_MASK);
 	}
 
 	/* Apply modified PHY configuration */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
index 49575a640..e406fee93 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
@@ -77,7 +77,7 @@ struct i40e_vf {
 	u16 stag;
 
 	struct virtchnl_ether_addr default_lan_addr;
-	u16 port_vlan_id;
+	s16 port_vlan_id;
 	bool pf_set_mac;	/* The VMM admin set the VF MAC address */
 	bool trusted;
 
-- 
2.18.2

Intel Technology Poland sp. z o.o.
ul. Sowackiego 173 | 80-298 Gdask | Sd Rejonowy Gdask Pnoc | VII Wydzia Gospodarczy Krajowego Rejestru Sdowego - KRS 101882 | NIP 957-07-52-316 | Kapita zakadowy 200.000 PLN.
Ta wiadomo wraz z zacznikami jest przeznaczona dla okrelonego adresata i moe zawiera informacje poufne. W razie przypadkowego otrzymania tej wiadomoci, prosimy o powiadomienie nadawcy oraz trwae jej usunicie; jakiekolwiek przegldanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


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

end of thread, other threads:[~2021-06-02  0:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02  0:43 [Intel-wired-lan] [PATCH net v1] i40e: Fix to various static analysis warnings =?unknown-8bit?q?J=C4=99drzej?= Jagielski
2021-06-01 17:32 ` Jesse Brandeburg

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.