* [PATCH][V2] mlxsw: spectrum: remove redundant check if err is zero
@ 2016-09-25 1:03 Colin King
2016-09-25 5:08 ` Ido Schimmel
0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2016-09-25 1:03 UTC (permalink / raw)
To: Hariprasad S, netdev; +Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
There is an earlier check and return if err is non-zero, so
the check to see if it is zero is redundant in every iteration
of the loop and hence the check can be removed.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
index 2a61617..1073673 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
@@ -117,11 +117,11 @@ static int validate_filter(struct net_device *dev,
return 0;
}
-static unsigned int get_filter_steerq(struct net_device *dev,
- struct ch_filter_specification *fs)
+static int get_filter_steerq(struct net_device *dev,
+ struct ch_filter_specification *fs)
{
struct adapter *adapter = netdev2adap(dev);
- unsigned int iq;
+ int iq;
/* If the user has requested steering matching Ingress Packets
* to a specific Queue Set, we need to make sure it's in range
@@ -443,10 +443,10 @@ int __cxgb4_set_filter(struct net_device *dev, int filter_id,
struct filter_ctx *ctx)
{
struct adapter *adapter = netdev2adap(dev);
- unsigned int max_fidx, fidx, iq;
+ unsigned int max_fidx, fidx;
struct filter_entry *f;
u32 iconf;
- int ret;
+ int iq, ret;
max_fidx = adapter->tids.nftids;
if (filter_id != (max_fidx + adapter->tids.nsftids - 1) &&
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][V2] mlxsw: spectrum: remove redundant check if err is zero
2016-09-25 1:03 [PATCH][V2] mlxsw: spectrum: remove redundant check if err is zero Colin King
@ 2016-09-25 5:08 ` Ido Schimmel
2016-09-25 21:08 ` Colin Ian King
0 siblings, 1 reply; 3+ messages in thread
From: Ido Schimmel @ 2016-09-25 5:08 UTC (permalink / raw)
To: Colin King; +Cc: Hariprasad S, netdev, linux-kernel
On Sat, Sep 24, 2016 at 06:03:38PM -0700, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> There is an earlier check and return if err is non-zero, so
> the check to see if it is zero is redundant in every iteration
> of the loop and hence the check can be removed.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
The subject and commit message are wrong. I think you copy-pasted them
from an earlier patch.
> ---
> drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
> index 2a61617..1073673 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
> @@ -117,11 +117,11 @@ static int validate_filter(struct net_device *dev,
> return 0;
> }
>
> -static unsigned int get_filter_steerq(struct net_device *dev,
> - struct ch_filter_specification *fs)
> +static int get_filter_steerq(struct net_device *dev,
> + struct ch_filter_specification *fs)
> {
> struct adapter *adapter = netdev2adap(dev);
> - unsigned int iq;
> + int iq;
>
> /* If the user has requested steering matching Ingress Packets
> * to a specific Queue Set, we need to make sure it's in range
> @@ -443,10 +443,10 @@ int __cxgb4_set_filter(struct net_device *dev, int filter_id,
> struct filter_ctx *ctx)
> {
> struct adapter *adapter = netdev2adap(dev);
> - unsigned int max_fidx, fidx, iq;
> + unsigned int max_fidx, fidx;
> struct filter_entry *f;
> u32 iconf;
> - int ret;
> + int iq, ret;
>
> max_fidx = adapter->tids.nftids;
> if (filter_id != (max_fidx + adapter->tids.nsftids - 1) &&
> --
> 2.9.3
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][V2] mlxsw: spectrum: remove redundant check if err is zero
2016-09-25 5:08 ` Ido Schimmel
@ 2016-09-25 21:08 ` Colin Ian King
0 siblings, 0 replies; 3+ messages in thread
From: Colin Ian King @ 2016-09-25 21:08 UTC (permalink / raw)
To: Ido Schimmel; +Cc: Hariprasad S, netdev, linux-kernel
On 24/09/16 22:08, Ido Schimmel wrote:
> On Sat, Sep 24, 2016 at 06:03:38PM -0700, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> There is an earlier check and return if err is non-zero, so
>> the check to see if it is zero is redundant in every iteration
>> of the loop and hence the check can be removed.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> The subject and commit message are wrong. I think you copy-pasted them
> from an earlier patch.
Oops, jetlagged cut-n-paste error. I'll resend
>
>> ---
>> drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
>> index 2a61617..1073673 100644
>> --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
>> +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
>> @@ -117,11 +117,11 @@ static int validate_filter(struct net_device *dev,
>> return 0;
>> }
>>
>> -static unsigned int get_filter_steerq(struct net_device *dev,
>> - struct ch_filter_specification *fs)
>> +static int get_filter_steerq(struct net_device *dev,
>> + struct ch_filter_specification *fs)
>> {
>> struct adapter *adapter = netdev2adap(dev);
>> - unsigned int iq;
>> + int iq;
>>
>> /* If the user has requested steering matching Ingress Packets
>> * to a specific Queue Set, we need to make sure it's in range
>> @@ -443,10 +443,10 @@ int __cxgb4_set_filter(struct net_device *dev, int filter_id,
>> struct filter_ctx *ctx)
>> {
>> struct adapter *adapter = netdev2adap(dev);
>> - unsigned int max_fidx, fidx, iq;
>> + unsigned int max_fidx, fidx;
>> struct filter_entry *f;
>> u32 iconf;
>> - int ret;
>> + int iq, ret;
>>
>> max_fidx = adapter->tids.nftids;
>> if (filter_id != (max_fidx + adapter->tids.nsftids - 1) &&
>> --
>> 2.9.3
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-25 21:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-25 1:03 [PATCH][V2] mlxsw: spectrum: remove redundant check if err is zero Colin King
2016-09-25 5:08 ` Ido Schimmel
2016-09-25 21:08 ` Colin Ian King
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.