diff options
author | Stefan Achatz <erazor_de@users.sourceforge.net> | 2010-06-20 13:19:06 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-06-21 08:04:39 -0400 |
commit | cab6b16aca4ac12f731a523fe14770add2f9394a (patch) | |
tree | 5fc5c168e65b964b9913405835be21f394a1a6a5 /drivers/hid/hid-roccat-kone.c | |
parent | dfe5c7b7e710d8ed885068b0fcfa6f66ab685592 (diff) |
HID: roccat: fix offset errors in bin_attribute read
Fixing wrong calculated offsets in bin_attribute read functions.
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-roccat-kone.c')
-rw-r--r-- | drivers/hid/hid-roccat-kone.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index 0ab1df9d68ab..2aef6e4caf43 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c | |||
@@ -272,7 +272,7 @@ static ssize_t kone_sysfs_read_settings(struct file *fp, struct kobject *kobj, | |||
272 | count = sizeof(struct kone_settings) - off; | 272 | count = sizeof(struct kone_settings) - off; |
273 | 273 | ||
274 | mutex_lock(&kone->kone_lock); | 274 | mutex_lock(&kone->kone_lock); |
275 | memcpy(buf, &kone->settings + off, count); | 275 | memcpy(buf, ((char const *)&kone->settings) + off, count); |
276 | mutex_unlock(&kone->kone_lock); | 276 | mutex_unlock(&kone->kone_lock); |
277 | 277 | ||
278 | return count; | 278 | return count; |
@@ -332,7 +332,7 @@ static ssize_t kone_sysfs_read_profilex(struct kobject *kobj, | |||
332 | count = sizeof(struct kone_profile) - off; | 332 | count = sizeof(struct kone_profile) - off; |
333 | 333 | ||
334 | mutex_lock(&kone->kone_lock); | 334 | mutex_lock(&kone->kone_lock); |
335 | memcpy(buf, &kone->profiles[number - 1], sizeof(struct kone_profile)); | 335 | memcpy(buf, ((char const *)&kone->profiles[number - 1]) + off, count); |
336 | mutex_unlock(&kone->kone_lock); | 336 | mutex_unlock(&kone->kone_lock); |
337 | 337 | ||
338 | return count; | 338 | return count; |