[ofa-general] [PATCH] libibmad: fix warnings

Sasha Khapyorsky sashak at voltaire.com
Sun Aug 16 02:49:27 PDT 2009


Fix compilation warnings "passing argument 1 of ‘mad_get_retries’
discards qualifiers from pointer target type" for mad_get_timeout() and
mad_get_retries() functions.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 libibmad/include/infiniband/mad.h |    4 ++--
 libibmad/src/mad.c                |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h
index 0d0dcf1..d8053b4 100644
--- a/libibmad/include/infiniband/mad.h
+++ b/libibmad/include/infiniband/mad.h
@@ -803,8 +803,8 @@ MAD_EXPORT void mad_rpc_set_retries(struct ibmad_port *port, int retries);
 MAD_EXPORT void mad_rpc_set_timeout(struct ibmad_port *port, int timeout);
 MAD_EXPORT int mad_rpc_class_agent(struct ibmad_port *srcport, int cls);
 
-MAD_EXPORT int mad_get_timeout(struct ibmad_port *srcport, int override_ms);
-MAD_EXPORT int mad_get_retries(struct ibmad_port *srcport);
+MAD_EXPORT int mad_get_timeout(const struct ibmad_port *srcport, int override_ms);
+MAD_EXPORT int mad_get_retries(const struct ibmad_port *srcport);
 
 
 /* register.c */
diff --git a/libibmad/src/mad.c b/libibmad/src/mad.c
index 7192dd6..1361e2b 100644
--- a/libibmad/src/mad.c
+++ b/libibmad/src/mad.c
@@ -64,13 +64,13 @@ uint64_t mad_trid(void)
 	return next;
 }
 
-int mad_get_timeout(struct ibmad_port *srcport, int override_ms)
+int mad_get_timeout(const struct ibmad_port *srcport, int override_ms)
 {
 	return (override_ms ? override_ms :
 	    srcport->timeout ? srcport->timeout : madrpc_timeout);
 }
 
-int mad_get_retries(struct ibmad_port *srcport)
+int mad_get_retries(const struct ibmad_port *srcport)
 {
 	return (srcport->retries ? srcport->retries : madrpc_retries);
 }
-- 
1.6.4




More information about the general mailing list