mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-11-19 10:21:38 +00:00
lib: utils/serial: Remove unused baudrate/frequency globals
The sifive-uart and cadence-uart drivers store the input clock frequency and baudrate into file-static globals during init, but never read them back; the divisor is computed directly from the function arguments. Clang 23 adds -Wunused-but-set-global, which is enabled by -Wall, so the build fails with -Werror: sifive-uart.c:34:12: error: variable 'uart_in_freq' set but not used [-Werror,-Wunused-but-set-global] sifive-uart.c:35:12: error: variable 'uart_baudrate' set but not used [-Werror,-Wunused-but-set-global] Drop the dead variables. Signed-off-by: Khem Raj <raj.khem@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20261015203610.835320-1-khem.raj@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
1 parent
a7307c3acc
commit
95ca87fd6b
2 files changed
-8
No files matched your search
@@ -39,8 +39,6 @@
|
||||
/* clang-format on */
|
||||
|
||||
static volatile void *uart_base;
|
||||
static u32 uart_in_freq;
|
||||
static u32 uart_baudrate;
|
||||
|
||||
/*
|
||||
* Find minimum divisor divides in_freq to max_target_hz;
|
||||
@@ -95,8 +93,6 @@ static struct sbi_console_device cadence_console = {
|
||||
int cadence_uart_init(unsigned long base, u32 in_freq, u32 baudrate)
|
||||
{
|
||||
uart_base = (volatile void *)base;
|
||||
uart_in_freq = in_freq;
|
||||
uart_baudrate = baudrate;
|
||||
|
||||
/* Disable interrupts */
|
||||
set_reg(UART_REG_IDR, 0xFFFFFFFF);
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
/* clang-format on */
|
||||
|
||||
static volatile char *uart_base;
|
||||
static u32 uart_in_freq;
|
||||
static u32 uart_baudrate;
|
||||
|
||||
/**
|
||||
* Find minimum divisor divides in_freq to max_target_hz;
|
||||
@@ -94,8 +92,6 @@ static struct sbi_console_device sifive_console = {
|
||||
int sifive_uart_init(unsigned long base, u32 in_freq, u32 baudrate)
|
||||
{
|
||||
uart_base = (volatile char *)base;
|
||||
uart_in_freq = in_freq;
|
||||
uart_baudrate = baudrate;
|
||||
|
||||
/* Configure baudrate */
|
||||
if (in_freq && baudrate)
|
||||
|
||||
Reference in new issue
Block a user