Commit b7a39bd0 authored by David Woodhouse's avatar David Woodhouse Committed by David Woodhouse

firmware: make fw->data const

In preparation for supporting firmware files linked into the static
kernel, make fw->data const to ensure that users aren't modifying it (so
that we can pass a pointer to the original in-kernel copy, rather than
having to copy it).
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent fd4f80de
...@@ -257,7 +257,7 @@ firmware_data_write(struct kobject *kobj, struct bin_attribute *bin_attr, ...@@ -257,7 +257,7 @@ firmware_data_write(struct kobject *kobj, struct bin_attribute *bin_attr,
if (retval) if (retval)
goto out; goto out;
memcpy(fw->data + offset, buffer, count); memcpy((u8 *)fw->data + offset, buffer, count);
fw->size = max_t(size_t, offset + count, fw->size); fw->size = max_t(size_t, offset + count, fw->size);
retval = count; retval = count;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
struct firmware { struct firmware {
size_t size; size_t size;
u8 *data; const u8 *data;
}; };
struct device; struct device;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment