]> Pileus Git - ~andy/linux/commitdiff
net/mlx4: fixing sparse warnings when copying mac, address to gid entry
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>
Tue, 6 Mar 2012 04:04:26 +0000 (04:04 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Mar 2012 20:19:17 +0000 (15:19 -0500)
The mac should be written as __be64 the gid. The warning was because
we changed the mac parameter, which is u64, by writing result of cpu_to_be64
into it. Fixing by using new variable of type __be64.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/port.c

index 575839dba8a2ab27e1e49e7ef79a4a71df38461d..98e776261eada0ba25f339751f6c8a8c8f93c0b4 100644 (file)
@@ -79,13 +79,14 @@ static int mlx4_uc_steer_add(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn)
 {
        struct mlx4_qp qp;
        u8 gid[16] = {0};
+       __be64 be_mac;
        int err;
 
        qp.qpn = *qpn;
 
        mac &= 0xffffffffffffULL;
-       mac = cpu_to_be64(mac << 16);
-       memcpy(&gid[10], &mac, ETH_ALEN);
+       be_mac = cpu_to_be64(mac << 16);
+       memcpy(&gid[10], &be_mac, ETH_ALEN);
        gid[5] = port;
 
        err = mlx4_unicast_attach(dev, &qp, gid, 0, MLX4_PROT_ETH);
@@ -100,11 +101,12 @@ static void mlx4_uc_steer_release(struct mlx4_dev *dev, u8 port,
 {
        struct mlx4_qp qp;
        u8 gid[16] = {0};
+       __be64 be_mac;
 
        qp.qpn = qpn;
        mac &= 0xffffffffffffULL;
-       mac = cpu_to_be64(mac << 16);
-       memcpy(&gid[10], &mac, ETH_ALEN);
+       be_mac = cpu_to_be64(mac << 16);
+       memcpy(&gid[10], &be_mac, ETH_ALEN);
        gid[5] = port;
 
        mlx4_unicast_detach(dev, &qp, gid, MLX4_PROT_ETH);