Skip to content

Commit

Permalink
firmware: make fw->data const
Browse files Browse the repository at this point in the history
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: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jul 10, 2008
1 parent fd4f80d commit b7a39bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ firmware_data_write(struct kobject *kobj, struct bin_attribute *bin_attr,
if (retval)
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);
retval = count;
Expand Down
2 changes: 1 addition & 1 deletion include/linux/firmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

struct firmware {
size_t size;
u8 *data;
const u8 *data;
};

struct device;
Expand Down

0 comments on commit b7a39bd

Please sign in to comment.