From 3868f47c8f6c6570e62a3cdf8a7f26ffb1a67e6a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 19 Dec 2024 11:26:18 +0100 Subject: [PATCH] blob: constify attr argument to blob_memdup It is not modified, so it can be const Signed-off-by: Felix Fietkau --- blob.c | 2 +- blob.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 * -- 2.30.2