]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
firmware: make fw->data const
authorDavid Woodhouse <dwmw2@infradead.org>
Fri, 23 May 2008 17:38:49 +0000 (18:38 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 10 Jul 2008 13:29:25 +0000 (14:29 +0100)
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>
drivers/base/firmware_class.c
include/linux/firmware.h

index 9fd4a8534146e1747160e0a987fe8e4224eae01f..264b3a2cd8605c298cc1a1f4446edece6c1e63bc 100644 (file)
@@ -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;
index 6c7eff2ebada88cf3bb5e543a5bd36da0f7237cd..88718d60153c0332e1154ccc240cd5c15b46d618 100644 (file)
@@ -8,7 +8,7 @@
 
 struct firmware {
        size_t size;
-       u8 *data;
+       const u8 *data;
 };
 
 struct device;