static void lcd_print(char c)
{
if (lcd.addr.x < lcd.bwidth) {
- if (lcd_char_conv != NULL)
+ if (lcd_char_conv)
c = lcd_char_conv[(unsigned char)c];
lcd_write_data(c);
lcd.addr.x++;
break;
case '*':
/* flash back light using the keypad timer */
- if (scan_timer.function != NULL) {
+ if (scan_timer.function) {
if (lcd.light_tempo == 0
&& ((lcd.flags & LCD_FLAG_L) == 0))
lcd_backlight(1);
char value;
int addr;
- if (strchr(esc, ';') == NULL)
+ if (!strchr(esc, ';'))
break;
esc++;
}
case 'x': /* gotoxy : LxXXX[yYYY]; */
case 'y': /* gotoxy : LyYYY[xXXX]; */
- if (strchr(esc, ';') == NULL)
+ if (!strchr(esc, ';'))
break;
while (*esc) {
if ((input->type == INPUT_TYPE_STD) &&
(input->high_timer == 0)) {
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);
} else if (input->type == INPUT_TYPE_KBD) {
/* will turn on the light */
if (input->type == INPUT_TYPE_STD) {
void (*release_fct)(int) = input->u.std.release_fct;
- if (release_fct != NULL)
+ if (release_fct)
release_fct(input->u.std.release_data);
} else if (input->type == INPUT_TYPE_KBD) {
char *release_str = input->u.kbd.release_str;
static void init_scan_timer(void)
{
- if (scan_timer.function != NULL)
+ if (scan_timer.function)
return; /* already started */
setup_timer(&scan_timer, (void *)&panel_scan_timer, 0);
/* panel_cb.flags = 0 should be PARPORT_DEV_EXCL? */
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",
__func__, port->number, parport);
return;
__func__, port->number, parport);
return;
}
- if (scan_timer.function != NULL)
+ if (scan_timer.function)
del_timer_sync(&scan_timer);
- if (pprt != NULL) {
+ if (pprt) {
if (keypad.enabled) {
misc_deregister(&keypad_dev);
keypad_initialized = 0;