Commit 3d4f7eaf authored by Christopher Brannon's avatar Christopher Brannon Committed by Greg Kroah-Hartman
Browse files

staging: speakup: speakup_decext.c: style fixes



* Clean this file based on reports from checkpatch.pl.
* Replace function-like macros with inline macros.
* Eliminate a use of the ternary operator, for readability.

Signed-off-by: default avatarChristopher Brannon <chris@the-brannons.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 64d1e5a0
Loading
Loading
Loading
Loading
+24 −13
Original line number Diff line number Diff line
@@ -35,9 +35,19 @@
#define SYNTH_CLEAR 0x03
#define PROCSPEECH 0x0b
static unsigned char last_char;
#define get_last_char() ((inb_p(speakup_info.port_tts + UART_LSR) & UART_LSR_DR)? \
		(last_char = inb_p(speakup_info.port_tts + UART_RX)) : last_char)
#define synth_full() (get_last_char() == 0x13)

static inline u_char get_last_char(void)
{
	u_char avail = inb_p(speakup_info.port_tts + UART_LSR) & UART_LSR_DR;
	if (avail)
		last_char = inb_p(speakup_info.port_tts + UART_RX);
	return last_char;
}

static inline bool synth_full(void)
{
	return get_last_char() == 0x13;
}

static void do_catch_up(struct spk_synth *synth);
static void synth_flush(struct spk_synth *synth);
@@ -200,7 +210,8 @@ static void do_catch_up(struct spk_synth *synth)
				jiffy_delta_val = jiffy_delta->u.n.value;
				delay_time_val = delay_time->u.n.value;
				spk_unlock(flags);
				schedule_timeout(msecs_to_jiffies(delay_time_val));
				schedule_timeout(msecs_to_jiffies
						 (delay_time_val));
				jiff_max = jiffies + jiffy_delta_val;
			}
		}