staging: speakup: speakup_dectlk.c: style fixes
* Clean this file based on reports from checkpatch.pl. * Replace a function-like macro with an inline function. * Remove an incorrect use of the volatile qualifier. The previously-volatile variable is now always protected by a spinlock. Signed-off-by: Christopher Brannon <chris@the-brannons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
c3d5d98820
commit
4073f1b6ab
1 changed files with 22 additions and 15 deletions
|
@ -36,8 +36,12 @@
|
||||||
#define DRV_VERSION "2.20"
|
#define DRV_VERSION "2.20"
|
||||||
#define SYNTH_CLEAR 0x03
|
#define SYNTH_CLEAR 0x03
|
||||||
#define PROCSPEECH 0x0b
|
#define PROCSPEECH 0x0b
|
||||||
static volatile int xoff;
|
static int xoff;
|
||||||
#define synth_full() (xoff)
|
|
||||||
|
static inline int synth_full(void)
|
||||||
|
{
|
||||||
|
return xoff;
|
||||||
|
}
|
||||||
|
|
||||||
static void do_catch_up(struct spk_synth *synth);
|
static void do_catch_up(struct spk_synth *synth);
|
||||||
static void synth_flush(struct spk_synth *synth);
|
static void synth_flush(struct spk_synth *synth);
|
||||||
|
@ -160,7 +164,7 @@ static int is_indnum(u_char *ch)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u_char lastind = 0;
|
static u_char lastind;
|
||||||
|
|
||||||
static unsigned char get_index(void)
|
static unsigned char get_index(void)
|
||||||
{
|
{
|
||||||
|
@ -198,7 +202,8 @@ static void read_buff_add(u_char c)
|
||||||
|
|
||||||
static void do_catch_up(struct spk_synth *synth)
|
static void do_catch_up(struct spk_synth *synth)
|
||||||
{
|
{
|
||||||
static u_char ch = 0;
|
int synth_full_val = 0;
|
||||||
|
static u_char ch;
|
||||||
static u_char last = '\0';
|
static u_char last = '\0';
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned long jiff_max;
|
unsigned long jiff_max;
|
||||||
|
@ -243,10 +248,11 @@ static void do_catch_up(struct spk_synth *synth)
|
||||||
ch = synth_buffer_peek();
|
ch = synth_buffer_peek();
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
delay_time_val = delay_time->u.n.value;
|
delay_time_val = delay_time->u.n.value;
|
||||||
|
synth_full_val = synth_full();
|
||||||
spk_unlock(flags);
|
spk_unlock(flags);
|
||||||
if (ch == '\n')
|
if (ch == '\n')
|
||||||
ch = 0x0D;
|
ch = 0x0D;
|
||||||
if (synth_full() || !spk_serial_out(ch)) {
|
if (synth_full_val || !spk_serial_out(ch)) {
|
||||||
schedule_timeout(msecs_to_jiffies(delay_time_val));
|
schedule_timeout(msecs_to_jiffies(delay_time_val));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -268,7 +274,8 @@ static void do_catch_up(struct spk_synth *synth)
|
||||||
jiffy_delta_val = jiffy_delta->u.n.value;
|
jiffy_delta_val = jiffy_delta->u.n.value;
|
||||||
delay_time_val = delay_time->u.n.value;
|
delay_time_val = delay_time->u.n.value;
|
||||||
spk_unlock(flags);
|
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;
|
jiff_max = jiffies + jiffy_delta_val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue