Subject: Re: [PATCH net-next] be2net: do external loopback test only when it is requested

From: Ivan Vecera <[email-masked]>
Date: Wed, 05 Mar 2014 11:56:16 +0100

On 03/04/2014 09:17 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 03/04/2014 09:04 PM, Ivan Vecera wrote:
>
>> Cc: [email-masked]
>> Cc: [email-masked]
>> Cc: [email-masked]
>
>> Signed-off-by: Ivan Vecera <[email-masked]>
>> ---
>>   drivers/net/ethernet/emulex/benet/be_ethtool.c | 9 ++++++---
>>   1 file changed, 6 insertions(+), 3 deletions(-)
>
>> diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c
>> b/drivers/net/ethernet/emulex/benet/be_ethtool.c
>> index cf09d8f..957848f 100644
>> --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
>> +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
>> @@ -809,9 +809,12 @@ be_self_test(struct net_device *netdev, struct
>> ethtool_test *test, u64 *data)
>>                           &data[1]) != 0) {
>>               test->flags |= ETH_TEST_FL_FAILED;
>>           }
>> -        if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
>> -                        &data[2]) != 0) {
>> -            test->flags |= ETH_TEST_FL_FAILED;
>> +        if (test->flags & ETH_TEST_FL_EXTERNAL_LB) {
>> +            if (be_loopback_test(adapter, BE_ONE_PORT_EXT_LOOPBACK,
>> +                         &data[2]) != 0) {
>> +                test->flags |= ETH_TEST_FL_FAILED;
>> +            }
>
>     {} not needed here, according to Documentation/CodingStyle. I'm
> surprised scripts/checkpatch.pl passed, it used to catch those.
>
I wanted to preserve the same look as for other prior loopback 
if-blocks. I will fix them all and resend v2.

Ivan