hw: arm: Remove use of tabs in some source files
Some of the source files for older devices use hardcoded tabs instead of our current coding standard's required spaces. Fix these in the following files: - hw/arm/boot.c - hw/char/omap_uart.c - hw/gpio/zaurus.c - hw/input/tsc2005.c This commit is mostly whitespace-only changes; it also adds curly-braces to some 'if' statements. This addresses part of https://gitlab.com/qemu-project/qemu/-/issues/373 but some other files remain to be handled. Signed-off-by: Tanmay Patil <tanmaynpatil105@gmail.com> Message-id: 20240508081502.88375-1-tanmaynpatil105@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: tweaked commit message] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
84ce4b9b99
commit
d0a040a8c9
@ -61,7 +61,7 @@ struct omap_uart_s *omap_uart_init(hwaddr base,
|
|||||||
s->fclk = fclk;
|
s->fclk = fclk;
|
||||||
s->irq = irq;
|
s->irq = irq;
|
||||||
s->serial = serial_mm_init(get_system_memory(), base, 2, irq,
|
s->serial = serial_mm_init(get_system_memory(), base, 2, irq,
|
||||||
omap_clk_getrate(fclk)/16,
|
omap_clk_getrate(fclk) / 16,
|
||||||
chr ?: qemu_chr_new(label, "null", NULL),
|
chr ?: qemu_chr_new(label, "null", NULL),
|
||||||
DEVICE_NATIVE_ENDIAN);
|
DEVICE_NATIVE_ENDIAN);
|
||||||
return s;
|
return s;
|
||||||
@ -137,8 +137,9 @@ static void omap_uart_write(void *opaque, hwaddr addr,
|
|||||||
break;
|
break;
|
||||||
case 0x54: /* SYSC (OMAP2) */
|
case 0x54: /* SYSC (OMAP2) */
|
||||||
s->syscontrol = value & 0x1d;
|
s->syscontrol = value & 0x1d;
|
||||||
if (value & 2)
|
if (value & 2) {
|
||||||
omap_uart_reset(s);
|
omap_uart_reset(s);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 0x5c: /* WER (OMAP2) */
|
case 0x5c: /* WER (OMAP2) */
|
||||||
s->wkup = value & 0x7f;
|
s->wkup = value & 0x7f;
|
||||||
|
@ -61,7 +61,8 @@ struct ScoopInfo {
|
|||||||
#define SCOOP_GPWR 0x24
|
#define SCOOP_GPWR 0x24
|
||||||
#define SCOOP_GPRR 0x28
|
#define SCOOP_GPRR 0x28
|
||||||
|
|
||||||
static inline void scoop_gpio_handler_update(ScoopInfo *s) {
|
static inline void scoop_gpio_handler_update(ScoopInfo *s)
|
||||||
|
{
|
||||||
uint32_t level, diff;
|
uint32_t level, diff;
|
||||||
int bit;
|
int bit;
|
||||||
level = s->gpio_level & s->gpio_dir;
|
level = s->gpio_level & s->gpio_dir;
|
||||||
@ -125,8 +126,9 @@ static void scoop_write(void *opaque, hwaddr addr,
|
|||||||
break;
|
break;
|
||||||
case SCOOP_CPR:
|
case SCOOP_CPR:
|
||||||
s->power = value;
|
s->power = value;
|
||||||
if (value & 0x80)
|
if (value & 0x80) {
|
||||||
s->power |= 0x8040;
|
s->power |= 0x8040;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SCOOP_CCR:
|
case SCOOP_CCR:
|
||||||
s->ccr = value;
|
s->ccr = value;
|
||||||
@ -166,10 +168,11 @@ static void scoop_gpio_set(void *opaque, int line, int level)
|
|||||||
{
|
{
|
||||||
ScoopInfo *s = (ScoopInfo *) opaque;
|
ScoopInfo *s = (ScoopInfo *) opaque;
|
||||||
|
|
||||||
if (level)
|
if (level) {
|
||||||
s->gpio_level |= (1 << line);
|
s->gpio_level |= (1 << line);
|
||||||
else
|
} else {
|
||||||
s->gpio_level &= ~(1 << line);
|
s->gpio_level &= ~(1 << line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scoop_init(Object *obj)
|
static void scoop_init(Object *obj)
|
||||||
@ -203,7 +206,7 @@ static int scoop_post_load(void *opaque, int version_id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_version_0 (void *opaque, int version_id)
|
static bool is_version_0(void *opaque, int version_id)
|
||||||
{
|
{
|
||||||
return version_id == 0;
|
return version_id == 0;
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ static uint16_t tsc2005_read(TSC2005State *s, int reg)
|
|||||||
(s->noise & 3);
|
(s->noise & 3);
|
||||||
case 0x1: /* Y */
|
case 0x1: /* Y */
|
||||||
s->dav &= ~mode_regs[TSC_MODE_Y];
|
s->dav &= ~mode_regs[TSC_MODE_Y];
|
||||||
s->noise ++;
|
s->noise++;
|
||||||
return TSC_CUT_RESOLUTION(Y_TRANSFORM(s), s->precision) ^
|
return TSC_CUT_RESOLUTION(Y_TRANSFORM(s), s->precision) ^
|
||||||
(s->noise & 3);
|
(s->noise & 3);
|
||||||
case 0x2: /* Z1 */
|
case 0x2: /* Z1 */
|
||||||
@ -205,8 +205,9 @@ static void tsc2005_write(TSC2005State *s, int reg, uint16_t data)
|
|||||||
if (s->enabled != !(data & 0x4000)) {
|
if (s->enabled != !(data & 0x4000)) {
|
||||||
s->enabled = !(data & 0x4000);
|
s->enabled = !(data & 0x4000);
|
||||||
trace_tsc2005_sense(s->enabled ? "enabled" : "disabled");
|
trace_tsc2005_sense(s->enabled ? "enabled" : "disabled");
|
||||||
if (s->busy && !s->enabled)
|
if (s->busy && !s->enabled) {
|
||||||
timer_del(s->timer);
|
timer_del(s->timer);
|
||||||
|
}
|
||||||
s->busy = s->busy && s->enabled;
|
s->busy = s->busy && s->enabled;
|
||||||
}
|
}
|
||||||
s->nextprecision = (data >> 13) & 1;
|
s->nextprecision = (data >> 13) & 1;
|
||||||
@ -258,10 +259,12 @@ static void tsc2005_pin_update(TSC2005State *s)
|
|||||||
switch (s->nextfunction) {
|
switch (s->nextfunction) {
|
||||||
case TSC_MODE_XYZ_SCAN:
|
case TSC_MODE_XYZ_SCAN:
|
||||||
case TSC_MODE_XY_SCAN:
|
case TSC_MODE_XY_SCAN:
|
||||||
if (!s->host_mode && s->dav)
|
if (!s->host_mode && s->dav) {
|
||||||
s->enabled = false;
|
s->enabled = false;
|
||||||
if (!s->pressure)
|
}
|
||||||
|
if (!s->pressure) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
case TSC_MODE_AUX_SCAN:
|
case TSC_MODE_AUX_SCAN:
|
||||||
break;
|
break;
|
||||||
@ -269,8 +272,9 @@ static void tsc2005_pin_update(TSC2005State *s)
|
|||||||
case TSC_MODE_X:
|
case TSC_MODE_X:
|
||||||
case TSC_MODE_Y:
|
case TSC_MODE_Y:
|
||||||
case TSC_MODE_Z:
|
case TSC_MODE_Z:
|
||||||
if (!s->pressure)
|
if (!s->pressure) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
case TSC_MODE_AUX:
|
case TSC_MODE_AUX:
|
||||||
case TSC_MODE_TEMP1:
|
case TSC_MODE_TEMP1:
|
||||||
@ -278,8 +282,9 @@ static void tsc2005_pin_update(TSC2005State *s)
|
|||||||
case TSC_MODE_X_TEST:
|
case TSC_MODE_X_TEST:
|
||||||
case TSC_MODE_Y_TEST:
|
case TSC_MODE_Y_TEST:
|
||||||
case TSC_MODE_TS_TEST:
|
case TSC_MODE_TS_TEST:
|
||||||
if (s->dav)
|
if (s->dav) {
|
||||||
s->enabled = false;
|
s->enabled = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TSC_MODE_RESERVED:
|
case TSC_MODE_RESERVED:
|
||||||
@ -290,8 +295,9 @@ static void tsc2005_pin_update(TSC2005State *s)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!s->enabled || s->busy)
|
if (!s->enabled || s->busy) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
s->busy = true;
|
s->busy = true;
|
||||||
s->precision = s->nextprecision;
|
s->precision = s->nextprecision;
|
||||||
@ -331,7 +337,7 @@ static uint8_t tsc2005_txrx_word(void *opaque, uint8_t value)
|
|||||||
TSC2005State *s = opaque;
|
TSC2005State *s = opaque;
|
||||||
uint32_t ret = 0;
|
uint32_t ret = 0;
|
||||||
|
|
||||||
switch (s->state ++) {
|
switch (s->state++) {
|
||||||
case 0:
|
case 0:
|
||||||
if (value & 0x80) {
|
if (value & 0x80) {
|
||||||
/* Command */
|
/* Command */
|
||||||
@ -343,8 +349,9 @@ static uint8_t tsc2005_txrx_word(void *opaque, uint8_t value)
|
|||||||
if (s->enabled != !(value & 1)) {
|
if (s->enabled != !(value & 1)) {
|
||||||
s->enabled = !(value & 1);
|
s->enabled = !(value & 1);
|
||||||
trace_tsc2005_sense(s->enabled ? "enabled" : "disabled");
|
trace_tsc2005_sense(s->enabled ? "enabled" : "disabled");
|
||||||
if (s->busy && !s->enabled)
|
if (s->busy && !s->enabled) {
|
||||||
timer_del(s->timer);
|
timer_del(s->timer);
|
||||||
|
}
|
||||||
s->busy = s->busy && s->enabled;
|
s->busy = s->busy && s->enabled;
|
||||||
}
|
}
|
||||||
tsc2005_pin_update(s);
|
tsc2005_pin_update(s);
|
||||||
@ -368,10 +375,11 @@ static uint8_t tsc2005_txrx_word(void *opaque, uint8_t value)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if (s->command)
|
if (s->command) {
|
||||||
ret = (s->data >> 8) & 0xff;
|
ret = (s->data >> 8) & 0xff;
|
||||||
else
|
} else {
|
||||||
s->data |= value << 8;
|
s->data |= value << 8;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
@ -412,8 +420,9 @@ static void tsc2005_timer_tick(void *opaque)
|
|||||||
|
|
||||||
/* Timer ticked -- a set of conversions has been finished. */
|
/* Timer ticked -- a set of conversions has been finished. */
|
||||||
|
|
||||||
if (!s->busy)
|
if (!s->busy) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
s->busy = false;
|
s->busy = false;
|
||||||
s->dav |= mode_regs[function];
|
s->dav |= mode_regs[function];
|
||||||
@ -438,8 +447,9 @@ static void tsc2005_touchscreen_event(void *opaque,
|
|||||||
* signaling TS events immediately, but for now we simulate
|
* signaling TS events immediately, but for now we simulate
|
||||||
* the first conversion delay for sake of correctness.
|
* the first conversion delay for sake of correctness.
|
||||||
*/
|
*/
|
||||||
if (p != s->pressure)
|
if (p != s->pressure) {
|
||||||
tsc2005_pin_update(s);
|
tsc2005_pin_update(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tsc2005_post_load(void *opaque, int version_id)
|
static int tsc2005_post_load(void *opaque, int version_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user