public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Kalle Valo <kvalo@kernel.org>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH 1/2] wifi: rtl8xxxu: remove some unused includes
Date: Mon, 29 Apr 2024 02:54:55 +0000	[thread overview]
Message-ID: <2a9fdafb5b5843c58cb080f8933b1e0a@realtek.com> (raw)
In-Reply-To: 20240426141939.3881678-1-kvalo@kernel.org

Ping-Ke Shih wrote:
> Kalle Valo <kvalo@kernel.org> wrote:
> > I noticed by random that rtl8xxxu includes linux/wireless.h even though it
> > doesn't need it. While investigating a bit more I found even more unused
> > include files:
> >
> > #include <linux/init.h>
> > #include <linux/sched.h>
> > #include <linux/ethtool.h>
> >
> > It looks like that the includes are just copied to every file without checking
> > if the file really needs the include. So more includes could be removed but
> > that would need more careful analysis per each file.
> 
> I can do that. My ways will be to create an empty (new) C file to examine
> every driver's header file can be included individually, and then try-and-error
> to remove includes from existing C files.

I made a patch [1] followed above ways based on these two patches.

> 
> However, this driver uses #ifdef. I will check if autoconf.h is included.

Make script of kernel will automatically include include/linux/kconfig.h, so
I didn't need extra works for #ifdef.

[1] https://lore.kernel.org/linux-wireless/20240429024711.30992-1-pkshih@realtek.com/T/#u


  parent reply	other threads:[~2024-04-29  2:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 14:19 [PATCH 1/2] wifi: rtl8xxxu: remove some unused includes Kalle Valo
2024-04-26 14:19 ` [PATCH 2/2] wifi: rtl8xxxu: remove rtl8xxxu_ prefix from filenames Kalle Valo
2024-04-29  2:08   ` Ping-Ke Shih
2024-04-29  2:08 ` [PATCH 1/2] wifi: rtl8xxxu: remove some unused includes Ping-Ke Shih
2024-04-29  2:54 ` Ping-Ke Shih [this message]
2024-04-29 12:23   ` Kalle Valo
2024-05-02  3:07 ` Ping-Ke Shih

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=2a9fdafb5b5843c58cb080f8933b1e0a@realtek.com \
    --to=pkshih@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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