Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB: Fix display of 4-bit port counters in sysfs

The code to display local_link_integrity_errors and
excessive_buffer_overrun_errors in
/sys/class/infiniband/<hca>/ports/<n>/counters/
uses the wrong shift to extract the 4 bit values.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Ralph Campbell and committed by
Roland Dreier
d8b9f23b 3cd73eed

+1 -1
+1 -1
drivers/infiniband/core/sysfs.c
··· 336 336 switch (width) { 337 337 case 4: 338 338 ret = sprintf(buf, "%u\n", (out_mad->data[40 + offset / 8] >> 339 - (offset % 4)) & 0xf); 339 + (4 - (offset % 8))) & 0xf); 340 340 break; 341 341 case 8: 342 342 ret = sprintf(buf, "%u\n", out_mad->data[40 + offset / 8]);