[PATCH] staging:rtl8712:Fix compressed return statement

Larry Finger Larry.Finger at lwfinger.net
Wed Jun 3 14:31:51 UTC 2015


On 06/03/2015 08:28 AM, Mutharaju, Prasanna (P.) wrote:
> On Wed, Jun 03, 2015 at 02:35:35PM +0530, Sudip Mukherjee wrote:
>> On Wed, Jun 03, 2015 at 08:23:54AM +0000, Mutharaju, Prasanna (P.) wrote:
>>> From: Prasanna Karthik <mkarthi3 at visteon.com>
>>>
>>> Fix reported by coccinelle compressing last two lines with single return
>>> call
>>>
>>> Signed-off-by: Prasanna Karthik <mkarthi3 at visteon.com>
>>> ---
>>>   drivers/staging/rtl8712/rtl871x_sta_mgt.c |    3 +--
>>>   1 files changed, 1 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/staging/rtl8712/rtl871x_sta_mgt.c b/drivers/staging/rtl8712/rtl871x_sta_mgt.c
>>> index a9b93d0..f53b36c 100644
>>> --- a/drivers/staging/rtl8712/rtl871x_sta_mgt.c
>>> +++ b/drivers/staging/rtl8712/rtl871x_sta_mgt.c
>>> @@ -274,8 +274,7 @@ struct sta_info *r8712_get_bcmc_stainfo(struct _adapter *padapter)
>>>   	struct sta_priv *pstapriv = &padapter->stapriv;
>>>   	u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
>>>
>>> -	psta = r8712_get_stainfo(pstapriv, bc_addr);
>>> -	return psta;
>>> +	return r8712_get_stainfo(pstapriv, bc_addr);
>> now we are having a build warning of unused variable 'psta'.
>>
>> regards
>> sudip
>>
> removed psta structure declaration which is not needed in r8712_get_bcmc_stainfo() which already
> having single return statement fix,which would eventually solve compiler warning.
> thoughts on V2 Patch with this fix?

Obviously you need to remove the unused variable and submit V2. Please be 
careful and compile the code after you make a change. Otherwise you end up being 
regarded as a troll, and your proposed patches are ignored.

Larry



More information about the devel mailing list