Skip to contentSkip to conversation

RDS: add __printf format attribute to error reporting functions

PATCH In review Nicolas Iooss 2 participants 2 messages Aug 5, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDS: add __printf format attribute to error reporting functions

This is helpful to detect at compile-time errors related to format strings.

---
 net/rds/ib.h  | 1 +
 net/rds/rds.h | 1 +
 2 files changed, 2 insertions(+)
net/rds/ib.h +1 -0
index 046f7508c06b..45ac8e8e58f4 100644
@@ -333,6 +333,7 @@ void rds_ib_conn_path_shutdown(struct rds_conn_path *cp);
 void rds_ib_state_change(struct sock *sk);
 int rds_ib_listen_init(void);
 void rds_ib_listen_stop(void);
+__printf(2, 3)
 void __rds_ib_conn_error(struct rds_connection *conn, const char *, ...);
 int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
 			     struct rdma_cm_event *event);
net/rds/rds.h +1 -0
index b2d17f0fafa8..fd0bccb2f9f9 100644
@@ -688,6 +688,7 @@ void __rds_conn_error(struct rds_connection *conn, const char *, ...);
 #define rds_conn_error(conn, fmt...) \
 	__rds_conn_error(conn, KERN_WARNING "RDS: " fmt)
 
+__printf(2, 3)
 void __rds_conn_path_error(struct rds_conn_path *cp, const char *, ...);
 #define rds_conn_path_error(cp, fmt...) \
 	__rds_conn_path_error(cp, KERN_WARNING "RDS: " fmt)
Signature · 6 lines
2.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html