[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220415121023.11564-8-straube.linux@gmail.com>
Date: Fri, 15 Apr 2022 14:10:22 +0200
From: Michael Straube <straube.linux@...il.com>
To: gregkh@...uxfoundation.org
Cc: Larry.Finger@...inger.net, phil@...lpotter.co.uk,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Michael Straube <straube.linux@...il.com>
Subject: [PATCH v3 7/8] staging: r8188eu: use pr_info_once() to log the firmware version
Use pr_info_once() instead of a static variable and an if statement
to log the firmware version only once.
Signed-off-by: Michael Straube <straube.linux@...il.com>
---
v3:
- added back logging the firmware version only once, using
pr_info_once() instead of a static variable and if statement
v2:
- no changes
drivers/staging/r8188eu/core/rtw_fw.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_fw.c b/drivers/staging/r8188eu/core/rtw_fw.c
index c102aba099f5..7ee72236c7f4 100644
--- a/drivers/staging/r8188eu/core/rtw_fw.c
+++ b/drivers/staging/r8188eu/core/rtw_fw.c
@@ -241,7 +241,6 @@ int rtl8188e_firmware_download(struct adapter *padapter)
struct rt_firmware_hdr *fwhdr = NULL;
u8 *fw_data;
u32 fw_size;
- static int log_version;
if (!dvobj->firmware.data)
ret = load_firmware(&dvobj->firmware, device);
@@ -255,10 +254,9 @@ int rtl8188e_firmware_download(struct adapter *padapter)
/* To Check Fw header. Added by tynli. 2009.12.04. */
fwhdr = (struct rt_firmware_hdr *)dvobj->firmware.data;
- if (!log_version++)
- pr_info("%sFirmware Version %d, SubVersion %d, Signature 0x%x\n",
- DRIVER_PREFIX, le16_to_cpu(fwhdr->version), fwhdr->subversion,
- le16_to_cpu(fwhdr->signature));
+ pr_info_once("%sFirmware Version %d, SubVersion %d, Signature 0x%x\n",
+ DRIVER_PREFIX, le16_to_cpu(fwhdr->version), fwhdr->subversion,
+ le16_to_cpu(fwhdr->signature));
if (IS_FW_HEADER_EXIST(fwhdr)) {
fw_data = fw_data + sizeof(struct rt_firmware_hdr);
--
2.35.1
Powered by blists - more mailing lists