diff mbox

[libibmad] dump.c: In mad_dump_linkwidth, output undefined widths

Message ID 534D6DE1.4010306@dev.mellanox.co.il (mailing list archive)
State Accepted, archived
Delegated to: Ira Weiny
Headers show

Commit Message

Hal Rosenstock April 15, 2014, 5:35 p.m. UTC
Based on patch for this for width 0 from Ammar Haj Hamad <ahamad@asaltech.com>

Some implementations when port is down appear to return a link width of 0

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ira Weiny April 19, 2014, 10:30 p.m. UTC | #1
> 
> 
> Based on patch for this for width 0 from Ammar Haj Hamad
> <ahamad@asaltech.com>
> 
> Some implementations when port is down appear to return a link width of 0
> 
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>


Thanks applied,
Ira

> ---
> diff --git a/src/dump.c b/src/dump.c
> index 7f3ef7d..efe4bc4 100644
> --- a/src/dump.c
> +++ b/src/dump.c
> @@ -185,7 +185,8 @@ void mad_dump_linkwidth(char *buf, int bufsz, void
> *val, int valsz)
>  		break;
>  	default:
>  		IBWARN("bad width %d", width);
> -		buf[0] = 0;
> +		snprintf(buf, bufsz, "undefined (%d)", width);
> +		break;
>  	}
>  }
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/dump.c b/src/dump.c
index 7f3ef7d..efe4bc4 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -185,7 +185,8 @@  void mad_dump_linkwidth(char *buf, int bufsz, void *val, int valsz)
 		break;
 	default:
 		IBWARN("bad width %d", width);
-		buf[0] = 0;
+		snprintf(buf, bufsz, "undefined (%d)", width);
+		break;
 	}
 }