All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HID: Fixing offset errors in bin_attribute read functions of roccat kone
@ 2010-06-20 17:19 ` Stefan Achatz
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Achatz @ 2010-06-20 17:19 UTC (permalink / raw)
  To: Jiri Kosina, Stefan Achatz, Stephen Rothwell, Tejun Heo,
	linux-input

Fixing wrong calculated offsets in bin_attribute read functions.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
---
 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 fcc2ccc..f776957 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,
 		count = sizeof(struct kone_settings) - off;
 
 	mutex_lock(&kone->kone_lock);
-	memcpy(buf, &kone->settings + off, count);
+	memcpy(buf, ((char const *)&kone->settings) + off, count);
 	mutex_unlock(&kone->kone_lock);
 
 	return count;
@@ -332,7 +332,7 @@ static ssize_t kone_sysfs_read_profilex(struct kobject *kobj,
 		count = sizeof(struct kone_profile) - off;
 
 	mutex_lock(&kone->kone_lock);
-	memcpy(buf, &kone->profiles[number - 1], sizeof(struct kone_profile));
+	memcpy(buf, ((char const *)&kone->profiles[number - 1]) + off, count);
 	mutex_unlock(&kone->kone_lock);
 
 	return count;
-- 
1.6.6.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] HID: Fixing offset errors in bin_attribute read functions of roccat kone
@ 2010-06-20 17:19 ` Stefan Achatz
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Achatz @ 2010-06-20 17:19 UTC (permalink / raw)
  To: Jiri Kosina, Stefan Achatz, Stephen Rothwell, Tejun Heo,
	linux-input, linux-kernel

Fixing wrong calculated offsets in bin_attribute read functions.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
---
 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 fcc2ccc..f776957 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,
 		count = sizeof(struct kone_settings) - off;
 
 	mutex_lock(&kone->kone_lock);
-	memcpy(buf, &kone->settings + off, count);
+	memcpy(buf, ((char const *)&kone->settings) + off, count);
 	mutex_unlock(&kone->kone_lock);
 
 	return count;
@@ -332,7 +332,7 @@ static ssize_t kone_sysfs_read_profilex(struct kobject *kobj,
 		count = sizeof(struct kone_profile) - off;
 
 	mutex_lock(&kone->kone_lock);
-	memcpy(buf, &kone->profiles[number - 1], sizeof(struct kone_profile));
+	memcpy(buf, ((char const *)&kone->profiles[number - 1]) + off, count);
 	mutex_unlock(&kone->kone_lock);
 
 	return count;
-- 
1.6.6.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: Fixing offset errors in bin_attribute read functions of roccat kone
  2010-06-20 17:19 ` Stefan Achatz
  (?)
@ 2010-06-21 12:05 ` Jiri Kosina
  -1 siblings, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2010-06-21 12:05 UTC (permalink / raw)
  To: Stefan Achatz; +Cc: Stephen Rothwell, Tejun Heo, linux-input, linux-kernel

On Sun, 20 Jun 2010, Stefan Achatz wrote:

> Fixing wrong calculated offsets in bin_attribute read functions.

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-21 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-20 17:19 [PATCH] HID: Fixing offset errors in bin_attribute read functions of roccat kone Stefan Achatz
2010-06-20 17:19 ` Stefan Achatz
2010-06-21 12:05 ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.