diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 21:09:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-02 04:33:45 -0400 |
commit | b3fe91c53a0a2e1a665b451bd306bcb5e56c2e97 (patch) | |
tree | 5d68be29e1a924e60b1e2c25be7ba4ba97fc3929 /include/net/netlink.h | |
parent | e545d71390b50a8dab75efb182a4adc3c2603962 (diff) |
netlink: Delete all NLA_PUT*() macros.
They were error prone due to an embedded goto, and the entire tree has
been converted away from using them.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r-- | include/net/netlink.h | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h index efbd2c1f4cde..785f37a3b44e 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -102,20 +102,6 @@ | |||
102 | * nla_put_flag(skb, type) add flag attribute to skb | 102 | * nla_put_flag(skb, type) add flag attribute to skb |
103 | * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb | 103 | * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb |
104 | * | 104 | * |
105 | * Exceptions Based Attribute Construction: | ||
106 | * NLA_PUT(skb, type, len, data) add attribute to skb | ||
107 | * NLA_PUT_U8(skb, type, value) add u8 attribute to skb | ||
108 | * NLA_PUT_U16(skb, type, value) add u16 attribute to skb | ||
109 | * NLA_PUT_U32(skb, type, value) add u32 attribute to skb | ||
110 | * NLA_PUT_U64(skb, type, value) add u64 attribute to skb | ||
111 | * NLA_PUT_STRING(skb, type, str) add string attribute to skb | ||
112 | * NLA_PUT_FLAG(skb, type) add flag attribute to skb | ||
113 | * NLA_PUT_MSECS(skb, type, jiffies) add msecs attribute to skb | ||
114 | * | ||
115 | * The meaning of these functions is equal to their lower case | ||
116 | * variants but they jump to the label nla_put_failure in case | ||
117 | * of a failure. | ||
118 | * | ||
119 | * Nested Attributes Construction: | 105 | * Nested Attributes Construction: |
120 | * nla_nest_start(skb, type) start a nested attribute | 106 | * nla_nest_start(skb, type) start a nested attribute |
121 | * nla_nest_end(skb, nla) finalize a nested attribute | 107 | * nla_nest_end(skb, nla) finalize a nested attribute |
@@ -927,60 +913,6 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, | |||
927 | return nla_put(skb, attrtype, sizeof(u64), &tmp); | 913 | return nla_put(skb, attrtype, sizeof(u64), &tmp); |
928 | } | 914 | } |
929 | 915 | ||
930 | #define NLA_PUT(skb, attrtype, attrlen, data) \ | ||
931 | do { \ | ||
932 | if (unlikely(nla_put(skb, attrtype, attrlen, data) < 0)) \ | ||
933 | goto nla_put_failure; \ | ||
934 | } while(0) | ||
935 | |||
936 | #define NLA_PUT_TYPE(skb, type, attrtype, value) \ | ||
937 | do { \ | ||
938 | type __tmp = value; \ | ||
939 | NLA_PUT(skb, attrtype, sizeof(type), &__tmp); \ | ||
940 | } while(0) | ||
941 | |||
942 | #define NLA_PUT_U8(skb, attrtype, value) \ | ||
943 | NLA_PUT_TYPE(skb, u8, attrtype, value) | ||
944 | |||
945 | #define NLA_PUT_U16(skb, attrtype, value) \ | ||
946 | NLA_PUT_TYPE(skb, u16, attrtype, value) | ||
947 | |||
948 | #define NLA_PUT_LE16(skb, attrtype, value) \ | ||
949 | NLA_PUT_TYPE(skb, __le16, attrtype, value) | ||
950 | |||
951 | #define NLA_PUT_BE16(skb, attrtype, value) \ | ||
952 | NLA_PUT_TYPE(skb, __be16, attrtype, value) | ||
953 | |||
954 | #define NLA_PUT_NET16(skb, attrtype, value) \ | ||
955 | NLA_PUT_BE16(skb, attrtype | NLA_F_NET_BYTEORDER, value) | ||
956 | |||
957 | #define NLA_PUT_U32(skb, attrtype, value) \ | ||
958 | NLA_PUT_TYPE(skb, u32, attrtype, value) | ||
959 | |||
960 | #define NLA_PUT_BE32(skb, attrtype, value) \ | ||
961 | NLA_PUT_TYPE(skb, __be32, attrtype, value) | ||
962 | |||
963 | #define NLA_PUT_NET32(skb, attrtype, value) \ | ||
964 | NLA_PUT_BE32(skb, attrtype | NLA_F_NET_BYTEORDER, value) | ||
965 | |||
966 | #define NLA_PUT_U64(skb, attrtype, value) \ | ||
967 | NLA_PUT_TYPE(skb, u64, attrtype, value) | ||
968 | |||
969 | #define NLA_PUT_BE64(skb, attrtype, value) \ | ||
970 | NLA_PUT_TYPE(skb, __be64, attrtype, value) | ||
971 | |||
972 | #define NLA_PUT_NET64(skb, attrtype, value) \ | ||
973 | NLA_PUT_BE64(skb, attrtype | NLA_F_NET_BYTEORDER, value) | ||
974 | |||
975 | #define NLA_PUT_STRING(skb, attrtype, value) \ | ||
976 | NLA_PUT(skb, attrtype, strlen(value) + 1, value) | ||
977 | |||
978 | #define NLA_PUT_FLAG(skb, attrtype) \ | ||
979 | NLA_PUT(skb, attrtype, 0, NULL) | ||
980 | |||
981 | #define NLA_PUT_MSECS(skb, attrtype, jiffies) \ | ||
982 | NLA_PUT_U64(skb, attrtype, jiffies_to_msecs(jiffies)) | ||
983 | |||
984 | /** | 916 | /** |
985 | * nla_get_u32 - return payload of u32 attribute | 917 | * nla_get_u32 - return payload of u32 attribute |
986 | * @nla: u32 netlink attribute | 918 | * @nla: u32 netlink attribute |