IB/core, cma: Make __attribute_const__ declarations sparse-friendly

Move the __attribute_const__ declarations such that sparse understands
that these apply to the function itself and not to the return type.
This avoids that sparse reports error messages like the following:

drivers/infiniband/core/verbs.c:73:12: error: symbol 'ib_event_msg' redeclared with different type (originally declared at include/rdma/ib_verbs.h:470) - different modifiers

Fixes: 2b1b5b6012 ("IB/core, cma: Nice log-friendly string helpers")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Bart Van Assche
2015-08-03 10:01:52 -07:00
committed by Doug Ledford
parent 39bfc271bd
commit db7489e076
4 changed files with 6 additions and 6 deletions

View File

@@ -476,7 +476,7 @@ enum ib_event_type {
IB_EVENT_GID_CHANGE,
};
__attribute_const__ const char *ib_event_msg(enum ib_event_type event);
const char *__attribute_const__ ib_event_msg(enum ib_event_type event);
struct ib_event {
struct ib_device *device;
@@ -726,7 +726,7 @@ enum ib_wc_status {
IB_WC_GENERAL_ERR
};
__attribute_const__ const char *ib_wc_status_msg(enum ib_wc_status status);
const char *__attribute_const__ ib_wc_status_msg(enum ib_wc_status status);
enum ib_wc_opcode {
IB_WC_SEND,