lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250301180240.GA61229@wp.pl>
Date: Sat, 1 Mar 2025 19:02:40 +0100
From: Stanislaw Gruszka <stf_xl@...pl>
To: Arnd Bergmann <arnd@...db.de>
Cc: Arnd Bergmann <arnd@...nel.org>,
	Johannes Berg <johannes@...solutions.net>,
	Kalle Valo <kvalo@...nel.org>, Ben Hutchings <ben@...adent.org.uk>,
	linux <linux@...blig.org>,
	"Gustavo A. R. Silva" <gustavoars@...nel.org>,
	linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [v2] iwlegacy: don't warn for unused variables with
 DEBUG_FS=n

On Sat, Mar 01, 2025 at 02:49:38PM +0100, Arnd Bergmann wrote:
> On Sat, Mar 1, 2025, at 14:36, Stanislaw Gruszka wrote:
> > On Sat, Mar 01, 2025 at 01:38:16PM +0100, Arnd Bergmann wrote:
> >> On Sat, Mar 1, 2025, at 13:28, Stanislaw Gruszka wrote:
> >> > On Tue, Feb 25, 2025 at 03:53:53PM +0100, Arnd Bergmann wrote:
> >> >
> >> > But then the code will be compiled for !CONFIG_MAC80211_DEBUGFS
> >> > case, it does compile for me:
> >> >
> >> > -  22475	   1160	      0	  23635	   
> >> > 5c53	drivers/net/wireless/intel/iwlegacy/4965-rs.o
> >> > +  23008	   1168	      0	  24176	   
> >> > 5e70	drivers/net/wireless/intel/iwlegacy/4965-rs.o
> >> 
> >> Very strange, this really shouldn't happen. Which symbols
> >> exactly do you see the compiler fail to drop with my patch,
> >
> > nm 4965-rs.o diffrence before and after patch:
> 
> >  00000000000000dd t il4965_rs_alloc_sta.cold
> > -0000000000001810 t il4965_rs_collect_tx_data.isra.0
> > -00000000000012b0 t il4965_rs_fill_link_cmd
> > -0000000000000495 t il4965_rs_fill_link_cmd.cold
> > +0000000000001850 t il4965_rs_collect_tx_data.isra.0
> > +0000000000000e90 t il4965_rs_dbgfs_set_mcs.isra.0
> > +00000000000002f6 t il4965_rs_dbgfs_set_mcs.isra.0.cold
> > +0000000000001340 t il4965_rs_fill_link_cmd
> > +0000000000000518 t il4965_rs_fill_link_cmd.cold
> >  00000000000002a0 t il4965_rs_free
> 
> Ah, so the debugfs files get eliminated, but
> il4965_rs_dbgfs_set_mcs() does not.
> 
> I think this should do it:
> 
> --- a/drivers/net/wireless/intel/iwlegacy/4965-rs.c
> +++ b/drivers/net/wireless/intel/iwlegacy/4965-rs.c
> @@ -2495,6 +2495,9 @@ il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx)
>         u8 valid_tx_ant;
>         u8 ant_sel_tx;
>  
> +       if (!IS_ENABLED(CONFIG_MAC80211_DEBUGFS))
> +               return;
> +
>         il = lq_sta->drv;
>         valid_tx_ant = il->hw_params.valid_tx_ant;
>         if (lq_sta->dbg_fixed_rate) {
> 
> or possibly il4965_rs_dbgfs_set_mcs() can stay in the #ifdef
> if you prefer.

I'm ok with this solution. The size stays the same with above
change.

Regards
Stanislaw


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ