[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F79D91A.2030403@st.com>
Date: Mon, 02 Apr 2012 17:51:38 +0100
From: Srinivas KANDAGATLA <srinivas.kandagatla@...com>
To: Joe Perches <joe@...ches.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH 3.3.0 1/3] net:phy:bcm63xx: remove unnecessary code
On 02/04/12 17:42, Joe Perches wrote:
> On Mon, 2012-04-02 at 17:24 +0100, Srinivas KANDAGATLA wrote:
>> From: Srinivas Kandagatla <srinivas.kandagatla@...com>
>>
>> Compile tested.
>> remove unnecessary code that matches this coccinelle pattern
>>
>> ret = phy_write(x, y , z)
>> if (ret < 0)
>> return ret;
>> return 0;
>>
>> As phy_write returns error code, we dont need to do not need extra check
>> before returning.
>
> Do these really make any functional difference?
No it does not make any functional difference.
> Doesn't the compiler generate the same output?
>
I think it will not generate same output.
> Many times, there's a code pattern that precedes these
> calls has a similar pattern and changing the pattern
> for the last call in a sequence can be jarring to a
> reader and changing the pattern can sometimes introduce
> errors as well.
There is a purpose(error handling) of having similar pattern for the
code above last call, However there is no value for doing an additional
check before returning.
If we look at other phy files(ex:boardcom.c..), we can see they do
something similar to what the patch does in config_init.
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists