aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEran Ben Elisha <eranbe@mellanox.com>2016-02-11 03:24:42 -0500
committerDoug Ledford <dledford@redhat.com>2016-02-11 11:05:56 -0500
commitee50aeac60ba5c4c7e072fbc0c9aa2043c8896e6 (patch)
treec1e2f8652b33fe7931b73518ff50cbfbd9f39363
parentfa51b247d67b521e1a1103cad75eb7a666fc9ff9 (diff)
IB/core: Fix reading capability mask of the port info class
When checking specific attribute from a bit mask, need to use bitwise AND and not logical AND, fixed that. Fixes: 145d9c541032 ('IB/core: Display extended counter set if available') Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Matan Barak <matanb@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Christoph Lameter <cl@linux.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/core/sysfs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index ec46386e3c7f..14606afbfaa8 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -720,12 +720,11 @@ static struct attribute_group *get_counter_table(struct ib_device *dev,
720 720
721 if (get_perf_mad(dev, port_num, IB_PMA_CLASS_PORT_INFO, 721 if (get_perf_mad(dev, port_num, IB_PMA_CLASS_PORT_INFO,
722 &cpi, 40, sizeof(cpi)) >= 0) { 722 &cpi, 40, sizeof(cpi)) >= 0) {
723 723 if (cpi.capability_mask & IB_PMA_CLASS_CAP_EXT_WIDTH)
724 if (cpi.capability_mask && IB_PMA_CLASS_CAP_EXT_WIDTH)
725 /* We have extended counters */ 724 /* We have extended counters */
726 return &pma_group_ext; 725 return &pma_group_ext;
727 726
728 if (cpi.capability_mask && IB_PMA_CLASS_CAP_EXT_WIDTH_NOIETF) 727 if (cpi.capability_mask & IB_PMA_CLASS_CAP_EXT_WIDTH_NOIETF)
729 /* But not the IETF ones */ 728 /* But not the IETF ones */
730 return &pma_group_noietf; 729 return &pma_group_noietf;
731 } 730 }