staging: r8188eu: remove EepromOrEfuse from struct eeprom_priv
authorMartin Kaiser <martin@kaiser.cx>
Sat, 9 Jul 2022 17:09:48 +0000 (19:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Jul 2022 08:06:44 +0000 (10:06 +0200)
The EepromOrEfuse flag in struct eeprom_priv is used only in the
ReadAdapterInfo8188EU function. We can remove EepromOrEfuse from struct
eeprom_priv.

As the meaning of EepromOrEfuse isn't obvious, there is a macro
is_boot_from_eeprom that's used for checking the value. We don't need the
macro, writing the check as !(eeValue & BOOT_FROM_EEPROM) makes it clear
what is checked.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220709171000.180481-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/usb_halinit.c
drivers/staging/r8188eu/include/hal_intf.h
drivers/staging/r8188eu/include/rtw_eeprom.h

index 04beded95475a331e60402bb5b3af6ef9dd8a5b4..2d5d81e96c8b6269c0a48a24fc4cc35205969797 100644 (file)
@@ -937,10 +937,9 @@ void ReadAdapterInfo8188EU(struct adapter *Adapter)
        if (res)
                return;
 
-       eeprom->EepromOrEfuse           = (eeValue & BOOT_FROM_EEPROM);
        eeprom->bautoload_fail_flag     = !(eeValue & EEPROM_EN);
 
-       if (!is_boot_from_eeprom(Adapter))
+       if (!(eeValue & BOOT_FROM_EEPROM))
                EFUSE_ShadowMapUpdate(Adapter);
 
        /* parse the eeprom/efuse content */
index c1db7f834e2027be974d305fd4ece52375cd5971..4e0a2a4f2f02402a7103b1f0888e87df4da9cd11 100644 (file)
@@ -16,8 +16,6 @@ enum hw_variables {
 
 typedef s32 (*c2h_id_filter)(u8 id);
 
-#define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse)
-
 void rtl8188eu_interface_configure(struct adapter *adapt);
 void ReadAdapterInfo8188EU(struct adapter *Adapter);
 void rtl8188eu_init_default_value(struct adapter *adapt);
index d8d48ace356c3a20ce5991cad85f111a10376b58..40c61f7a03be34059a956076b340ec6cf49b49a5 100644 (file)
@@ -12,7 +12,6 @@
 struct eeprom_priv {
        u8              bautoload_fail_flag;
        u8              mac_addr[ETH_ALEN] __aligned(2); /* PermanentAddress */
-       u8              EepromOrEfuse;
        u8              efuse_eeprom_data[HWSET_MAX_SIZE_512] __aligned(4);
 };