Move blobmsg_namelen into header file so it's possible to reuse it in
blobmsg_data.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[BLOBMSG_TYPE_UNSPEC] = BLOB_ATTR_BINARY,
};
-static uint16_t
-blobmsg_namelen(const struct blobmsg_hdr *hdr)
-{
- return be16_to_cpu(hdr->namelen);
-}
-
bool blobmsg_check_attr(const struct blob_attr *attr, bool name)
{
return blobmsg_check_attr_len(attr, name, blob_raw_len(attr));
return blob_id(attr);
}
+static uint16_t blobmsg_namelen(const struct blobmsg_hdr *hdr)
+{
+ return be16_to_cpu(hdr->namelen);
+}
+
static inline void *blobmsg_data(const struct blob_attr *attr)
{
struct blobmsg_hdr *hdr;
data = (char *) blob_data(attr);
if (blob_is_extended(attr))
- data += blobmsg_hdrlen(be16_to_cpu(hdr->namelen));
+ data += blobmsg_hdrlen(blobmsg_namelen(hdr));
return data;
}