aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2014-06-04 13:00:16 -0400
committerRoland Dreier <roland@purestorage.com>2014-06-04 13:01:42 -0400
commit8385fd841468868e0b37a722530d75b0e8bfc5a8 (patch)
tree0bf3e68f1b5436545c21d09db28fee1971913cd4
parent5343c00dd0f2543d5751575515bdae4b801820ea (diff)
IB/core: Fix sparse warnings about redeclared functions
Fix a few functions that are declared with __attribute_const__ in the ib_verbs.h header file but defined without it in verbs.c. This gets rid of the following sparse warnings: drivers/infiniband/core/verbs.c:51:5: error: symbol 'ib_rate_to_mult' redeclared with different type (originally declared at include/rdma/ib_verbs.h:469) - different modifiers drivers/infiniband/core/verbs.c:68:14: error: symbol 'mult_to_ib_rate' redeclared with different type (originally declared at include/rdma/ib_verbs.h:607) - different modifiers drivers/infiniband/core/verbs.c:85:5: error: symbol 'ib_rate_to_mbps' redeclared with different type (originally declared at include/rdma/ib_verbs.h:476) - different modifiers drivers/infiniband/core/verbs.c:111:1: error: symbol 'rdma_node_get_transport' redeclared with different type (originally declared at include/rdma/ib_verbs.h:84) - different modifiers Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/core/verbs.c8
-rw-r--r--include/rdma/ib_verbs.h10
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 92525f855d82..c2b89cc5dbca 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -48,7 +48,7 @@
48 48
49#include "core_priv.h" 49#include "core_priv.h"
50 50
51int ib_rate_to_mult(enum ib_rate rate) 51__attribute_const__ int ib_rate_to_mult(enum ib_rate rate)
52{ 52{
53 switch (rate) { 53 switch (rate) {
54 case IB_RATE_2_5_GBPS: return 1; 54 case IB_RATE_2_5_GBPS: return 1;
@@ -65,7 +65,7 @@ int ib_rate_to_mult(enum ib_rate rate)
65} 65}
66EXPORT_SYMBOL(ib_rate_to_mult); 66EXPORT_SYMBOL(ib_rate_to_mult);
67 67
68enum ib_rate mult_to_ib_rate(int mult) 68__attribute_const__ enum ib_rate mult_to_ib_rate(int mult)
69{ 69{
70 switch (mult) { 70 switch (mult) {
71 case 1: return IB_RATE_2_5_GBPS; 71 case 1: return IB_RATE_2_5_GBPS;
@@ -82,7 +82,7 @@ enum ib_rate mult_to_ib_rate(int mult)
82} 82}
83EXPORT_SYMBOL(mult_to_ib_rate); 83EXPORT_SYMBOL(mult_to_ib_rate);
84 84
85int ib_rate_to_mbps(enum ib_rate rate) 85__attribute_const__ int ib_rate_to_mbps(enum ib_rate rate)
86{ 86{
87 switch (rate) { 87 switch (rate) {
88 case IB_RATE_2_5_GBPS: return 2500; 88 case IB_RATE_2_5_GBPS: return 2500;
@@ -107,7 +107,7 @@ int ib_rate_to_mbps(enum ib_rate rate)
107} 107}
108EXPORT_SYMBOL(ib_rate_to_mbps); 108EXPORT_SYMBOL(ib_rate_to_mbps);
109 109
110enum rdma_transport_type 110__attribute_const__ enum rdma_transport_type
111rdma_node_get_transport(enum rdma_node_type node_type) 111rdma_node_get_transport(enum rdma_node_type node_type)
112{ 112{
113 switch (node_type) { 113 switch (node_type) {
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index acd825182977..e9da1bc89d25 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -80,8 +80,8 @@ enum rdma_transport_type {
80 RDMA_TRANSPORT_USNIC_UDP 80 RDMA_TRANSPORT_USNIC_UDP
81}; 81};
82 82
83enum rdma_transport_type 83__attribute_const__ enum rdma_transport_type
84rdma_node_get_transport(enum rdma_node_type node_type) __attribute_const__; 84rdma_node_get_transport(enum rdma_node_type node_type);
85 85
86enum rdma_link_layer { 86enum rdma_link_layer {
87 IB_LINK_LAYER_UNSPECIFIED, 87 IB_LINK_LAYER_UNSPECIFIED,
@@ -466,14 +466,14 @@ enum ib_rate {
466 * converted to 2, since 5 Gbit/sec is 2 * 2.5 Gbit/sec. 466 * converted to 2, since 5 Gbit/sec is 2 * 2.5 Gbit/sec.
467 * @rate: rate to convert. 467 * @rate: rate to convert.
468 */ 468 */
469int ib_rate_to_mult(enum ib_rate rate) __attribute_const__; 469__attribute_const__ int ib_rate_to_mult(enum ib_rate rate);
470 470
471/** 471/**
472 * ib_rate_to_mbps - Convert the IB rate enum to Mbps. 472 * ib_rate_to_mbps - Convert the IB rate enum to Mbps.
473 * For example, IB_RATE_2_5_GBPS will be converted to 2500. 473 * For example, IB_RATE_2_5_GBPS will be converted to 2500.
474 * @rate: rate to convert. 474 * @rate: rate to convert.
475 */ 475 */
476int ib_rate_to_mbps(enum ib_rate rate) __attribute_const__; 476__attribute_const__ int ib_rate_to_mbps(enum ib_rate rate);
477 477
478enum ib_mr_create_flags { 478enum ib_mr_create_flags {
479 IB_MR_SIGNATURE_EN = 1, 479 IB_MR_SIGNATURE_EN = 1,
@@ -604,7 +604,7 @@ struct ib_mr_status {
604 * enum. 604 * enum.
605 * @mult: multiple to convert. 605 * @mult: multiple to convert.
606 */ 606 */
607enum ib_rate mult_to_ib_rate(int mult) __attribute_const__; 607__attribute_const__ enum ib_rate mult_to_ib_rate(int mult);
608 608
609struct ib_ah_attr { 609struct ib_ah_attr {
610 struct ib_global_route grh; 610 struct ib_global_route grh;