From: Felix Fietkau Date: Thu, 19 Dec 2024 10:26:18 +0000 (+0100) Subject: blob: constify attr argument to blob_memdup X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3868f47c8f6c6570e62a3cdf8a7f26ffb1a67e6a;p=project%2Flibubox.git blob: constify attr argument to blob_memdup It is not modified, so it can be const Signed-off-by: Felix Fietkau --- diff --git a/blob.c b/blob.c index 65adb13..abcc9f2 100644 --- a/blob.c +++ b/blob.c @@ -323,7 +323,7 @@ blob_attr_equal(const struct blob_attr *a1, const struct blob_attr *a2) } struct blob_attr * -blob_memdup(struct blob_attr *attr) +blob_memdup(const struct blob_attr *attr) { struct blob_attr *ret; int size = blob_pad_len(attr); diff --git a/blob.h b/blob.h index 6d61876..13bc7cc 100644 --- a/blob.h +++ b/blob.h @@ -200,7 +200,7 @@ extern struct blob_attr *blob_put(struct blob_buf *buf, int id, const void *ptr, extern bool blob_check_type(const void *ptr, unsigned int len, int type); extern int blob_parse(struct blob_attr *attr, struct blob_attr **data, const struct blob_attr_info *info, int max); extern int blob_parse_untrusted(struct blob_attr *attr, size_t attr_len, struct blob_attr **data, const struct blob_attr_info *info, int max); -extern struct blob_attr *blob_memdup(struct blob_attr *attr); +extern struct blob_attr *blob_memdup(const struct blob_attr *attr); extern struct blob_attr *blob_put_raw(struct blob_buf *buf, const void *ptr, unsigned int len); static inline struct blob_attr *