* [PATCH 1/2] acer-wmi: Message logging neatening
@ 2011-11-29 19:04 Joe Perches
2011-11-29 19:04 ` [PATCH 2/2] acerhdf: " Joe Perches
2011-12-05 3:57 ` [PATCH 1/2] acer-wmi: " joeyli
0 siblings, 2 replies; 5+ messages in thread
From: Joe Perches @ 2011-11-29 19:04 UTC (permalink / raw)
To: Joey Lee, Matthew Garrett; +Cc: platform-driver-x86, linux-kernel
Use pr_warn not pr_warning.
Coalesce formats.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/platform/x86/acer-wmi.c | 29 ++++++++++++++---------------
1 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index b848277..ea48346 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -978,7 +978,7 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
return AE_ERROR;
}
if (obj->buffer.length != 8) {
- pr_warning("Unknown buffer length %d\n", obj->buffer.length);
+ pr_warn("Unknown buffer length %d\n", obj->buffer.length);
kfree(obj);
return AE_ERROR;
}
@@ -987,8 +987,8 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
kfree(obj);
if (return_value.error_code || return_value.ec_return_value) {
- pr_warning("Get Current Device Status failed: "
- "0x%x - 0x%x\n", return_value.error_code,
+ pr_warn("Get Current Device Status failed: 0x%x - 0x%x\n",
+ return_value.error_code,
return_value.ec_return_value);
return status;
}
@@ -1011,7 +1011,7 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
return AE_ERROR;
}
if (obj->buffer.length != 4) {
- pr_warning("Unknown buffer length %d\n", obj->buffer.length);
+ pr_warn("Unknown buffer length %d\n", obj->buffer.length);
kfree(obj);
return AE_ERROR;
}
@@ -1020,8 +1020,8 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
kfree(obj);
if (return_value.error_code || return_value.ec_return_value)
- pr_warning("Set Device Status failed: "
- "0x%x - 0x%x\n", return_value.error_code,
+ pr_warn("Set Device Status failed: 0x%x - 0x%x\n",
+ return_value.error_code,
return_value.ec_return_value);
return status;
@@ -1460,8 +1460,8 @@ static ssize_t show_bool_threeg(struct device *dev,
u32 result; \
acpi_status status;
- pr_info("This threeg sysfs will be removed in 2012"
- " - used by: %s\n", current->comm);
+ pr_info("This threeg sysfs will be removed in 2012 - used by: %s\n",
+ current->comm);
status = get_u32(&result, ACER_CAP_THREEG);
if (ACPI_SUCCESS(status))
return sprintf(buf, "%u\n", result);
@@ -1473,8 +1473,8 @@ static ssize_t set_bool_threeg(struct device *dev,
{
u32 tmp = simple_strtoul(buf, NULL, 10);
acpi_status status = set_u32(tmp, ACER_CAP_THREEG);
- pr_info("This threeg sysfs will be removed in 2012"
- " - used by: %s\n", current->comm);
+ pr_info("This threeg sysfs will be removed in 2012 - used by: %s\n",
+ current->comm);
if (ACPI_FAILURE(status))
return -EINVAL;
return count;
@@ -1485,8 +1485,8 @@ static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
char *buf)
{
- pr_info("This interface sysfs will be removed in 2012"
- " - used by: %s\n", current->comm);
+ pr_info("This interface sysfs will be removed in 2012 - used by: %s\n",
+ current->comm);
switch (interface->type) {
case ACER_AMW0:
return sprintf(buf, "AMW0\n");
@@ -1954,8 +1954,7 @@ static int __init acer_wmi_init(void)
if (acpi_video_backlight_support()) {
interface->capability &= ~ACER_CAP_BRIGHTNESS;
- pr_info("Brightness must be controlled by "
- "generic video driver\n");
+ pr_info("Brightness must be controlled by generic video driver\n");
}
if (wmi_has_guid(WMID_GUID3)) {
@@ -1980,7 +1979,7 @@ static int __init acer_wmi_init(void)
err = platform_driver_register(&acer_platform_driver);
if (err) {
- pr_err("Unable to register platform driver.\n");
+ pr_err("Unable to register platform driver\n");
goto error_platform_register;
}
--
1.7.6.405.gc1be0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] acerhdf: Message logging neatening
2011-11-29 19:04 [PATCH 1/2] acer-wmi: Message logging neatening Joe Perches
@ 2011-11-29 19:04 ` Joe Perches
2011-12-12 18:26 ` Peter Feuerer
2011-12-05 3:57 ` [PATCH 1/2] acer-wmi: " joeyli
1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2011-11-29 19:04 UTC (permalink / raw)
To: Peter Feuerer, Matthew Garrett; +Cc: platform-driver-x86, linux-kernel
Use pr_warn not pr_warning.
Coalesce formats.
Argument aligning.
Remove superfluous parentheses.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/platform/x86/acerhdf.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 833c0ec..639db4d 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -262,12 +262,11 @@ static void acerhdf_change_fanstate(int state)
unsigned char cmd;
if (verbose)
- pr_notice("fan %s\n", (state == ACERHDF_FAN_OFF) ?
- "OFF" : "ON");
+ pr_notice("fan %s\n", state == ACERHDF_FAN_OFF ? "OFF" : "ON");
if ((state != ACERHDF_FAN_OFF) && (state != ACERHDF_FAN_AUTO)) {
pr_err("invalid fan state %d requested, setting to auto!\n",
- state);
+ state);
state = ACERHDF_FAN_AUTO;
}
@@ -282,19 +281,18 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal)
{
if (fanon > ACERHDF_MAX_FANON) {
pr_err("fanon temperature too high, set to %d\n",
- ACERHDF_MAX_FANON);
+ ACERHDF_MAX_FANON);
fanon = ACERHDF_MAX_FANON;
}
if (kernelmode && prev_interval != interval) {
if (interval > ACERHDF_MAX_INTERVAL) {
pr_err("interval too high, set to %d\n",
- ACERHDF_MAX_INTERVAL);
+ ACERHDF_MAX_INTERVAL);
interval = ACERHDF_MAX_INTERVAL;
}
if (verbose)
- pr_notice("interval changed to: %d\n",
- interval);
+ pr_notice("interval changed to: %d\n", interval);
thermal->polling_delay = interval*1000;
prev_interval = interval;
}
@@ -605,8 +603,8 @@ static int acerhdf_check_hardware(void)
}
if (!bios_cfg) {
- pr_err("unknown (unsupported) BIOS version %s/%s/%s, "
- "please report, aborting!\n", vendor, product, version);
+ pr_err("unknown (unsupported) BIOS version %s/%s/%s, please report, aborting!\n",
+ vendor, product, version);
return -EINVAL;
}
@@ -616,8 +614,7 @@ static int acerhdf_check_hardware(void)
*/
if (!kernelmode) {
pr_notice("Fan control off, to enable do:\n");
- pr_notice("echo -n \"enabled\" > "
- "/sys/class/thermal/thermal_zone0/mode\n");
+ pr_notice("echo -n \"enabled\" > /sys/class/thermal/thermal_zone0/mode\n");
}
return 0;
--
1.7.6.405.gc1be0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] acer-wmi: Message logging neatening
2011-11-29 19:04 [PATCH 1/2] acer-wmi: Message logging neatening Joe Perches
2011-11-29 19:04 ` [PATCH 2/2] acerhdf: " Joe Perches
@ 2011-12-05 3:57 ` joeyli
1 sibling, 0 replies; 5+ messages in thread
From: joeyli @ 2011-12-05 3:57 UTC (permalink / raw)
To: Joe Perches; +Cc: Joey Lee, Matthew Garrett, platform-driver-x86, linux-kernel
Hi Joe,
於 二,2011-11-29 於 11:04 -0800,Joe Perches 提到:
> Use pr_warn not pr_warning.
> Coalesce formats.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/platform/x86/acer-wmi.c | 29 ++++++++++++++---------------
> 1 files changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index b848277..ea48346 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -978,7 +978,7 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
> return AE_ERROR;
> }
> if (obj->buffer.length != 8) {
> - pr_warning("Unknown buffer length %d\n", obj->buffer.length);
> + pr_warn("Unknown buffer length %d\n", obj->buffer.length);
> kfree(obj);
> return AE_ERROR;
> }
> @@ -987,8 +987,8 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
> kfree(obj);
>
> if (return_value.error_code || return_value.ec_return_value) {
> - pr_warning("Get Current Device Status failed: "
> - "0x%x - 0x%x\n", return_value.error_code,
> + pr_warn("Get Current Device Status failed: 0x%x - 0x%x\n",
> + return_value.error_code,
> return_value.ec_return_value);
> return status;
> }
> @@ -1011,7 +1011,7 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
> return AE_ERROR;
> }
> if (obj->buffer.length != 4) {
> - pr_warning("Unknown buffer length %d\n", obj->buffer.length);
> + pr_warn("Unknown buffer length %d\n", obj->buffer.length);
> kfree(obj);
> return AE_ERROR;
> }
> @@ -1020,8 +1020,8 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
> kfree(obj);
>
> if (return_value.error_code || return_value.ec_return_value)
> - pr_warning("Set Device Status failed: "
> - "0x%x - 0x%x\n", return_value.error_code,
> + pr_warn("Set Device Status failed: 0x%x - 0x%x\n",
> + return_value.error_code,
> return_value.ec_return_value);
>
> return status;
> @@ -1460,8 +1460,8 @@ static ssize_t show_bool_threeg(struct device *dev,
> u32 result; \
> acpi_status status;
>
> - pr_info("This threeg sysfs will be removed in 2012"
> - " - used by: %s\n", current->comm);
> + pr_info("This threeg sysfs will be removed in 2012 - used by: %s\n",
> + current->comm);
> status = get_u32(&result, ACER_CAP_THREEG);
> if (ACPI_SUCCESS(status))
> return sprintf(buf, "%u\n", result);
> @@ -1473,8 +1473,8 @@ static ssize_t set_bool_threeg(struct device *dev,
> {
> u32 tmp = simple_strtoul(buf, NULL, 10);
> acpi_status status = set_u32(tmp, ACER_CAP_THREEG);
> - pr_info("This threeg sysfs will be removed in 2012"
> - " - used by: %s\n", current->comm);
> + pr_info("This threeg sysfs will be removed in 2012 - used by: %s\n",
> + current->comm);
> if (ACPI_FAILURE(status))
> return -EINVAL;
> return count;
> @@ -1485,8 +1485,8 @@ static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
> static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
> char *buf)
> {
> - pr_info("This interface sysfs will be removed in 2012"
> - " - used by: %s\n", current->comm);
> + pr_info("This interface sysfs will be removed in 2012 - used by: %s\n",
> + current->comm);
> switch (interface->type) {
> case ACER_AMW0:
> return sprintf(buf, "AMW0\n");
> @@ -1954,8 +1954,7 @@ static int __init acer_wmi_init(void)
>
> if (acpi_video_backlight_support()) {
> interface->capability &= ~ACER_CAP_BRIGHTNESS;
> - pr_info("Brightness must be controlled by "
> - "generic video driver\n");
> + pr_info("Brightness must be controlled by generic video driver\n");
> }
>
> if (wmi_has_guid(WMID_GUID3)) {
> @@ -1980,7 +1979,7 @@ static int __init acer_wmi_init(void)
>
> err = platform_driver_register(&acer_platform_driver);
> if (err) {
> - pr_err("Unable to register platform driver.\n");
> + pr_err("Unable to register platform driver\n");
> goto error_platform_register;
> }
>
Patch good to me.
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Thanks
Joey Lee
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] acerhdf: Message logging neatening
2011-11-29 19:04 ` [PATCH 2/2] acerhdf: " Joe Perches
@ 2011-12-12 18:26 ` Peter Feuerer
2011-12-12 18:56 ` Joe Perches
0 siblings, 1 reply; 5+ messages in thread
From: Peter Feuerer @ 2011-12-12 18:26 UTC (permalink / raw)
To: Joe Perches; +Cc: Matthew Garrett, platform-driver-x86, linux-kernel
Hi Joe,
thanks for sending this patch, I've got some comments on it.
Joe Perches writes:
> Use pr_warn not pr_warning.
Don't see any line, where you changed this…
> Coalesce formats.
> Argument aligning.
> Remove superfluous parentheses.
Discussed inline.
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/platform/x86/acerhdf.c | 19 ++++++++-----------
> 1 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
> index 833c0ec..639db4d 100644
> --- a/drivers/platform/x86/acerhdf.c
> +++ b/drivers/platform/x86/acerhdf.c
> @@ -262,12 +262,11 @@ static void acerhdf_change_fanstate(int state)
> unsigned char cmd;
>
> if (verbose)
> - pr_notice("fan %s\n", (state == ACERHDF_FAN_OFF) ?
> - "OFF" : "ON");
> + pr_notice("fan %s\n", state == ACERHDF_FAN_OFF ? "OFF" : "ON");
In my opinion the one with brackets is easier to read.
> if ((state != ACERHDF_FAN_OFF) && (state != ACERHDF_FAN_AUTO)) {
> pr_err("invalid fan state %d requested, setting to auto!\n",
> - state);
> + state);
Is it written somewhere to use spaces instead of a tab in such cases? I like
tab more. (1)
> state = ACERHDF_FAN_AUTO;
> }
>
> @@ -282,19 +281,18 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal)
> {
> if (fanon > ACERHDF_MAX_FANON) {
> pr_err("fanon temperature too high, set to %d\n",
> - ACERHDF_MAX_FANON);
> + ACERHDF_MAX_FANON);
see (1). - but maybe one tab shall be removed.
> fanon = ACERHDF_MAX_FANON;
> }
>
> if (kernelmode && prev_interval != interval) {
> if (interval > ACERHDF_MAX_INTERVAL) {
> pr_err("interval too high, set to %d\n",
> - ACERHDF_MAX_INTERVAL);
> + ACERHDF_MAX_INTERVAL);
see (1).
> interval = ACERHDF_MAX_INTERVAL;
> }
> if (verbose)
> - pr_notice("interval changed to: %d\n",
> - interval);
> + pr_notice("interval changed to: %d\n", interval);
I agree on this.
> thermal->polling_delay = interval*1000;
> prev_interval = interval;
> }
> @@ -605,8 +603,8 @@ static int acerhdf_check_hardware(void)
> }
>
> if (!bios_cfg) {
> - pr_err("unknown (unsupported) BIOS version %s/%s/%s, "
> - "please report, aborting!\n", vendor, product, version);
> + pr_err("unknown (unsupported) BIOS version %s/%s/%s, please report, aborting!\n",
> + vendor, product, version);
disagree, as it exceeds 80 chars.
> return -EINVAL;
> }
>
> @@ -616,8 +614,7 @@ static int acerhdf_check_hardware(void)
> */
> if (!kernelmode) {
> pr_notice("Fan control off, to enable do:\n");
> - pr_notice("echo -n \"enabled\" > "
> - "/sys/class/thermal/thermal_zone0/mode\n");
> + pr_notice("echo -n \"enabled\" > /sys/class/thermal/thermal_zone0/mode\n");
disagree, as it exceeds 80 chars when using tabstop=8.
> }
>
> return 0;
> --
> 1.7.6.405.gc1be0
>
--
kind regards,
--peter;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] acerhdf: Message logging neatening
2011-12-12 18:26 ` Peter Feuerer
@ 2011-12-12 18:56 ` Joe Perches
0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2011-12-12 18:56 UTC (permalink / raw)
To: Peter Feuerer; +Cc: Matthew Garrett, platform-driver-x86, linux-kernel
On Mon, 2011-12-12 at 19:26 +0100, Peter Feuerer wrote:
> > @@ -605,8 +603,8 @@ static int acerhdf_check_hardware(void)
> > }
> >
> > if (!bios_cfg) {
> > - pr_err("unknown (unsupported) BIOS version %s/%s/%s, "
> > - "please report, aborting!\n", vendor, product, version);
> > + pr_err("unknown (unsupported) BIOS version %s/%s/%s, please report, aborting!\n",
> > + vendor, product, version);
>
> disagree, as it exceeds 80 chars.
Format strings should be coalesced.
checkpatch ignores these long lines.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-12-12 18:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-29 19:04 [PATCH 1/2] acer-wmi: Message logging neatening Joe Perches
2011-11-29 19:04 ` [PATCH 2/2] acerhdf: " Joe Perches
2011-12-12 18:26 ` Peter Feuerer
2011-12-12 18:56 ` Joe Perches
2011-12-05 3:57 ` [PATCH 1/2] acer-wmi: " joeyli
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.