ACPI: video: checkpatch cleanups
cover ACPI: video: checkpatch cleanups
Fix numerous checkpatch errors in acpi/acpi_video.c.
Note: First kernel submission. I'm not sure if a 4 patch series is appropriate, but this is how I would approach it.
Jean-Ralph Aviles (4):
ACPI: video: Do not initialise device_id_scheme
ACPI: video: Fix block comment warnings
ACPI: video: Fix quoted strings split across lines
ACPI: video: Add blank line after declaration
drivers/acpi/acpi_video.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
Signature · 1 line
2.51.2
PATCH 1/4 ACPI: video: Do not initialise device_id_scheme
Reported by checkpatch:
ERROR: do not initialise statics to false
--- drivers/acpi/acpi_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_video.c +1 -1
@@ -63,7 +63,7 @@ MODULE_PARM_DESC(hw_changes_brightness,* Whether the struct acpi_video_device_attrib::device_id_scheme bit should be * assumed even if not actually set. */ -static bool device_id_scheme = false; +static bool device_id_scheme;module_param (device_id_scheme, bool,0444 );static int only_lcd;
Signature · 1 line
2.51.2
PATCH 2/4 ACPI: video: Fix block comment warnings
In reply to Jean-Ralph AvilesReported by checkpatch:
WARNING: Block comments use a trailing */ on a separate line
--- drivers/acpi/acpi_video.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/acpi/acpi_video.c +3 -6
@@ -126,8 +126,7 @@ struct acpi_video_device_attrib { u32 display_type:4; /* Describe the specific type in use */ u32 vendor_specific:4; /* Chipset Vendor Specific */ u32 bios_can_detect:1; /* BIOS can detect the device */ - u32 depend_on_vga:1; /* Non-VGA output device whose power is related to -the VGA device. */ + u32 depend_on_vga:1; /* Non-VGA output device whose power is related to the VGA device */ u32 pipe_id:3; /* For VGA multiple-head devices. */ u32 reserved:10; /* Must be 0 */
@@ -1536,13 +1535,11 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) input = video->input;switch (event) { -case ACPI_VIDEO_NOTIFY_SWITCH :/* User requested a switch, -* most likely via hotkey. */ +case ACPI_VIDEO_NOTIFY_SWITCH :/* User requested a switch, most likely via hotkey. */ keycode =KEY_SWITCHVIDEOMODE ;break ; -case ACPI_VIDEO_NOTIFY_PROBE :/* User plugged in or removed a video -* connector. */ +case ACPI_VIDEO_NOTIFY_PROBE :/* User plugged in or removed a video connector. */ acpi_video_device_enumerate (video);acpi_video_device_rebind (video); keycode =KEY_SWITCHVIDEOMODE ;
Signature · 1 line
2.51.2
PATCH 3/4 ACPI: video: Fix quoted strings split across lines
In reply to Jean-Ralph AvilesReported by checkpatch:
WARNING: quoted string split across lines
--- drivers/acpi/acpi_video.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/acpi/acpi_video.c +2 -6
@@ -56,8 +56,7 @@ MODULE_PARM_DESC(report_key_events,static int hw_changes_brightness =-1 ;module_param (hw_changes_brightness, int,0644 );MODULE_PARM_DESC (hw_changes_brightness, -"Set this to 1 on buggy hw which changes the brightness itself when " -"a hotkey is pressed: -1: auto, 0: normal 1: hw-changes-brightness" ); +"Set this to 1 on buggy hw which changes the brightness itself when a hotkey is pressed: -1: auto, 0: normal 1: hw-changes-brightness" );/* * Whether the struct acpi_video_device_attrib::device_id_scheme bit should be
@@ -1987,10 +1986,7 @@ static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,if (!allow_duplicates &&acpi_video_bus_dev_is_duplicate (&aux_dev->dev)) {pr_info (FW_BUG -"Duplicate ACPI video bus devices for the" -" same VGA controller, please try module " -"parameter \"video.allow_duplicates=1\"" -"if the current driver doesn't work.\n" ); +"Duplicate ACPI video bus devices for the same VGA controller, please try module parameter \"video.allow_duplicates=1\" if the current driver doesn't work.\n" );return -ENODEV ; }
Signature · 1 line
2.51.2
PATCH 4/4 ACPI: video: Add blank line after declaration
In reply to Jean-Ralph AvilesReported by checkpatch:
WARNING: Missing a blank line after declarations
--- drivers/acpi/acpi_video.c | 1 + 1 file changed, 1 insertion(+)
drivers/acpi/acpi_video.c +1 -0
@@ -1361,6 +1361,7 @@ acpi_video_get_next_level(struct acpi_video_device *device, u32 level_current, u32 event) { int min, max, min_above, max_below, i, l, delta = 255; + max = max_below =0 ; min = min_above =255 ;/* Find closest level to level_current */
Signature · 1 line
2.51.2
Re: [PATCH 1/4] ACPI: video: Do not initialise device_id_scheme
In reply to Jean-Ralph AvilesQuoted 14 lines · Jean-Ralph Aviles
Reported by checkpatch:
ERROR: do not initialise statics to false
Signed-off-by Jean-Ralph Aviles <[email protected]>--- drivers/acpi/acpi_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/acpi_video.c +0
-0
drivers/acpi/acpi_video.c MODULE_PARM_DESC(hw_changes_brightness,
Quoted 9 lines
drivers/acpi/acpi_video.c +1
-2@@ -63,7 +63,7 @@ MODULE_PARM_DESC(hw_changes_brightness,* Whether the struct acpi_video_device_attrib::device_id_scheme bit should be * assumed even if not actually set. */ -static bool device_id_scheme = false; +static bool device_id_scheme;module_param (device_id_scheme, bool,0444 );static int only_lcd; --
Applied as 7.2 material (with adjusted subject and changelog).
The rest of the series has not been applied because they are minor cleanups that I would do differently.
Generally speaking, checkpatch is for new code.
Thanks!