summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlxsw/item.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-10-20 13:08:27 (GMT)
committerDavid S. Miller <davem@davemloft.net>2015-10-20 13:08:27 (GMT)
commit26440c835f8b1a491e2704118ac55bf87334366c (patch)
tree3c2d23b59fd49b252fdbf6c09efc41b354933fc6 /drivers/net/ethernet/mellanox/mlxsw/item.h
parent371f1c7e0d854796adc622cc3bacfcc5fc638db1 (diff)
parent1099f86044111e9a7807f09523e42d4c9d0fb781 (diff)
downloadlinux-26440c835f8b1a491e2704118ac55bf87334366c.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/usb/asix_common.c net/ipv4/inet_connection_sock.c net/switchdev/switchdev.c In the inet_connection_sock.c case the request socket hashing scheme is completely different in net-next. The other two conflicts were overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/item.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/item.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/item.h b/drivers/net/ethernet/mellanox/mlxsw/item.h
index 1c5e43e..a94dbda6 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/item.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/item.h
@@ -193,6 +193,7 @@ __mlxsw_item_bit_array_offset(struct mlxsw_item *item, u16 index, u8 *shift)
{
u16 max_index, be_index;
u16 offset; /* byte offset inside the array */
+ u8 in_byte_index;
BUG_ON(index && !item->element_size);
if (item->offset % sizeof(u32) != 0 ||
@@ -205,7 +206,8 @@ __mlxsw_item_bit_array_offset(struct mlxsw_item *item, u16 index, u8 *shift)
max_index = (item->size.bytes << 3) / item->element_size - 1;
be_index = max_index - index;
offset = be_index * item->element_size >> 3;
- *shift = index % (BITS_PER_BYTE / item->element_size) << 1;
+ in_byte_index = index % (BITS_PER_BYTE / item->element_size);
+ *shift = in_byte_index * item->element_size;
return item->offset + offset;
}