diff mbox

surface pro 4: fix compare_const_fl.cocci warnings

Message ID alpine.DEB.2.02.1512272208490.2085@localhost6.localdomain6 (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Julia Lawall Dec. 27, 2015, 9:10 p.m. UTC
Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

CC: Weng Xuetian <wengxt@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

It's not a big deal, but the constant on the right looks nicer to me.  
key_code seems like the more important information, so it is nice to see 
it first.

 surfacepro_button.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Darren Hart Jan. 14, 2016, 11:15 p.m. UTC | #1
On Sun, Dec 27, 2015 at 10:10:58PM +0100, Julia Lawall wrote:
> Move constants to the right of binary operators.
> 
> Generated by: scripts/coccinelle/misc/compare_const_fl.cocci
> 
> CC: Weng Xuetian <wengxt@gmail.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>

Queued, thank you.
diff mbox

Patch

--- a/drivers/platform/x86/surfacepro_button.c
+++ b/drivers/platform/x86/surfacepro_button.c
@@ -111,7 +111,7 @@  static void surface_button_notify(struct
 		break;
 	}
 	input = button->input;
-	if (KEY_RESERVED == key_code)
+	if (key_code == KEY_RESERVED)
 		return;
 	if (pressed)
 		pm_wakeup_event(&device->dev, 0);