diff mbox series

[5/6] serial: msm-geni: fix a compile time warning from msm_serial_setbrg()

Message ID 20230330194736.2400593-6-vladimir.zapolskiy@linaro.org
State Superseded
Headers show
Series serial: msm-geni: fix UART baudrate on modern platforms | expand

Commit Message

Vladimir Zapolskiy March 30, 2023, 7:47 p.m. UTC
A compiler warns about a missing function prototype, which is valid
and fixed by converting the function into static one, also fix
interleaved local variable declarations and assignments.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
 drivers/serial/serial_msm_geni.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Konrad Dybcio March 31, 2023, 1:29 a.m. UTC | #1
On 30.03.2023 21:47, Vladimir Zapolskiy wrote:
> A compiler warns about a missing function prototype, which is valid
> and fixed by converting the function into static one, also fix
> interleaved local variable declarations and assignments.
> 
> Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
> ---

Fixes: 324df15a292e ("serial: qcom: add support for GENI serial driver")
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  drivers/serial/serial_msm_geni.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c
> index c9813f06ace7..03fc704182d3 100644
> --- a/drivers/serial/serial_msm_geni.c
> +++ b/drivers/serial/serial_msm_geni.c
> @@ -238,13 +238,13 @@ static inline void geni_serial_baud(phys_addr_t base_address, u32 clk_div,
>  	writel(s_clk_cfg, base_address + GENI_SER_S_CLK_CFG);
>  }
>  
> -int msm_serial_setbrg(struct udevice *dev, int baud)
> +static int msm_serial_setbrg(struct udevice *dev, int baud)
>  {
>  	struct msm_serial_data *priv = dev_get_priv(dev);
> +	u64 clk_rate;
> +	u32 clk_div;
>  
>  	priv->baud = baud;
> -	u32 clk_div;
> -	u64 clk_rate;
>  
>  	clk_rate = get_clk_div_rate(baud, UART_OVERSAMPLING, &clk_div);
>  	geni_serial_set_clock_rate(dev, clk_rate);
diff mbox series

Patch

diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c
index c9813f06ace7..03fc704182d3 100644
--- a/drivers/serial/serial_msm_geni.c
+++ b/drivers/serial/serial_msm_geni.c
@@ -238,13 +238,13 @@  static inline void geni_serial_baud(phys_addr_t base_address, u32 clk_div,
 	writel(s_clk_cfg, base_address + GENI_SER_S_CLK_CFG);
 }
 
-int msm_serial_setbrg(struct udevice *dev, int baud)
+static int msm_serial_setbrg(struct udevice *dev, int baud)
 {
 	struct msm_serial_data *priv = dev_get_priv(dev);
+	u64 clk_rate;
+	u32 clk_div;
 
 	priv->baud = baud;
-	u32 clk_div;
-	u64 clk_rate;
 
 	clk_rate = get_clk_div_rate(baud, UART_OVERSAMPLING, &clk_div);
 	geni_serial_set_clock_rate(dev, clk_rate);