Skip to content

Commit

Permalink
blob: constify attr argument to blob_memdup
Browse files Browse the repository at this point in the history
It is not modified, so it can be const

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Dec 19, 2024
1 parent eb9bcb6 commit 3868f47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down

0 comments on commit 3868f47

Please sign in to comment.