summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/qlogic/qed/qed_sp_commands.c
diff options
context:
space:
mode:
authorAlexander Lobakin <alobakin@marvell.com>2020-07-06 18:38:19 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-06 13:18:56 -0700
commit5ab903418ad14732131df0af0d63f19b73e377ae (patch)
tree7a9c443c1b8a965352883cc3ad620603d6282762 /drivers/net/ethernet/qlogic/qed/qed_sp_commands.c
parenta0f3266f4bf966eefd02123d3aacdf7df8d67c1c (diff)
net: qed: sanitize BE/LE data processing
Current code assumes that both host and device operates in Little Endian in lots of places. While this is true for x86 platform, this doesn't mean we should not care about this. This commit addresses all parts of the code that were pointed out by sparse checker. All operations with restricted (__be*/__le*) types are now protected with explicit from/to CPU conversions, even if they're noops on common setups. I'm sure there are more such places, but this implies a deeper code investigation, and is a subject for future works. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_sp_commands.c')
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_sp_commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sp_commands.c b/drivers/net/ethernet/qlogic/qed/qed_sp_commands.c
index 71ab57bca7c9..8142f5669b26 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sp_commands.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_sp_commands.c
@@ -341,9 +341,9 @@ int qed_sp_pf_start(struct qed_hwfn *p_hwfn,
outer_tag_config->outer_tag.tci = cpu_to_le16(p_hwfn->hw_info.ovlan);
if (test_bit(QED_MF_8021Q_TAGGING, &p_hwfn->cdev->mf_bits)) {
- outer_tag_config->outer_tag.tpid = ETH_P_8021Q;
+ outer_tag_config->outer_tag.tpid = cpu_to_le16(ETH_P_8021Q);
} else if (test_bit(QED_MF_8021AD_TAGGING, &p_hwfn->cdev->mf_bits)) {
- outer_tag_config->outer_tag.tpid = ETH_P_8021AD;
+ outer_tag_config->outer_tag.tpid = cpu_to_le16(ETH_P_8021AD);
outer_tag_config->enable_stag_pri_change = 1;
}