}
cp += sprintf(cp, "0, %d\n", KEY_MAP_VER);
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
- return (int)(cp-buf);
+ return (int)(cp - buf);
}
/*
cp = spk_s2uchar(cp, cp1);
cp1++;
}
- i = (int)cp1[-2]+1;
- i *= (int)cp1[-1]+1;
+ i = (int)cp1[-2] + 1;
+ i *= (int)cp1[-1] + 1;
i += 2; /* 0 and last map ver */
if (cp1[-3] != KEY_MAP_VER || cp1[-1] > 10 ||
i+SHIFT_TBL_SIZE+4 >= sizeof(spk_key_buf)) {
} else {
shut = 0;
}
- if (ch&4)
+ if (ch & 4)
shut |= 0x40;
- if (ch&1)
+ if (ch & 1)
spk_shut_up |= shut;
else
spk_shut_up &= ~shut;
int len;
int bytes;
const char *ptr = buf;
+ unsigned long flags;
if (!synth)
return -EPERM;
len = strlen(buf);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
while (len > 0) {
bytes = min_t(size_t, len, 250);
strncpy(tmp, ptr, bytes);
ptr += bytes;
len -= bytes;
}
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return count;
}
* created for the attributes with the directory being the name of the
* attribute group.
*/
-static struct attribute_group main_attr_group = {
+static const struct attribute_group main_attr_group = {
.attrs = main_attrs,
};
-static struct attribute_group i18n_attr_group = {
+static const struct attribute_group i18n_attr_group = {
.attrs = i18n_attrs,
.name = "i18n",
};