提交 b565b3fb 编写于 作者: A Aybuke Ozdemir 提交者: Greg Kroah-Hartman

Staging: panel: Replace NULL comparison.

Use ! operating instead of NULL checks.
Addresses "CHECK: Comparison to NULL" from checkpatch.pl.
Signed-off-by: NAybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 5a731c70
...@@ -920,7 +920,7 @@ static void lcd_gotoxy(void) ...@@ -920,7 +920,7 @@ static void lcd_gotoxy(void)
static void lcd_print(char c) static void lcd_print(char c)
{ {
if (lcd.addr.x < lcd.bwidth) { if (lcd.addr.x < lcd.bwidth) {
if (lcd_char_conv != NULL) if (lcd_char_conv)
c = lcd_char_conv[(unsigned char)c]; c = lcd_char_conv[(unsigned char)c];
lcd_write_data(c); lcd_write_data(c);
lcd.addr.x++; lcd.addr.x++;
...@@ -1118,7 +1118,7 @@ static inline int handle_lcd_special_code(void) ...@@ -1118,7 +1118,7 @@ static inline int handle_lcd_special_code(void)
break; break;
case '*': case '*':
/* flash back light using the keypad timer */ /* flash back light using the keypad timer */
if (scan_timer.function != NULL) { if (scan_timer.function) {
if (lcd.light_tempo == 0 if (lcd.light_tempo == 0
&& ((lcd.flags & LCD_FLAG_L) == 0)) && ((lcd.flags & LCD_FLAG_L) == 0))
lcd_backlight(1); lcd_backlight(1);
...@@ -1200,7 +1200,7 @@ static inline int handle_lcd_special_code(void) ...@@ -1200,7 +1200,7 @@ static inline int handle_lcd_special_code(void)
char value; char value;
int addr; int addr;
if (strchr(esc, ';') == NULL) if (!strchr(esc, ';'))
break; break;
esc++; esc++;
...@@ -1246,7 +1246,7 @@ static inline int handle_lcd_special_code(void) ...@@ -1246,7 +1246,7 @@ static inline int handle_lcd_special_code(void)
} }
case 'x': /* gotoxy : LxXXX[yYYY]; */ case 'x': /* gotoxy : LxXXX[yYYY]; */
case 'y': /* gotoxy : LyYYY[xXXX]; */ case 'y': /* gotoxy : LyYYY[xXXX]; */
if (strchr(esc, ';') == NULL) if (!strchr(esc, ';'))
break; break;
while (*esc) { while (*esc) {
...@@ -1844,7 +1844,7 @@ static inline int input_state_high(struct logical_input *input) ...@@ -1844,7 +1844,7 @@ static inline int input_state_high(struct logical_input *input)
if ((input->type == INPUT_TYPE_STD) && if ((input->type == INPUT_TYPE_STD) &&
(input->high_timer == 0)) { (input->high_timer == 0)) {
input->high_timer++; input->high_timer++;
if (input->u.std.press_fct != NULL) if (input->u.std.press_fct)
input->u.std.press_fct(input->u.std.press_data); input->u.std.press_fct(input->u.std.press_data);
} else if (input->type == INPUT_TYPE_KBD) { } else if (input->type == INPUT_TYPE_KBD) {
/* will turn on the light */ /* will turn on the light */
...@@ -1924,7 +1924,7 @@ static inline void input_state_falling(struct logical_input *input) ...@@ -1924,7 +1924,7 @@ static inline void input_state_falling(struct logical_input *input)
if (input->type == INPUT_TYPE_STD) { if (input->type == INPUT_TYPE_STD) {
void (*release_fct)(int) = input->u.std.release_fct; void (*release_fct)(int) = input->u.std.release_fct;
if (release_fct != NULL) if (release_fct)
release_fct(input->u.std.release_data); release_fct(input->u.std.release_data);
} else if (input->type == INPUT_TYPE_KBD) { } else if (input->type == INPUT_TYPE_KBD) {
char *release_str = input->u.kbd.release_str; char *release_str = input->u.kbd.release_str;
...@@ -2025,7 +2025,7 @@ static void panel_scan_timer(void) ...@@ -2025,7 +2025,7 @@ static void panel_scan_timer(void)
static void init_scan_timer(void) static void init_scan_timer(void)
{ {
if (scan_timer.function != NULL) if (scan_timer.function)
return; /* already started */ return; /* already started */
setup_timer(&scan_timer, (void *)&panel_scan_timer, 0); setup_timer(&scan_timer, (void *)&panel_scan_timer, 0);
...@@ -2229,7 +2229,7 @@ static void panel_attach(struct parport *port) ...@@ -2229,7 +2229,7 @@ static void panel_attach(struct parport *port)
/* panel_cb.flags = 0 should be PARPORT_DEV_EXCL? */ /* panel_cb.flags = 0 should be PARPORT_DEV_EXCL? */
pprt = parport_register_dev_model(port, "panel", &panel_cb, 0); pprt = parport_register_dev_model(port, "panel", &panel_cb, 0);
if (pprt == NULL) { if (!pprt) {
pr_err("%s: port->number=%d parport=%d, parport_register_device() failed\n", pr_err("%s: port->number=%d parport=%d, parport_register_device() failed\n",
__func__, port->number, parport); __func__, port->number, parport);
return; return;
...@@ -2276,10 +2276,10 @@ static void panel_detach(struct parport *port) ...@@ -2276,10 +2276,10 @@ static void panel_detach(struct parport *port)
__func__, port->number, parport); __func__, port->number, parport);
return; return;
} }
if (scan_timer.function != NULL) if (scan_timer.function)
del_timer_sync(&scan_timer); del_timer_sync(&scan_timer);
if (pprt != NULL) { if (pprt) {
if (keypad.enabled) { if (keypad.enabled) {
misc_deregister(&keypad_dev); misc_deregister(&keypad_dev);
keypad_initialized = 0; keypad_initialized = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册