summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2008-05-23 18:38:49 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-07-10 14:29:25 +0100
commitb7a39bd0afc4021e8ad2b1189e884551e147427f (patch)
tree41d36cfe80aee9cb7013b86b6122b85b775c0843
parentfd4f80de4612cc5255c108a8c13df88f89c46654 (diff)
downloadop-kernel-dev-b7a39bd0afc4021e8ad2b1189e884551e147427f.zip
op-kernel-dev-b7a39bd0afc4021e8ad2b1189e884551e147427f.tar.gz
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: David Woodhouse <dwmw2@infradead.org>
-rw-r--r--drivers/base/firmware_class.c2
-rw-r--r--include/linux/firmware.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 9fd4a85..264b3a2 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -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;
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 6c7eff2..88718d6 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -8,7 +8,7 @@
struct firmware {
size_t size;
- u8 *data;
+ const u8 *data;
};
struct device;
OpenPOWER on IntegriCloud