Commit c7703196 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman
Browse files

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.

Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220417175441.13830-8-straube.linux@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4ae19e7a
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -246,7 +246,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);
@@ -260,8 +259,7 @@ 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",
	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));