aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/rocker/rocker_tlv.h48
1 files changed, 30 insertions, 18 deletions
diff --git a/drivers/net/ethernet/rocker/rocker_tlv.h b/drivers/net/ethernet/rocker/rocker_tlv.h
index a63ef82e7c72..dfae3c9d57c6 100644
--- a/drivers/net/ethernet/rocker/rocker_tlv.h
+++ b/drivers/net/ethernet/rocker/rocker_tlv.h
@@ -139,40 +139,52 @@ rocker_tlv_start(struct rocker_desc_info *desc_info)
139int rocker_tlv_put(struct rocker_desc_info *desc_info, 139int rocker_tlv_put(struct rocker_desc_info *desc_info,
140 int attrtype, int attrlen, const void *data); 140 int attrtype, int attrlen, const void *data);
141 141
142static inline int rocker_tlv_put_u8(struct rocker_desc_info *desc_info, 142static inline int
143 int attrtype, u8 value) 143rocker_tlv_put_u8(struct rocker_desc_info *desc_info, int attrtype, u8 value)
144{ 144{
145 return rocker_tlv_put(desc_info, attrtype, sizeof(u8), &value); 145 u8 tmp = value; /* work around GCC PR81715 */
146
147 return rocker_tlv_put(desc_info, attrtype, sizeof(u8), &tmp);
146} 148}
147 149
148static inline int rocker_tlv_put_u16(struct rocker_desc_info *desc_info, 150static inline int
149 int attrtype, u16 value) 151rocker_tlv_put_u16(struct rocker_desc_info *desc_info, int attrtype, u16 value)
150{ 152{
151 return rocker_tlv_put(desc_info, attrtype, sizeof(u16), &value); 153 u16 tmp = value;
154
155 return rocker_tlv_put(desc_info, attrtype, sizeof(u16), &tmp);
152} 156}
153 157
154static inline int rocker_tlv_put_be16(struct rocker_desc_info *desc_info, 158static inline int
155 int attrtype, __be16 value) 159rocker_tlv_put_be16(struct rocker_desc_info *desc_info, int attrtype, __be16 value)
156{ 160{
157 return rocker_tlv_put(desc_info, attrtype, sizeof(__be16), &value); 161 __be16 tmp = value;
162
163 return rocker_tlv_put(desc_info, attrtype, sizeof(__be16), &tmp);
158} 164}
159 165
160static inline int rocker_tlv_put_u32(struct rocker_desc_info *desc_info, 166static inline int
161 int attrtype, u32 value) 167rocker_tlv_put_u32(struct rocker_desc_info *desc_info, int attrtype, u32 value)
162{ 168{
163 return rocker_tlv_put(desc_info, attrtype, sizeof(u32), &value); 169 u32 tmp = value;
170
171 return rocker_tlv_put(desc_info, attrtype, sizeof(u32), &tmp);
164} 172}
165 173
166static inline int rocker_tlv_put_be32(struct rocker_desc_info *desc_info, 174static inline int
167 int attrtype, __be32 value) 175rocker_tlv_put_be32(struct rocker_desc_info *desc_info, int attrtype, __be32 value)
168{ 176{
169 return rocker_tlv_put(desc_info, attrtype, sizeof(__be32), &value); 177 __be32 tmp = value;
178
179 return rocker_tlv_put(desc_info, attrtype, sizeof(__be32), &tmp);
170} 180}
171 181
172static inline int rocker_tlv_put_u64(struct rocker_desc_info *desc_info, 182static inline int
173 int attrtype, u64 value) 183rocker_tlv_put_u64(struct rocker_desc_info *desc_info, int attrtype, u64 value)
174{ 184{
175 return rocker_tlv_put(desc_info, attrtype, sizeof(u64), &value); 185 u64 tmp = value;
186
187 return rocker_tlv_put(desc_info, attrtype, sizeof(u64), &tmp);
176} 188}
177 189
178static inline struct rocker_tlv * 190static inline struct rocker_tlv *