diff options
author | Mathieu OTHACEHE <m.othacehe@gmail.com> | 2016-02-04 21:01:29 +0300 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2016-02-28 16:36:53 +0300 |
commit | ce9d8562536f1289f7cb7afb1d4b2e0d27d2eb2c (patch) | |
tree | b581d4b2b446f51489fdf0bd2275e0fc51a1eda9 /drivers/usb/serial/safe_serial.c | |
parent | 0f3083af5fde121abefddf70c84ba51455ae310f (diff) | |
download | linux-ce9d8562536f1289f7cb7afb1d4b2e0d27d2eb2c.tar.xz |
USB: serial: fix boolinit.cocci warnings
Bool initializations should use true and false. Bool tests don't need
comparisons.
Also, use IS_ENABLED instead of ifdef.
Generated by: scripts/coccinelle/misc/boolinit.cocci
Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/safe_serial.c')
-rw-r--r-- | drivers/usb/serial/safe_serial.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c index b2dff0f14743..93c6c9b08daa 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c @@ -76,13 +76,8 @@ #include <linux/usb.h> #include <linux/usb/serial.h> - -#ifndef CONFIG_USB_SERIAL_SAFE_PADDED -#define CONFIG_USB_SERIAL_SAFE_PADDED 0 -#endif - -static bool safe = 1; -static bool padded = CONFIG_USB_SERIAL_SAFE_PADDED; +static bool safe = true; +static bool padded = IS_ENABLED(CONFIG_USB_SERIAL_SAFE_PADDED); #define DRIVER_AUTHOR "sl@lineo.com, tbr@lineo.com, Johan Hovold <jhovold@gmail.com>" #define DRIVER_DESC "USB Safe Encapsulated Serial" @@ -278,7 +273,7 @@ static int safe_startup(struct usb_serial *serial) case LINEO_SAFESERIAL_CRC: break; case LINEO_SAFESERIAL_CRC_PADDED: - padded = 1; + padded = true; break; default: return -EINVAL; |