HID: roccat: Fix "cannot create duplicate filename" problems
Subsystems (2)
Stefan Achatz
maintainerPATCH 1/1 HID: roccat: Fix "cannot create duplicate filename" problems
Fixing some wrong macro stringification/concatenation.
--- drivers/hid/hid-roccat-kone.c | 2 +- drivers/hid/hid-roccat-koneplus.c | 4 ++-- drivers/hid/hid-roccat-kovaplus.c | 4 ++-- drivers/hid/hid-roccat-pyra.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/hid/hid-roccat-kone.c +1 -1
@@ -382,7 +382,7 @@ static ssize_t kone_sysfs_write_profilex(struct file *fp, }#define PROFILE_ATTR (number) \ static struct bin_attribute bin_attr_profile##number = { \ - .attr = { .name = "profile##number", .mode = 0660 }, \ + .attr = { .name = "profile" #number, .mode = 0660 }, \ .size = sizeof(struct kone_profile), \ .read = kone_sysfs_read_profilex, \ .write = kone_sysfs_write_profilex, \
drivers/hid/hid-roccat-koneplus.c +2 -2
@@ -229,13 +229,13 @@ static ssize_t koneplus_sysfs_read_profilex_buttons(struct file *fp,#define PROFILE_ATTR (number) \ static struct bin_attribute bin_attr_profile##number##_settings = { \ - .attr = { .name = "profile##number##_settings", .mode = 0440 }, \ + .attr = { .name = "profile" #number "_settings", .mode = 0440 }, \ .size = KONEPLUS_SIZE_PROFILE_SETTINGS, \ .read = koneplus_sysfs_read_profilex_settings, \ .private = &profile_numbers[number-1], \ }; \ static struct bin_attribute bin_attr_profile##number##_buttons = { \ - .attr = { .name = "profile##number##_buttons", .mode = 0440 }, \ + .attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \ .size = KONEPLUS_SIZE_PROFILE_BUTTONS, \ .read = koneplus_sysfs_read_profilex_buttons, \ .private = &profile_numbers[number-1], \
drivers/hid/hid-roccat-kovaplus.c +2 -2
@@ -257,13 +257,13 @@ static ssize_t kovaplus_sysfs_read_profilex_buttons(struct file *fp,#define PROFILE_ATTR (number) \ static struct bin_attribute bin_attr_profile##number##_settings = { \ - .attr = { .name = "profile##number##_settings", .mode = 0440 }, \ + .attr = { .name = "profile" #number "_settings", .mode = 0440 }, \ .size = KOVAPLUS_SIZE_PROFILE_SETTINGS, \ .read = kovaplus_sysfs_read_profilex_settings, \ .private = &profile_numbers[number-1], \ }; \ static struct bin_attribute bin_attr_profile##number##_buttons = { \ - .attr = { .name = "profile##number##_buttons", .mode = 0440 }, \ + .attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \ .size = KOVAPLUS_SIZE_PROFILE_BUTTONS, \ .read = kovaplus_sysfs_read_profilex_buttons, \ .private = &profile_numbers[number-1], \
drivers/hid/hid-roccat-pyra.c +2 -2
@@ -225,13 +225,13 @@ static ssize_t pyra_sysfs_read_profilex_buttons(struct file *fp,#define PROFILE_ATTR (number) \ static struct bin_attribute bin_attr_profile##number##_settings = { \ - .attr = { .name = "profile##number##_settings", .mode = 0440 }, \ + .attr = { .name = "profile" #number "_settings", .mode = 0440 }, \ .size = PYRA_SIZE_PROFILE_SETTINGS, \ .read = pyra_sysfs_read_profilex_settings, \ .private = &profile_numbers[number-1], \ }; \ static struct bin_attribute bin_attr_profile##number##_buttons = { \ - .attr = { .name = "profile##number##_buttons", .mode = 0440 }, \ + .attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \ .size = PYRA_SIZE_PROFILE_BUTTONS, \ .read = pyra_sysfs_read_profilex_buttons, \ .private = &profile_numbers[number-1], \
Signature · 1 line
1.7.3.4
Quoted 16 lines · Stefan Achatz
Fixing some wrong macro stringification/concatenation.
Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Stefan Achatz <[email protected]>--- drivers/hid/hid-roccat-kone.c | 2 +- drivers/hid/hid-roccat-koneplus.c | 4 ++-- drivers/hid/hid-roccat-kovaplus.c | 4 ++-- drivers/hid/hid-roccat-pyra.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)drivers/hid/hid-roccat-kone.c +0
-0
drivers/hid/hid-roccat-kone.c static ssize_t kone_sysfs_write_profilex(struct file *fp, · line 385
Quoted 5 lines
drivers/hid/hid-roccat-kone.c +1
-1@@ -382,7 +382,7 @@ static ssize_t kone_sysfs_write_profilex(struct file *fp, }#define PROFILE_ATTR (number) \ static struct bin_attribute bin_attr_profile##number = { \ - .attr = { .name = "profile##number", .mode = 0660 }, \ + .attr = { .name = "profile" #number, .mode = 0660 }, \
Ugh, very sorry about that, I hate macros in C at times :)
Jiri, can you take this through your tree, or I can if you want, it needs to go in for 3.12-final.
If yours, feel free to add:
Stefan, thanks for fixing my bugs, it's much appreciated.
greg k-h
Quoted 24 lines · Greg KH
Quoted 16 lines
Fixing some wrong macro stringification/concatenation.
Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Stefan Achatz <[email protected]>--- drivers/hid/hid-roccat-kone.c | 2 +- drivers/hid/hid-roccat-koneplus.c | 4 ++-- drivers/hid/hid-roccat-kovaplus.c | 4 ++-- drivers/hid/hid-roccat-pyra.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)drivers/hid/hid-roccat-kone.c +0
-0drivers/hid/hid-roccat-kone.c static ssize_t kone_sysfs_write_profilex(struct file *fp, · line 385
Quoted 5 lines
drivers/hid/hid-roccat-kone.c +1
-1@@ -382,7 +382,7 @@ static ssize_t kone_sysfs_write_profilex(struct file *fp, }#define PROFILE_ATTR (number) \ static struct bin_attribute bin_attr_profile##number = { \ - .attr = { .name = "profile##number", .mode = 0660 }, \ + .attr = { .name = "profile" #number, .mode = 0660 }, \Ugh, very sorry about that, I hate macros in C at times :)
Quoted 8 lines
Jiri, can you take this through your tree, or I can if you want, it needs to go in for 3.12-final.
If yours, feel free to add:
Stefan, thanks for fixing my bugs, it's much appreciated.
Thanks, queued, will go to Linus for 3.12 still.
Signature · 2 lines
Jiri Kosina SUSE Labs