From: Phillip Potter <phil@philpotter.co.uk>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Larry Finger <Larry.Finger@lwfinger.net>,
Nick Desaulniers <ndesaulniers@google.com>,
linux-staging@lists.linux.dev,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
clang-built-linux@googlegroups.com
Subject: Re: [PATCH 1/3] staging: r8188eu: Remove unused static inline functions in rtw_recv.h
Date: Thu, 12 Aug 2021 22:08:22 +0100 [thread overview]
Message-ID: <CAA=Fs0meOs0uzN-3AS2a_Gwzs5eVvD6+xxPUkjhNFZ5L4WNx2g@mail.gmail.com> (raw)
In-Reply-To: <20210812204027.338872-2-nathan@kernel.org>
On Thu, 12 Aug 2021 at 21:40, Nathan Chancellor <nathan@kernel.org> wrote:
>
> After commit 987219ad34a6 ("staging: r8188eu: remove lines from Makefile
> that silence build warnings"), clang warns several times:
>
> In file included from
> drivers/staging/r8188eu/os_dep/../include/drv_types.h:22:
> drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:395:9: warning:
> variable 'buf_desc' is uninitialized when used here [-Wuninitialized]
> return buf_desc;
> ^~~~~~~~
> drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:391:25: note:
> initialize the variable 'buf_desc' to silence this warning
> unsigned char *buf_desc;
> ^
> = NULL
> drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:412:52: warning:
> variable 'buf_star' is uninitialized when used here [-Wuninitialized]
> precv_frame = rxmem_to_recvframe((unsigned char *)buf_star);
> ^~~~~~~~
> drivers/staging/r8188eu/os_dep/../include/rtw_recv.h:410:14: note:
> initialize the variable 'buf_star' to silence this warning
> u8 *buf_star;
> ^
> = NULL
> 2 warnings generated.
>
> The functions that these warnings come from are not used or are called
> from functions that are not used so just remove them to remove the
> warnings.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/staging/r8188eu/include/rtw_recv.h | 46 ----------------------
> 1 file changed, 46 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
> index 857269ae4209..81594e7aed51 100644
> --- a/drivers/staging/r8188eu/include/rtw_recv.h
> +++ b/drivers/staging/r8188eu/include/rtw_recv.h
> @@ -386,52 +386,6 @@ static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, int sz)
> return precvframe->rx_tail;
> }
>
> -static inline unsigned char *get_rxbuf_desc(struct recv_frame *precvframe)
> -{
> - unsigned char *buf_desc;
> -
> - if (precvframe == NULL)
> - return NULL;
> - return buf_desc;
> -}
> -
> -static inline struct recv_frame *rxmem_to_recvframe(u8 *rxmem)
> -{
> - /* due to the design of 2048 bytes alignment of recv_frame,
> - * we can reference the struct recv_frame */
> - /* from any given member of recv_frame. */
> - /* rxmem indicates the any member/address in recv_frame */
> -
> - return (struct recv_frame *)(((size_t)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
> -}
> -
> -static inline struct recv_frame *pkt_to_recvframe(struct sk_buff *pkt)
> -{
> - u8 *buf_star;
> - struct recv_frame *precv_frame;
> - precv_frame = rxmem_to_recvframe((unsigned char *)buf_star);
> -
> - return precv_frame;
> -}
> -
> -static inline u8 *pkt_to_recvmem(struct sk_buff *pkt)
> -{
> - /* return the rx_head */
> -
> - struct recv_frame *precv_frame = pkt_to_recvframe(pkt);
> -
> - return precv_frame->rx_head;
> -}
> -
> -static inline u8 *pkt_to_recvdata(struct sk_buff *pkt)
> -{
> - /* return the rx_data */
> -
> - struct recv_frame *precv_frame = pkt_to_recvframe(pkt);
> -
> - return precv_frame->rx_data;
> -}
> -
> static inline int get_recvframe_len(struct recv_frame *precvframe)
> {
> return precvframe->len;
> --
> 2.33.0.rc2
>
Dear Nathan,
Thanks for this.
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Regards,
Phil
next prev parent reply other threads:[~2021-08-12 21:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 20:40 [PATCH 0/3] staging: r8188eu: Fix -Wuninitialized instances from clang Nathan Chancellor
2021-08-12 20:40 ` [PATCH 1/3] staging: r8188eu: Remove unused static inline functions in rtw_recv.h Nathan Chancellor
2021-08-12 21:08 ` Phillip Potter [this message]
2021-08-12 20:40 ` [PATCH 2/3] staging: r8188eu: Remove uninitialized use of ether_type in portctrl() Nathan Chancellor
2021-08-12 21:09 ` Phillip Potter
2021-08-12 20:40 ` [PATCH 3/3] staging: r8188eu: Reorganize error handling in rtw_drv_init() Nathan Chancellor
2021-08-12 21:15 ` Phillip Potter
2021-08-12 23:11 ` Fabio M. De Francesco
2021-08-12 23:14 ` Nathan Chancellor
2021-08-13 1:51 ` Fabio M. De Francesco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAA=Fs0meOs0uzN-3AS2a_Gwzs5eVvD6+xxPUkjhNFZ5L4WNx2g@mail.gmail.com' \
--to=phil@philpotter.co.uk \
--cc=Larry.Finger@lwfinger.net \
--cc=clang-built-linux@googlegroups.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).