Skip to contentSkip to conversation

staging: r8188eu: Can odm_DynamicTxPowerNIC() be removed?

DISCUSSION Michael Straube 3 participants 4 messages Sep 18, 2021 – Sep 20, 2021 Staging

lore
Share & tools
lore
#0 lore raw

Hi Larry, Phillip and all.

While removing code that checks for the chip type I stumbled upon this:

void odm_DynamicTxPowerNIC(struct odm_dm_struct *pDM_Odm)

{
	if (!(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_TXPWR))
		return;

	if (pDM_Odm->SupportICType == ODM_RTL8188E) {
		/*  ??? */
		/*  This part need to be redefined. */
	}
}

(pDM_Odm->SupportICType == ODM_RTL8188E) is always true in this driver. Currently the function does nothing and the driver seems to work fine. Because of the comment I'm not sure if the whole function can just be removed?

Regards,
Michael

#1 lore raw
Quoted 17 lines · Michael Straube

Hi Larry, Phillip and all.

While removing code that checks for the chip type I stumbled upon this:

void odm_DynamicTxPowerNIC(struct odm_dm_struct *pDM_Odm) {
    if (!(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_TXPWR)) return;

    if (pDM_Odm->SupportICType == ODM_RTL8188E) { /*  ??? */
        /*  This part need to be redefined. */ }
}

Quoted 4 lines

(pDM_Odm->SupportICType == ODM_RTL8188E) is always true in this driver. Currently the function does nothing and the driver seems to work fine. Because of the comment I'm not sure if the whole function can just be removed?

Yes, I agree. No later driver does anything with this routine, thus it is dead and can be removed.

Larry

#2 lore raw
Quoted 18 lines · Larry Finger
Quoted 17 lines · Michael Straube

Hi Larry, Phillip and all.

While removing code that checks for the chip type I stumbled upon this:

void odm_DynamicTxPowerNIC(struct odm_dm_struct *pDM_Odm) {
     if (!(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_TXPWR)) return;

     if (pDM_Odm->SupportICType == ODM_RTL8188E) { /*  ??? */
         /*  This part need to be redefined. */ }
}

Quoted 9 lines
Quoted 4 lines

(pDM_Odm->SupportICType == ODM_RTL8188E) is always true in this driver. Currently the function does nothing and the driver seems to work fine. Because of the comment I'm not sure if the whole function can just be removed?

Yes, I agree. No later driver does anything with this routine, thus it is dead and can be removed.

Larry

Ok, thank you.

Regards,
Michael

#3 lore raw
In reply to Michael Straube
Quoted 6 lines · Michael Straube

Hi Larry, Phillip and all.

While removing code that checks for the chip type I stumbled upon this:

void odm_DynamicTxPowerNIC(struct odm_dm_struct *pDM_Odm)

Quoted 9 lines
{
	if (!(pDM_Odm->SupportAbility & ODM_BB_DYNAMIC_TXPWR))
		return;

	if (pDM_Odm->SupportICType == ODM_RTL8188E) {
		/*  ??? */
		/*  This part need to be redefined. */
	}
}

Always just delete dead code. The future is very hard to predict so don't leave things lying around because of possible futures. Don't be a hoarder.

regards,
dan carpenter