From nobody Fri Apr 17 21:03:48 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D64BC43334 for ; Thu, 21 Jul 2022 21:24:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233872AbiGUVYi (ORCPT ); Thu, 21 Jul 2022 17:24:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbiGUVYh (ORCPT ); Thu, 21 Jul 2022 17:24:37 -0400 Received: from luna (cpc152649-stkp13-2-0-cust121.10-2.cable.virginm.net [86.15.83.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE95B92856 for ; Thu, 21 Jul 2022 14:24:35 -0700 (PDT) Received: from ben by luna with local (Exim 4.96) (envelope-from ) id 1oEdep-001ttl-2D; Thu, 21 Jul 2022 22:24:31 +0100 From: Ben Dooks To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, Ben Dooks Subject: [PATCH] serial: stm32: make info structs static to avoid sparse warnings Date: Thu, 21 Jul 2022 22:24:30 +0100 Message-Id: <20220721212430.453192-1-ben-linux@fluff.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The info structs are local only to the stm32-usart.c driver and are triggering sparse warnings about being undecalred. Move these into the main driver code and make them static to avoid the following warnings: drivers/tty/serial/stm32-usart.h:42:25: warning: symbol 'stm32f4_info' was = not declared. Should it be static? drivers/tty/serial/stm32-usart.h:63:25: warning: symbol 'stm32f7_info' was = not declared. Should it be static? drivers/tty/serial/stm32-usart.h:85:25: warning: symbol 'stm32h7_info' was = not declared. Should it be static? Signed-off-by: Ben Dooks --- drivers/tty/serial/stm32-usart.c | 69 ++++++++++++++++++++++++++++++++ drivers/tty/serial/stm32-usart.h | 68 ------------------------------- 2 files changed, 69 insertions(+), 68 deletions(-) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-us= art.c index 0973b03eeeaa..01f1ab2c18c0 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -35,6 +35,75 @@ #include "serial_mctrl_gpio.h" #include "stm32-usart.h" =20 + +/* Register offsets */ +static struct stm32_usart_info stm32f4_info =3D { + .ofs =3D { + .isr =3D 0x00, + .rdr =3D 0x04, + .tdr =3D 0x04, + .brr =3D 0x08, + .cr1 =3D 0x0c, + .cr2 =3D 0x10, + .cr3 =3D 0x14, + .gtpr =3D 0x18, + .rtor =3D UNDEF_REG, + .rqr =3D UNDEF_REG, + .icr =3D UNDEF_REG, + }, + .cfg =3D { + .uart_enable_bit =3D 13, + .has_7bits_data =3D false, + .fifosize =3D 1, + } +}; + +static struct stm32_usart_info stm32f7_info =3D { + .ofs =3D { + .cr1 =3D 0x00, + .cr2 =3D 0x04, + .cr3 =3D 0x08, + .brr =3D 0x0c, + .gtpr =3D 0x10, + .rtor =3D 0x14, + .rqr =3D 0x18, + .isr =3D 0x1c, + .icr =3D 0x20, + .rdr =3D 0x24, + .tdr =3D 0x28, + }, + .cfg =3D { + .uart_enable_bit =3D 0, + .has_7bits_data =3D true, + .has_swap =3D true, + .fifosize =3D 1, + } +}; + +static struct stm32_usart_info stm32h7_info =3D { + .ofs =3D { + .cr1 =3D 0x00, + .cr2 =3D 0x04, + .cr3 =3D 0x08, + .brr =3D 0x0c, + .gtpr =3D 0x10, + .rtor =3D 0x14, + .rqr =3D 0x18, + .isr =3D 0x1c, + .icr =3D 0x20, + .rdr =3D 0x24, + .tdr =3D 0x28, + }, + .cfg =3D { + .uart_enable_bit =3D 0, + .has_7bits_data =3D true, + .has_swap =3D true, + .has_wakeup =3D true, + .has_fifo =3D true, + .fifosize =3D 16, + } +}; + static void stm32_usart_stop_tx(struct uart_port *port); static void stm32_usart_transmit_chars(struct uart_port *port); static void __maybe_unused stm32_usart_console_putchar(struct uart_port *p= ort, unsigned char ch); diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-us= art.h index ee69c203b926..0ec41a732c88 100644 --- a/drivers/tty/serial/stm32-usart.h +++ b/drivers/tty/serial/stm32-usart.h @@ -38,74 +38,6 @@ struct stm32_usart_info { =20 #define UNDEF_REG 0xff =20 -/* Register offsets */ -struct stm32_usart_info stm32f4_info =3D { - .ofs =3D { - .isr =3D 0x00, - .rdr =3D 0x04, - .tdr =3D 0x04, - .brr =3D 0x08, - .cr1 =3D 0x0c, - .cr2 =3D 0x10, - .cr3 =3D 0x14, - .gtpr =3D 0x18, - .rtor =3D UNDEF_REG, - .rqr =3D UNDEF_REG, - .icr =3D UNDEF_REG, - }, - .cfg =3D { - .uart_enable_bit =3D 13, - .has_7bits_data =3D false, - .fifosize =3D 1, - } -}; - -struct stm32_usart_info stm32f7_info =3D { - .ofs =3D { - .cr1 =3D 0x00, - .cr2 =3D 0x04, - .cr3 =3D 0x08, - .brr =3D 0x0c, - .gtpr =3D 0x10, - .rtor =3D 0x14, - .rqr =3D 0x18, - .isr =3D 0x1c, - .icr =3D 0x20, - .rdr =3D 0x24, - .tdr =3D 0x28, - }, - .cfg =3D { - .uart_enable_bit =3D 0, - .has_7bits_data =3D true, - .has_swap =3D true, - .fifosize =3D 1, - } -}; - -struct stm32_usart_info stm32h7_info =3D { - .ofs =3D { - .cr1 =3D 0x00, - .cr2 =3D 0x04, - .cr3 =3D 0x08, - .brr =3D 0x0c, - .gtpr =3D 0x10, - .rtor =3D 0x14, - .rqr =3D 0x18, - .isr =3D 0x1c, - .icr =3D 0x20, - .rdr =3D 0x24, - .tdr =3D 0x28, - }, - .cfg =3D { - .uart_enable_bit =3D 0, - .has_7bits_data =3D true, - .has_swap =3D true, - .has_wakeup =3D true, - .has_fifo =3D true, - .fifosize =3D 16, - } -}; - /* USART_SR (F4) / USART_ISR (F7) */ #define USART_SR_PE BIT(0) #define USART_SR_FE BIT(1) --=20 2.35.1