* [PATCH 0/4] staging: Drop unnecessary code
@ 2015-10-31 14:45 Amitoj Kaur Chawla
2015-10-31 14:46 ` [PATCH 1/4] staging: rtl8712: rtl871x_sta_mgt: Remove wrapper function Amitoj Kaur Chawla
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-31 14:45 UTC (permalink / raw)
To: outreachy-kernel
This patchset removes wrapper function, unnecessary variable and
function to clean up code.
Amitoj Kaur Chawla (4):
staging: rtl8712: rtl871x_sta_mgt: Remove wrapper function
staging: rtl8712: rtl871x_mlme: Remove wrapper function
staging: rtl8192e: Remove unnecessary variable
staging: rtl8192u: Remove unnecessary function
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 5 ++---
drivers/staging/rtl8192u/r819xU_phy.c | 25 +++++--------------------
drivers/staging/rtl8712/rtl871x_mlme.c | 8 +-------
drivers/staging/rtl8712/rtl871x_sta_mgt.c | 9 ++-------
4 files changed, 10 insertions(+), 37 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 1/4] staging: rtl8712: rtl871x_sta_mgt: Remove wrapper function 2015-10-31 14:45 [PATCH 0/4] staging: Drop unnecessary code Amitoj Kaur Chawla @ 2015-10-31 14:46 ` Amitoj Kaur Chawla 2015-11-04 20:28 ` [Outreachy kernel] " Greg KH 2015-10-31 14:49 ` [PATCH 2/4] staging: rtl8712: rtl871x_mlme: " Amitoj Kaur Chawla ` (2 subsequent siblings) 3 siblings, 1 reply; 9+ messages in thread From: Amitoj Kaur Chawla @ 2015-10-31 14:46 UTC (permalink / raw) To: outreachy-kernel Remove wrapper function that can be replaced by a single line of code. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> --- drivers/staging/rtl8712/rtl871x_sta_mgt.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_sta_mgt.c b/drivers/staging/rtl8712/rtl871x_sta_mgt.c index 6ae8cdc..a379b84 100644 --- a/drivers/staging/rtl8712/rtl871x_sta_mgt.c +++ b/drivers/staging/rtl8712/rtl871x_sta_mgt.c @@ -89,16 +89,11 @@ static void mfree_all_stainfo(struct sta_priv *pstapriv) spin_unlock_irqrestore(&pstapriv->sta_hash_lock, irqL); } - -static void mfree_sta_priv_lock(struct sta_priv *pstapriv) -{ - mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */ -} - u32 _r8712_free_sta_priv(struct sta_priv *pstapriv) { if (pstapriv) { - mfree_sta_priv_lock(pstapriv); + /* be done before free sta_hash_lock */ + mfree_all_stainfo(pstapriv); kfree(pstapriv->pallocated_stainfo_buf); } return _SUCCESS; -- 1.9.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 1/4] staging: rtl8712: rtl871x_sta_mgt: Remove wrapper function 2015-10-31 14:46 ` [PATCH 1/4] staging: rtl8712: rtl871x_sta_mgt: Remove wrapper function Amitoj Kaur Chawla @ 2015-11-04 20:28 ` Greg KH 0 siblings, 0 replies; 9+ messages in thread From: Greg KH @ 2015-11-04 20:28 UTC (permalink / raw) To: Amitoj Kaur Chawla; +Cc: outreachy-kernel On Sat, Oct 31, 2015 at 08:16:27PM +0530, Amitoj Kaur Chawla wrote: > Remove wrapper function that can be replaced by a single line of code. > > Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> > --- > drivers/staging/rtl8712/rtl871x_sta_mgt.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/rtl8712/rtl871x_sta_mgt.c b/drivers/staging/rtl8712/rtl871x_sta_mgt.c > index 6ae8cdc..a379b84 100644 > --- a/drivers/staging/rtl8712/rtl871x_sta_mgt.c > +++ b/drivers/staging/rtl8712/rtl871x_sta_mgt.c > @@ -89,16 +89,11 @@ static void mfree_all_stainfo(struct sta_priv *pstapriv) > spin_unlock_irqrestore(&pstapriv->sta_hash_lock, irqL); > } > > - > -static void mfree_sta_priv_lock(struct sta_priv *pstapriv) > -{ > - mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */ > -} > - > u32 _r8712_free_sta_priv(struct sta_priv *pstapriv) > { > if (pstapriv) { > - mfree_sta_priv_lock(pstapriv); > + /* be done before free sta_hash_lock */ > + mfree_all_stainfo(pstapriv); You add trailing whitespace :( Always check your patches with checkpatch before sending them out. thanks, greg k-h ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/4] staging: rtl8712: rtl871x_mlme: Remove wrapper function 2015-10-31 14:45 [PATCH 0/4] staging: Drop unnecessary code Amitoj Kaur Chawla 2015-10-31 14:46 ` [PATCH 1/4] staging: rtl8712: rtl871x_sta_mgt: Remove wrapper function Amitoj Kaur Chawla @ 2015-10-31 14:49 ` Amitoj Kaur Chawla 2015-10-31 14:52 ` [PATCH 3/4] staging: rtl8192e: Remove unnecessary variable Amitoj Kaur Chawla 2015-10-31 14:55 ` [PATCH 4/4] staging: rtl8192u: Remove unnecessary function Amitoj Kaur Chawla 3 siblings, 0 replies; 9+ messages in thread From: Amitoj Kaur Chawla @ 2015-10-31 14:49 UTC (permalink / raw) To: outreachy-kernel Remove wrapper function free_network_nolock() that can be replaced by a single line of code. This patch renames _free_network_nolock() function to free_network_nolock(). Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> --- drivers/staging/rtl8712/rtl871x_mlme.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index fbcb248..8972c15 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -123,7 +123,7 @@ static void _free_network(struct mlme_priv *pmlmepriv, spin_unlock_irqrestore(&free_queue->lock, irqL); } -static void _free_network_nolock(struct mlme_priv *pmlmepriv, +static void free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork) { struct __queue *free_queue = &pmlmepriv->free_bss_pool; @@ -233,12 +233,6 @@ static struct wlan_network *alloc_network(struct mlme_priv *pmlmepriv) return _r8712_alloc_network(pmlmepriv); } -static void free_network_nolock(struct mlme_priv *pmlmepriv, - struct wlan_network *pnetwork) -{ - _free_network_nolock(pmlmepriv, pnetwork); -} - void r8712_free_network_queue(struct _adapter *dev) { _free_network_queue(dev); -- 1.9.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] staging: rtl8192e: Remove unnecessary variable 2015-10-31 14:45 [PATCH 0/4] staging: Drop unnecessary code Amitoj Kaur Chawla 2015-10-31 14:46 ` [PATCH 1/4] staging: rtl8712: rtl871x_sta_mgt: Remove wrapper function Amitoj Kaur Chawla 2015-10-31 14:49 ` [PATCH 2/4] staging: rtl8712: rtl871x_mlme: " Amitoj Kaur Chawla @ 2015-10-31 14:52 ` Amitoj Kaur Chawla 2015-10-31 14:55 ` [PATCH 4/4] staging: rtl8192u: Remove unnecessary function Amitoj Kaur Chawla 3 siblings, 0 replies; 9+ messages in thread From: Amitoj Kaur Chawla @ 2015-10-31 14:52 UTC (permalink / raw) To: outreachy-kernel This patch removes unnecessary variable by using a single line of code instead. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> --- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 0b407fe..5e3bbe5 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -90,13 +90,12 @@ void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask, u32 rtl92e_get_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask) { - u32 Ret = 0, OriginalValue, BitShift; + u32 OriginalValue, BitShift; OriginalValue = rtl92e_readl(dev, dwRegAddr); BitShift = _rtl92e_calculate_bit_shift(dwBitMask); - Ret = (OriginalValue & dwBitMask) >> BitShift; - return Ret; + return (OriginalValue & dwBitMask) >> BitShift; } static u32 _rtl92e_phy_rf_read(struct net_device *dev, -- 1.9.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/4] staging: rtl8192u: Remove unnecessary function 2015-10-31 14:45 [PATCH 0/4] staging: Drop unnecessary code Amitoj Kaur Chawla ` (2 preceding siblings ...) 2015-10-31 14:52 ` [PATCH 3/4] staging: rtl8192e: Remove unnecessary variable Amitoj Kaur Chawla @ 2015-10-31 14:55 ` Amitoj Kaur Chawla 2015-10-31 17:17 ` [Outreachy kernel] " Julia Lawall 3 siblings, 1 reply; 9+ messages in thread From: Amitoj Kaur Chawla @ 2015-10-31 14:55 UTC (permalink / raw) To: outreachy-kernel This patch solves two problems. The function rtl8192_CalculateBitShift() had an unnecessary variable i that could be removed by using a single line of code. After this change, rtl8192_CalculateBitShift() becomes a wrapper function, so the rtl8192_CalculateBitShift() function has been removed completely to replace it with a single line of code. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> --- drivers/staging/rtl8192u/r819xU_phy.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c index e5dbaca..5ee4c34 100644 --- a/drivers/staging/rtl8192u/r819xU_phy.c +++ b/drivers/staging/rtl8192u/r819xU_phy.c @@ -38,21 +38,6 @@ static u32 RF_CHANNEL_TABLE_ZEBRA[] = { #define rtl819XAGCTAB_Array Rtl8192UsbAGCTAB_Array /****************************************************************************** - * function: This function reads BB parameters from header file we generate, - * and does register read/write - * input: u32 bitmask //taget bit pos in the addr to be modified - * output: none - * return: u32 return the shift bit position of the mask - ******************************************************************************/ -static u32 rtl8192_CalculateBitShift(u32 bitmask) -{ - u32 i; - - i = ffs(bitmask) - 1; - return i; -} - -/****************************************************************************** * function: This function checks different RF type to execute legal judgement. * If RF Path is illegal, we will return false. * input: net_device *dev @@ -94,7 +79,7 @@ void rtl8192_setBBreg(struct net_device *dev, u32 reg_addr, u32 bitmask, if (bitmask != bMaskDWord) { read_nic_dword(dev, reg_addr, ®); - bitshift = rtl8192_CalculateBitShift(bitmask); + bitshift = ffs(bitmask) - 1; reg &= ~bitmask; reg |= data << bitshift; write_nic_dword(dev, reg_addr, reg); @@ -117,7 +102,7 @@ u32 rtl8192_QueryBBReg(struct net_device *dev, u32 reg_addr, u32 bitmask) u32 reg, bitshift; read_nic_dword(dev, reg_addr, ®); - bitshift = rtl8192_CalculateBitShift(bitmask); + bitshift = ffs(bitmask) - 1; return (reg & bitmask) >> bitshift; } @@ -306,7 +291,7 @@ void rtl8192_phy_SetRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath, if (bitmask != bMask12Bits) { /* RF data is 12 bits only */ reg = phy_FwRFSerialRead(dev, eRFPath, reg_addr); - bitshift = rtl8192_CalculateBitShift(bitmask); + bitshift = ffs(bitmask) - 1; reg &= ~bitmask; reg |= data << bitshift; @@ -321,7 +306,7 @@ void rtl8192_phy_SetRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath, if (bitmask != bMask12Bits) { /* RF data is 12 bits only */ reg = rtl8192_phy_RFSerialRead(dev, eRFPath, reg_addr); - bitshift = rtl8192_CalculateBitShift(bitmask); + bitshift = ffs(bitmask) - 1; reg &= ~bitmask; reg |= data << bitshift; @@ -356,7 +341,7 @@ u32 rtl8192_phy_QueryRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath, } else { reg = rtl8192_phy_RFSerialRead(dev, eRFPath, reg_addr); } - bitshift = rtl8192_CalculateBitShift(bitmask); + bitshift = ffs(bitmask) - 1; reg = (reg & bitmask) >> bitshift; return reg; -- 1.9.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 4/4] staging: rtl8192u: Remove unnecessary function 2015-10-31 14:55 ` [PATCH 4/4] staging: rtl8192u: Remove unnecessary function Amitoj Kaur Chawla @ 2015-10-31 17:17 ` Julia Lawall 2015-10-31 17:40 ` Amitoj Kaur Chawla 0 siblings, 1 reply; 9+ messages in thread From: Julia Lawall @ 2015-10-31 17:17 UTC (permalink / raw) To: Amitoj Kaur Chawla; +Cc: outreachy-kernel On Sat, 31 Oct 2015, Amitoj Kaur Chawla wrote: > This patch solves two problems. > The function rtl8192_CalculateBitShift() had an unnecessary variable i > that could be removed by using a single line of code. > > After this change, rtl8192_CalculateBitShift() becomes a wrapper > function, so the rtl8192_CalculateBitShift() function has been removed > completely to replace it with a single line of code. > > Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> > --- > drivers/staging/rtl8192u/r819xU_phy.c | 25 +++++-------------------- > 1 file changed, 5 insertions(+), 20 deletions(-) > > diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c > index e5dbaca..5ee4c34 100644 > --- a/drivers/staging/rtl8192u/r819xU_phy.c > +++ b/drivers/staging/rtl8192u/r819xU_phy.c > @@ -38,21 +38,6 @@ static u32 RF_CHANNEL_TABLE_ZEBRA[] = { > #define rtl819XAGCTAB_Array Rtl8192UsbAGCTAB_Array > > /****************************************************************************** > - * function: This function reads BB parameters from header file we generate, > - * and does register read/write > - * input: u32 bitmask //taget bit pos in the addr to be modified > - * output: none > - * return: u32 return the shift bit position of the mask > - ******************************************************************************/ > -static u32 rtl8192_CalculateBitShift(u32 bitmask) > -{ > - u32 i; > - > - i = ffs(bitmask) - 1; > - return i; > -} > - > -/****************************************************************************** > * function: This function checks different RF type to execute legal judgement. > * If RF Path is illegal, we will return false. > * input: net_device *dev > @@ -94,7 +79,7 @@ void rtl8192_setBBreg(struct net_device *dev, u32 reg_addr, u32 bitmask, > > if (bitmask != bMaskDWord) { > read_nic_dword(dev, reg_addr, ®); > - bitshift = rtl8192_CalculateBitShift(bitmask); > + bitshift = ffs(bitmask) - 1; I'm not sure that the change is a good idea. The names ffs is not very understandable. Is it a standard kernel function? What does it do? julia > reg &= ~bitmask; > reg |= data << bitshift; > write_nic_dword(dev, reg_addr, reg); > @@ -117,7 +102,7 @@ u32 rtl8192_QueryBBReg(struct net_device *dev, u32 reg_addr, u32 bitmask) > u32 reg, bitshift; > > read_nic_dword(dev, reg_addr, ®); > - bitshift = rtl8192_CalculateBitShift(bitmask); > + bitshift = ffs(bitmask) - 1; > > return (reg & bitmask) >> bitshift; > } > @@ -306,7 +291,7 @@ void rtl8192_phy_SetRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath, > if (bitmask != bMask12Bits) { > /* RF data is 12 bits only */ > reg = phy_FwRFSerialRead(dev, eRFPath, reg_addr); > - bitshift = rtl8192_CalculateBitShift(bitmask); > + bitshift = ffs(bitmask) - 1; > reg &= ~bitmask; > reg |= data << bitshift; > > @@ -321,7 +306,7 @@ void rtl8192_phy_SetRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath, > if (bitmask != bMask12Bits) { > /* RF data is 12 bits only */ > reg = rtl8192_phy_RFSerialRead(dev, eRFPath, reg_addr); > - bitshift = rtl8192_CalculateBitShift(bitmask); > + bitshift = ffs(bitmask) - 1; > reg &= ~bitmask; > reg |= data << bitshift; > > @@ -356,7 +341,7 @@ u32 rtl8192_phy_QueryRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath, > } else { > reg = rtl8192_phy_RFSerialRead(dev, eRFPath, reg_addr); > } > - bitshift = rtl8192_CalculateBitShift(bitmask); > + bitshift = ffs(bitmask) - 1; > reg = (reg & bitmask) >> bitshift; > return reg; > > -- > 1.9.1 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/57ba37d09c11afef9ae42a4d251771796479cbb4.1446302505.git.amitoj1606%40gmail.com. > For more options, visit https://groups.google.com/d/optout. > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 4/4] staging: rtl8192u: Remove unnecessary function 2015-10-31 17:17 ` [Outreachy kernel] " Julia Lawall @ 2015-10-31 17:40 ` Amitoj Kaur Chawla 2015-10-31 17:49 ` Julia Lawall 0 siblings, 1 reply; 9+ messages in thread From: Amitoj Kaur Chawla @ 2015-10-31 17:40 UTC (permalink / raw) To: Julia Lawall; +Cc: outreachy-kernel [-- Attachment #1: Type: text/plain, Size: 2583 bytes --] On Sat, Oct 31, 2015 at 10:47 PM, Julia Lawall <julia.lawall@lip6.fr> wrote: > On Sat, 31 Oct 2015, Amitoj Kaur Chawla wrote: > >> This patch solves two problems. >> The function rtl8192_CalculateBitShift() had an unnecessary variable i >> that could be removed by using a single line of code. >> >> After this change, rtl8192_CalculateBitShift() becomes a wrapper >> function, so the rtl8192_CalculateBitShift() function has been removed >> completely to replace it with a single line of code. >> >> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> >> --- >> drivers/staging/rtl8192u/r819xU_phy.c | 25 +++++-------------------- >> 1 file changed, 5 insertions(+), 20 deletions(-) >> >> diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c >> index e5dbaca..5ee4c34 100644 >> --- a/drivers/staging/rtl8192u/r819xU_phy.c >> +++ b/drivers/staging/rtl8192u/r819xU_phy.c >> @@ -38,21 +38,6 @@ static u32 RF_CHANNEL_TABLE_ZEBRA[] = { >> #define rtl819XAGCTAB_Array Rtl8192UsbAGCTAB_Array >> >> /****************************************************************************** >> - * function: This function reads BB parameters from header file we generate, >> - * and does register read/write >> - * input: u32 bitmask //taget bit pos in the addr to be modified >> - * output: none >> - * return: u32 return the shift bit position of the mask >> - ******************************************************************************/ >> -static u32 rtl8192_CalculateBitShift(u32 bitmask) >> -{ >> - u32 i; >> - >> - i = ffs(bitmask) - 1; >> - return i; >> -} >> - >> -/****************************************************************************** >> * function: This function checks different RF type to execute legal judgement. >> * If RF Path is illegal, we will return false. >> * input: net_device *dev >> @@ -94,7 +79,7 @@ void rtl8192_setBBreg(struct net_device *dev, u32 reg_addr, u32 bitmask, >> >> if (bitmask != bMaskDWord) { >> read_nic_dword(dev, reg_addr, ®); >> - bitshift = rtl8192_CalculateBitShift(bitmask); >> + bitshift = ffs(bitmask) - 1; > > I'm not sure that the change is a good idea. The names ffs is not very > understandable. Is it a standard kernel function? What does it do? > > julia As far as I read up about it, it returns the least significant bit of bitmask. I read up about it here. <http://man7.org/linux/man-pages/man3/ffs.3.html> Confused as to why the change isn't a good idea. -- Amitoj [-- Attachment #2: Type: text/html, Size: 3283 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Outreachy kernel] [PATCH 4/4] staging: rtl8192u: Remove unnecessary function 2015-10-31 17:40 ` Amitoj Kaur Chawla @ 2015-10-31 17:49 ` Julia Lawall 0 siblings, 0 replies; 9+ messages in thread From: Julia Lawall @ 2015-10-31 17:49 UTC (permalink / raw) To: Amitoj Kaur Chawla; +Cc: outreachy-kernel [-- Attachment #1: Type: TEXT/PLAIN, Size: 2829 bytes --] On Sat, 31 Oct 2015, Amitoj Kaur Chawla wrote: > > > On Sat, Oct 31, 2015 at 10:47 PM, Julia Lawall <julia.lawall@lip6.fr> wrote: > > On Sat, 31 Oct 2015, Amitoj Kaur Chawla wrote: > > > >> This patch solves two problems. > >> The function rtl8192_CalculateBitShift() had an unnecessary variable i > >> that could be removed by using a single line of code. > >> > >> After this change, rtl8192_CalculateBitShift() becomes a wrapper > >> function, so the rtl8192_CalculateBitShift() function has been removed > >> completely to replace it with a single line of code. > >> > >> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> > >> --- > >> drivers/staging/rtl8192u/r819xU_phy.c | 25 +++++-------------------- > >> 1 file changed, 5 insertions(+), 20 deletions(-) > >> > >> diff --git a/drivers/staging/rtl8192u/r819xU_phy.c > b/drivers/staging/rtl8192u/r819xU_phy.c > >> index e5dbaca..5ee4c34 100644 > >> --- a/drivers/staging/rtl8192u/r819xU_phy.c > >> +++ b/drivers/staging/rtl8192u/r819xU_phy.c > >> @@ -38,21 +38,6 @@ static u32 RF_CHANNEL_TABLE_ZEBRA[] = { > >> #define rtl819XAGCTAB_Array Rtl8192UsbAGCTAB_Array > >> > >> /************************************************************************* > ***** > >> - * function: This function reads BB parameters from header file we > generate, > >> - * and does register read/write > >> - * input: u32 bitmask //taget bit pos in the addr to be modified > >> - * output: none > >> - * return: u32 return the shift bit position of the mask > >> -*************************************************************************** > ***/ > >> -static u32 rtl8192_CalculateBitShift(u32 bitmask) > >> -{ > >> - u32 i; > >> - > >> - i = ffs(bitmask) - 1; > >> - return i; > >> -} > >> - > >>-/************************************************************************* > ***** > >> * function: This function checks different RF type to execute legal > judgement. > >> * If RF Path is illegal, we will return false. > >> * input: net_device *dev > >> @@ -94,7 +79,7 @@ void rtl8192_setBBreg(struct net_device *dev, u32 > reg_addr, u32 bitmask, > >> > >> if (bitmask != bMaskDWord) { > >> read_nic_dword(dev, reg_addr, ®); > >> - bitshift = rtl8192_CalculateBitShift(bitmask); > >> + bitshift = ffs(bitmask) - 1; > > > > I'm not sure that the change is a good idea. The names ffs is not very > > understandable. Is it a standard kernel function? What does it do? > > > > julia > > As far as I read up about it, it returns the least significant bit of > bitmask. I read up about it here. > Confused as to why the change isn't a good idea. OK, since it is a standard function, it should be OK. julia ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-11-04 20:28 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-10-31 14:45 [PATCH 0/4] staging: Drop unnecessary code Amitoj Kaur Chawla 2015-10-31 14:46 ` [PATCH 1/4] staging: rtl8712: rtl871x_sta_mgt: Remove wrapper function Amitoj Kaur Chawla 2015-11-04 20:28 ` [Outreachy kernel] " Greg KH 2015-10-31 14:49 ` [PATCH 2/4] staging: rtl8712: rtl871x_mlme: " Amitoj Kaur Chawla 2015-10-31 14:52 ` [PATCH 3/4] staging: rtl8192e: Remove unnecessary variable Amitoj Kaur Chawla 2015-10-31 14:55 ` [PATCH 4/4] staging: rtl8192u: Remove unnecessary function Amitoj Kaur Chawla 2015-10-31 17:17 ` [Outreachy kernel] " Julia Lawall 2015-10-31 17:40 ` Amitoj Kaur Chawla 2015-10-31 17:49 ` Julia Lawall
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.