* [PATCH rtw-next] wifi: rtw89: Replace hardcoded strings with helper functions
@ 2025-09-21 15:44 Yu-Chun Lin
2025-09-22 5:50 ` Ping-Ke Shih
0 siblings, 1 reply; 7+ messages in thread
From: Yu-Chun Lin @ 2025-09-21 15:44 UTC (permalink / raw)
To: pkshih
Cc: linux-wireless, linux-kernel, cy.huang, stanley_chang, jserv,
visitorckw, Yu-Chun Lin
Replace hardcoded strings with 'str_on_off()', 'str_enable_disable()',
and 'str_read_write()'.
The change improves readability and enables potential string deduplication
by the linker, which may slightly reduce binary size.
Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
---
drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c | 10 ++++++----
drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c | 10 ++++++----
drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c | 8 +++++---
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c | 11 ++++++-----
drivers/net/wireless/realtek/rtw89/usb.c | 3 ++-
drivers/net/wireless/realtek/rtw89/wow.c | 5 ++++-
6 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c b/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
index 84c46d2f4d85..000753061e38 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
@@ -2,6 +2,8 @@
/* Copyright(c) 2022-2023 Realtek Corporation
*/
+#include <linux/string_choices.h>
+
#include "coex.h"
#include "debug.h"
#include "mac.h"
@@ -1626,7 +1628,7 @@ static void _iqk_get_ch_info(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy,
iqk_info->iqk_table_idx[path] = idx;
rtw89_debug(rtwdev, RTW89_DBG_RFK, "[IQK]S%d (PHY%d): / DBCC %s/ %s/ CH%d/ %s\n",
- path, phy, rtwdev->dbcc_en ? "on" : "off",
+ path, phy, str_on_off(rtwdev->dbcc_en),
iqk_info->iqk_band[path] == 0 ? "2G" :
iqk_info->iqk_band[path] == 1 ? "5G" : "6G",
iqk_info->iqk_ch[path],
@@ -1901,8 +1903,8 @@ static void _dpk_information(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy,
rtw89_debug(rtwdev, RTW89_DBG_RFK,
"[DPK] S%d[%d] (PHY%d): TSSI %s/ DBCC %s/ %s/ CH%d/ %s\n",
path, dpk->cur_idx[path], phy,
- rtwdev->is_tssi_mode[path] ? "on" : "off",
- rtwdev->dbcc_en ? "on" : "off",
+ str_on_off(rtwdev->is_tssi_mode[path]),
+ str_on_off(rtwdev->dbcc_en),
dpk->bp[path][kidx].band == 0 ? "2G" :
dpk->bp[path][kidx].band == 1 ? "5G" : "6G",
dpk->bp[path][kidx].ch,
@@ -2016,7 +2018,7 @@ static void _dpk_txpwr_bb_force(struct rtw89_dev *rtwdev,
rtw89_phy_write32_mask(rtwdev, R_TXPWRB_H + (path << 13), B_TXPWRB_RDY, force);
rtw89_debug(rtwdev, RTW89_DBG_RFK, "[DPK] S%d txpwr_bb_force %s\n",
- path, force ? "on" : "off");
+ path, str_on_off(force));
}
static void _dpk_kip_pwr_clk_onoff(struct rtw89_dev *rtwdev, bool turn_on)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c b/drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c
index 9db8713ac99b..9ffde0894d8a 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c
@@ -2,6 +2,8 @@
/* Copyright(c) 2019-2020 Realtek Corporation
*/
+#include <linux/string_choices.h>
+
#include "coex.h"
#include "debug.h"
#include "mac.h"
@@ -1403,7 +1405,7 @@ static void _iqk_get_ch_info(struct rtw89_dev *rtwdev,
path, iqk_info->iqk_ch[path]);
rtw89_debug(rtwdev, RTW89_DBG_RFK,
"[IQK]S%d (PHY%d): / DBCC %s/ %s/ CH%d/ %s\n", path, phy,
- rtwdev->dbcc_en ? "on" : "off",
+ str_on_off(rtwdev->dbcc_en),
iqk_info->iqk_band[path] == 0 ? "2G" :
iqk_info->iqk_band[path] == 1 ? "5G" : "6G",
iqk_info->iqk_ch[path],
@@ -1881,8 +1883,8 @@ static void _dpk_information(struct rtw89_dev *rtwdev,
rtw89_debug(rtwdev, RTW89_DBG_RFK,
"[DPK] S%d[%d] (PHY%d): TSSI %s/ DBCC %s/ %s/ CH%d/ %s\n",
path, dpk->cur_idx[path], phy,
- rtwdev->is_tssi_mode[path] ? "on" : "off",
- rtwdev->dbcc_en ? "on" : "off",
+ str_on_off(rtwdev->is_tssi_mode[path]),
+ str_on_off(rtwdev->dbcc_en),
dpk->bp[path][kidx].band == 0 ? "2G" :
dpk->bp[path][kidx].band == 1 ? "5G" : "6G",
dpk->bp[path][kidx].ch,
@@ -2736,7 +2738,7 @@ static void _dpk_onoff(struct rtw89_dev *rtwdev,
MASKBYTE3, 0x6 | val);
rtw89_debug(rtwdev, RTW89_DBG_RFK, "[DPK] S%d[%d] DPK %s !!!\n", path,
- kidx, dpk->is_dpk_enable && !off ? "enable" : "disable");
+ kidx, str_enable_disable(dpk->is_dpk_enable && !off));
}
static void _dpk_track(struct rtw89_dev *rtwdev)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c b/drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c
index 4796588c0256..c156c64f4d5e 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c
@@ -2,6 +2,8 @@
/* Copyright(c) 2019-2022 Realtek Corporation
*/
+#include <linux/string_choices.h>
+
#include "chan.h"
#include "coex.h"
#include "debug.h"
@@ -1696,7 +1698,7 @@ static void _dpk_onoff(struct rtw89_dev *rtwdev, enum rtw89_rf_path path, bool o
MASKBYTE3, _dpk_order_convert(rtwdev) << 1 | val);
rtw89_debug(rtwdev, RTW89_DBG_RFK, "[DPK] S%d[%d] DPK %s !!!\n", path,
- kidx, dpk->is_dpk_enable && !off ? "enable" : "disable");
+ kidx, str_enable_disable(dpk->is_dpk_enable && !off));
}
static void _dpk_one_shot(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy,
@@ -1763,8 +1765,8 @@ static void _dpk_information(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy,
rtw89_debug(rtwdev, RTW89_DBG_RFK,
"[DPK] S%d[%d] (PHY%d): TSSI %s/ DBCC %s/ %s/ CH%d/ %s\n",
path, dpk->cur_idx[path], phy,
- rtwdev->is_tssi_mode[path] ? "on" : "off",
- rtwdev->dbcc_en ? "on" : "off",
+ str_on_off(rtwdev->is_tssi_mode[path]),
+ str_on_off(rtwdev->dbcc_en),
dpk->bp[path][kidx].band == 0 ? "2G" :
dpk->bp[path][kidx].band == 1 ? "5G" : "6G",
dpk->bp[path][kidx].ch,
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c b/drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c
index b92e2ce4f4ad..3d3de3641edd 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* Copyright(c) 2019-2022 Realtek Corporation
*/
+#include <linux/string_choices.h>
#include "chan.h"
#include "coex.h"
@@ -1344,7 +1345,7 @@ static void _iqk_get_ch_info(struct rtw89_dev *rtwdev,
path, iqk_info->iqk_ch[path]);
rtw89_debug(rtwdev, RTW89_DBG_RFK,
"[IQK]S%d (PHY%d): / DBCC %s/ %s/ CH%d/ %s\n", path, phy,
- rtwdev->dbcc_en ? "on" : "off",
+ str_on_off(rtwdev->dbcc_en),
iqk_info->iqk_band[path] == 0 ? "2G" :
iqk_info->iqk_band[path] == 1 ? "5G" : "6G",
iqk_info->iqk_ch[path],
@@ -1920,8 +1921,8 @@ static void _dpk_information(struct rtw89_dev *rtwdev,
rtw89_debug(rtwdev, RTW89_DBG_RFK,
"[DPK] S%d[%d] (PHY%d): TSSI %s/ DBCC %s/ %s/ CH%d/ %s\n",
path, dpk->cur_idx[path], phy,
- rtwdev->is_tssi_mode[path] ? "on" : "off",
- rtwdev->dbcc_en ? "on" : "off",
+ str_on_off(rtwdev->is_tssi_mode[path]),
+ str_on_off(rtwdev->dbcc_en),
dpk->bp[path][kidx].band == 0 ? "2G" :
dpk->bp[path][kidx].band == 1 ? "5G" : "6G",
dpk->bp[path][kidx].ch,
@@ -2000,7 +2001,7 @@ static void _dpk_txpwr_bb_force(struct rtw89_dev *rtwdev, u8 path, bool force)
rtw89_phy_write32_mask(rtwdev, R_TXPWRB_H + (path << 13), B_TXPWRB_RDY, force);
rtw89_debug(rtwdev, RTW89_DBG_RFK, "[DPK] S%d txpwr_bb_force %s\n",
- path, force ? "on" : "off");
+ path, str_on_off(force));
}
static void _dpk_kip_restore(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy,
@@ -2828,7 +2829,7 @@ static void _dpk_onoff(struct rtw89_dev *rtwdev,
B_DPD_MEN, val);
rtw89_debug(rtwdev, RTW89_DBG_RFK, "[DPK] S%d[%d] DPK %s !!!\n", path,
- kidx, dpk->is_dpk_enable && !off ? "enable" : "disable");
+ kidx, str_enable_disable(dpk->is_dpk_enable && !off));
}
static void _dpk_track(struct rtw89_dev *rtwdev)
diff --git a/drivers/net/wireless/realtek/rtw89/usb.c b/drivers/net/wireless/realtek/rtw89/usb.c
index 6cf89aee252e..c7c90ddea409 100644
--- a/drivers/net/wireless/realtek/rtw89/usb.c
+++ b/drivers/net/wireless/realtek/rtw89/usb.c
@@ -2,6 +2,7 @@
/* Copyright(c) 2025 Realtek Corporation
*/
+#include <linux/string_choices.h>
#include <linux/usb.h>
#include "debug.h"
#include "mac.h"
@@ -55,7 +56,7 @@ static void rtw89_usb_vendorreq(struct rtw89_dev *rtwdev, u32 addr,
else if (ret < 0)
rtw89_warn(rtwdev,
"usb %s%u 0x%x fail ret=%d value=0x%x attempt=%d\n",
- reqtype == RTW89_USB_VENQT_READ ? "read" : "write",
+ str_read_write(reqtype == RTW89_USB_VENQT_READ),
len * 8, addr, ret,
le32_to_cpup(rtwusb->vendor_req_buf),
attempt);
diff --git a/drivers/net/wireless/realtek/rtw89/wow.c b/drivers/net/wireless/realtek/rtw89/wow.c
index 5faa51ad896a..6e4156ef898c 100644
--- a/drivers/net/wireless/realtek/rtw89/wow.c
+++ b/drivers/net/wireless/realtek/rtw89/wow.c
@@ -1,6 +1,9 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* Copyright(c) 2019-2022 Realtek Corporation
*/
+
+#include <linux/string_choices.h>
+
#include "cam.h"
#include "core.h"
#include "debug.h"
@@ -1248,7 +1251,7 @@ static int rtw89_wow_check_fw_status(struct rtw89_dev *rtwdev, bool wow_enable)
mac->wow_ctrl.addr, mac->wow_ctrl.mask);
if (ret)
rtw89_err(rtwdev, "failed to check wow status %s\n",
- wow_enable ? "enabled" : "disabled");
+ str_enabled_disabled(wow_enable));
return ret;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH rtw-next] wifi: rtw89: Replace hardcoded strings with helper functions
2025-09-21 15:44 [PATCH rtw-next] wifi: rtw89: Replace hardcoded strings with helper functions Yu-Chun Lin
@ 2025-09-22 5:50 ` Ping-Ke Shih
2025-09-23 15:57 ` Yu-Chun Lin
0 siblings, 1 reply; 7+ messages in thread
From: Ping-Ke Shih @ 2025-09-22 5:50 UTC (permalink / raw)
To: Yu-Chun Lin
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
CY_Huang[黃鉦晏],
Stanley Chang[昌育德], jserv@ccns.ncku.edu.tw,
visitorckw@gmail.com
Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> Replace hardcoded strings with 'str_on_off()', 'str_enable_disable()',
> and 'str_read_write()'.
>
> The change improves readability and enables potential string deduplication
> by the linker, which may slightly reduce binary size.
Have you measured the change of binary size? Maybe you can share the result
here.
>
> Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
> ---
> drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c | 10 ++++++----
> drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c | 10 ++++++----
> drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c | 8 +++++---
> drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c | 11 ++++++-----
> drivers/net/wireless/realtek/rtw89/usb.c | 3 ++-
> drivers/net/wireless/realtek/rtw89/wow.c | 5 ++++-
> 6 files changed, 29 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
> b/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
> index 84c46d2f4d85..000753061e38 100644
> --- a/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
> +++ b/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
> @@ -2,6 +2,8 @@
> /* Copyright(c) 2022-2023 Realtek Corporation
> */
>
> +#include <linux/string_choices.h>
> +
Driver has included this implicitly, so don't need to include it across
whole patch.
Otherwise looks good to me.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH rtw-next] wifi: rtw89: Replace hardcoded strings with helper functions
2025-09-22 5:50 ` Ping-Ke Shih
@ 2025-09-23 15:57 ` Yu-Chun Lin
2025-09-24 0:43 ` Ping-Ke Shih
0 siblings, 1 reply; 7+ messages in thread
From: Yu-Chun Lin @ 2025-09-23 15:57 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
CY_Huang[黃鉦晏],
Stanley Chang[昌育德], jserv@ccns.ncku.edu.tw,
visitorckw@gmail.com
On Mon, Sep 22, 2025 at 05:50:50AM +0000, Ping-Ke Shih wrote:
> Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> > Replace hardcoded strings with 'str_on_off()', 'str_enable_disable()',
> > and 'str_read_write()'.
> >
> > The change improves readability and enables potential string deduplication
> > by the linker, which may slightly reduce binary size.
>
> Have you measured the change of binary size? Maybe you can share the result
> here.
>
I tested the patch and did not observe any measurable change in the binary size.
The commit message was refers to the description in string-choice.h:
"3) Deduping by the linker, which results in a smaller binary file."
> >
> > Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
> > ---
> > drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c | 10 ++++++----
> > drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c | 10 ++++++----
> > drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c | 8 +++++---
> > drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c | 11 ++++++-----
> > drivers/net/wireless/realtek/rtw89/usb.c | 3 ++-
> > drivers/net/wireless/realtek/rtw89/wow.c | 5 ++++-
> > 6 files changed, 29 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
> > b/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
> > index 84c46d2f4d85..000753061e38 100644
> > --- a/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
> > +++ b/drivers/net/wireless/realtek/rtw89/rtw8851b_rfk.c
> > @@ -2,6 +2,8 @@
> > /* Copyright(c) 2022-2023 Realtek Corporation
> > */
> >
> > +#include <linux/string_choices.h>
> > +
>
> Driver has included this implicitly, so don't need to include it across
> whole patch.
>
Got it, I will drop the include from all files in v2. Thanks.
> Otherwise looks good to me.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH rtw-next] wifi: rtw89: Replace hardcoded strings with helper functions
2025-09-23 15:57 ` Yu-Chun Lin
@ 2025-09-24 0:43 ` Ping-Ke Shih
2025-09-25 3:59 ` Yu-Chun Lin
0 siblings, 1 reply; 7+ messages in thread
From: Ping-Ke Shih @ 2025-09-24 0:43 UTC (permalink / raw)
To: Yu-Chun Lin
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
CY_Huang[黃鉦晏],
Stanley Chang[昌育德], jserv@ccns.ncku.edu.tw,
visitorckw@gmail.com
Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> On Mon, Sep 22, 2025 at 05:50:50AM +0000, Ping-Ke Shih wrote:
> > Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> > > Replace hardcoded strings with 'str_on_off()', 'str_enable_disable()',
> > > and 'str_read_write()'.
> > >
> > > The change improves readability and enables potential string deduplication
> > > by the linker, which may slightly reduce binary size.
> >
> > Have you measured the change of binary size? Maybe you can share the result
> > here.
> >
>
> I tested the patch and did not observe any measurable change in the binary size.
> The commit message was refers to the description in string-choice.h:
>
> "3) Deduping by the linker, which results in a smaller binary file."
It might rely on LTO (link-time optimization).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH rtw-next] wifi: rtw89: Replace hardcoded strings with helper functions
2025-09-24 0:43 ` Ping-Ke Shih
@ 2025-09-25 3:59 ` Yu-Chun Lin
2025-09-25 4:28 ` Ping-Ke Shih
0 siblings, 1 reply; 7+ messages in thread
From: Yu-Chun Lin @ 2025-09-25 3:59 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
CY_Huang[黃鉦晏],
Stanley Chang[昌育德], jserv@ccns.ncku.edu.tw,
visitorckw@gmail.com
On Wed, Sep 24, 2025 at 12:43:56AM +0000, Ping-Ke Shih wrote:
> Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> > On Mon, Sep 22, 2025 at 05:50:50AM +0000, Ping-Ke Shih wrote:
> > > Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> > > > Replace hardcoded strings with 'str_on_off()', 'str_enable_disable()',
> > > > and 'str_read_write()'.
> > > >
> > > > The change improves readability and enables potential string deduplication
> > > > by the linker, which may slightly reduce binary size.
> > >
> > > Have you measured the change of binary size? Maybe you can share the result
> > > here.
> > >
> >
> > I tested the patch and did not observe any measurable change in the binary size.
> > The commit message was refers to the description in string-choice.h:
> >
> > "3) Deduping by the linker, which results in a smaller binary file."
>
> It might rely on LTO (link-time optimization).
>
I re-tested with 'LTO_CLANG=y', and the code size remains unchanged before
and after the patch. I will remove the statement
("may slightly reduce binary size") from the v2 commit message.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH rtw-next] wifi: rtw89: Replace hardcoded strings with helper functions
2025-09-25 3:59 ` Yu-Chun Lin
@ 2025-09-25 4:28 ` Ping-Ke Shih
2025-09-25 4:57 ` Yu-Chun Lin
0 siblings, 1 reply; 7+ messages in thread
From: Ping-Ke Shih @ 2025-09-25 4:28 UTC (permalink / raw)
To: Yu-Chun Lin
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
CY_Huang[黃鉦晏],
Stanley Chang[昌育德], jserv@ccns.ncku.edu.tw,
visitorckw@gmail.com
Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> On Wed, Sep 24, 2025 at 12:43:56AM +0000, Ping-Ke Shih wrote:
> > Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> > > On Mon, Sep 22, 2025 at 05:50:50AM +0000, Ping-Ke Shih wrote:
> > > > Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> > > > > Replace hardcoded strings with 'str_on_off()', 'str_enable_disable()',
> > > > > and 'str_read_write()'.
> > > > >
> > > > > The change improves readability and enables potential string deduplication
> > > > > by the linker, which may slightly reduce binary size.
> > > >
> > > > Have you measured the change of binary size? Maybe you can share the result
> > > > here.
> > > >
> > >
> > > I tested the patch and did not observe any measurable change in the binary size.
> > > The commit message was refers to the description in string-choice.h:
> > >
> > > "3) Deduping by the linker, which results in a smaller binary file."
> >
> > It might rely on LTO (link-time optimization).
> >
>
> I re-tested with 'LTO_CLANG=y', and the code size remains unchanged before
> and after the patch. I will remove the statement
> ("may slightly reduce binary size") from the v2 commit message.
>
What is the .o you checked? Have you also checked size of .ko?
I guess (sorry I'm not familiar with LTO) that LTO only takes effect
at least doing partial link.
As the changes of your patch, maybe you can check rtw89_8851b.o or
rtw89_8851b.ko.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH rtw-next] wifi: rtw89: Replace hardcoded strings with helper functions
2025-09-25 4:28 ` Ping-Ke Shih
@ 2025-09-25 4:57 ` Yu-Chun Lin
0 siblings, 0 replies; 7+ messages in thread
From: Yu-Chun Lin @ 2025-09-25 4:57 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
CY_Huang[黃鉦晏],
Stanley Chang[昌育德], jserv@ccns.ncku.edu.tw,
visitorckw@gmail.com
On Thu, Sep 25, 2025 at 04:28:40AM +0000, Ping-Ke Shih wrote:
> Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> > On Wed, Sep 24, 2025 at 12:43:56AM +0000, Ping-Ke Shih wrote:
> > > Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> > > > On Mon, Sep 22, 2025 at 05:50:50AM +0000, Ping-Ke Shih wrote:
> > > > > Yu-Chun Lin <eleanor15x@gmail.com> wrote:
> > > > > > Replace hardcoded strings with 'str_on_off()', 'str_enable_disable()',
> > > > > > and 'str_read_write()'.
> > > > > >
> > > > > > The change improves readability and enables potential string deduplication
> > > > > > by the linker, which may slightly reduce binary size.
> > > > >
> > > > > Have you measured the change of binary size? Maybe you can share the result
> > > > > here.
> > > > >
> > > >
> > > > I tested the patch and did not observe any measurable change in the binary size.
> > > > The commit message was refers to the description in string-choice.h:
> > > >
> > > > "3) Deduping by the linker, which results in a smaller binary file."
> > >
> > > It might rely on LTO (link-time optimization).
> > >
> >
> > I re-tested with 'LTO_CLANG=y', and the code size remains unchanged before
> > and after the patch. I will remove the statement
> > ("may slightly reduce binary size") from the v2 commit message.
> >
>
> What is the .o you checked? Have you also checked size of .ko?
> I guess (sorry I'm not familiar with LTO) that LTO only takes effect
> at least doing partial link.
>
> As the changes of your patch, maybe you can check rtw89_8851b.o or
> rtw89_8851b.ko.
>
I built all related files directly into the kernel, so my measurement was
on the size of the entire vmlinux, not individual .o files or modules.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-09-25 4:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-21 15:44 [PATCH rtw-next] wifi: rtw89: Replace hardcoded strings with helper functions Yu-Chun Lin
2025-09-22 5:50 ` Ping-Ke Shih
2025-09-23 15:57 ` Yu-Chun Lin
2025-09-24 0:43 ` Ping-Ke Shih
2025-09-25 3:59 ` Yu-Chun Lin
2025-09-25 4:28 ` Ping-Ke Shih
2025-09-25 4:57 ` Yu-Chun Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox