Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1457317 > unrolled thread
| Started by | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> |
|---|---|
| First post | 2016-08-06 22:20 +0200 |
| Last post | 2016-08-09 14:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 05/14] net: ethernet: ti: cpsw: don't check slave num in runtime Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> - 2016-08-06 22:20 +0200
Re: [PATCH v2 05/14] net: ethernet: ti: cpsw: don't check slave num in runtime Grygorii Strashko <grygorii.strashko@ti.com> - 2016-08-09 13:40 +0200
Re: [PATCH v2 05/14] net: ethernet: ti: cpsw: don't check slave num in runtime Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> - 2016-08-09 14:10 +0200
| From | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> |
|---|---|
| Date | 2016-08-06 22:20 +0200 |
| Subject | [PATCH v2 05/14] net: ethernet: ti: cpsw: don't check slave num in runtime |
| Message-ID | <s3geC-22d-15@gated-at.bofh.it> |
No need to check const slave num in runtime for every packet,
and ndev for slaves w/o ndev is anyway NULL. So remove redundant
check.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
drivers/net/ethernet/ti/cpsw.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 70a9570..19aa4bb 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -498,8 +498,7 @@ static const struct cpsw_stats cpsw_gstrings_stats[] = {
(func)(slave++, ##arg); \
} while (0)
#define cpsw_get_slave_ndev(priv, __slave_no__) \
- ((__slave_no__ < priv->data.slaves) ? \
- priv->slaves[__slave_no__].ndev : NULL)
+ priv->slaves[__slave_no__].ndev
#define cpsw_get_slave_priv(priv, __slave_no__) \
(((__slave_no__ < priv->data.slaves) && \
(priv->slaves[__slave_no__].ndev)) ? \
--
1.9.1
[toc] | [next] | [standalone]
| From | Grygorii Strashko <grygorii.strashko@ti.com> |
|---|---|
| Date | 2016-08-09 13:40 +0200 |
| Subject | Re: [PATCH v2 05/14] net: ethernet: ti: cpsw: don't check slave num in runtime |
| Message-ID | <s4dy1-6VH-21@gated-at.bofh.it> |
| In reply to | #1457317 |
On 08/06/2016 01:48 PM, Ivan Khoronzhuk wrote:
> No need to check const slave num in runtime for every packet,
> and ndev for slaves w/o ndev is anyway NULL. So remove redundant
> check.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
> drivers/net/ethernet/ti/cpsw.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 70a9570..19aa4bb 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -498,8 +498,7 @@ static const struct cpsw_stats cpsw_gstrings_stats[] = {
> (func)(slave++, ##arg); \
> } while (0)
> #define cpsw_get_slave_ndev(priv, __slave_no__) \
> - ((__slave_no__ < priv->data.slaves) ? \
> - priv->slaves[__slave_no__].ndev : NULL)
> + priv->slaves[__slave_no__].ndev
So after this change it will be
#define cpsw_get_slave_ndev(priv, __slave_no__) priv->slaves[__slave_no__].ndev
Can we just drop cpsw_get_slave_ndev() macro?
> #define cpsw_get_slave_priv(priv, __slave_no__) \
> (((__slave_no__ < priv->data.slaves) && \
> (priv->slaves[__slave_no__].ndev)) ? \
>
--
regards,
-grygorii
[toc] | [prev] | [next] | [standalone]
| From | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> |
|---|---|
| Date | 2016-08-09 14:10 +0200 |
| Subject | Re: [PATCH v2 05/14] net: ethernet: ti: cpsw: don't check slave num in runtime |
| Message-ID | <s4e13-7nY-23@gated-at.bofh.it> |
| In reply to | #1458622 |
On 09.08.16 14:34, Grygorii Strashko wrote:
> On 08/06/2016 01:48 PM, Ivan Khoronzhuk wrote:
>> No need to check const slave num in runtime for every packet,
>> and ndev for slaves w/o ndev is anyway NULL. So remove redundant
>> check.
>>
>> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
>> ---
>> drivers/net/ethernet/ti/cpsw.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
>> index 70a9570..19aa4bb 100644
>> --- a/drivers/net/ethernet/ti/cpsw.c
>> +++ b/drivers/net/ethernet/ti/cpsw.c
>> @@ -498,8 +498,7 @@ static const struct cpsw_stats cpsw_gstrings_stats[] = {
>> (func)(slave++, ##arg); \
>> } while (0)
>> #define cpsw_get_slave_ndev(priv, __slave_no__) \
>> - ((__slave_no__ < priv->data.slaves) ? \
>> - priv->slaves[__slave_no__].ndev : NULL)
>> + priv->slaves[__slave_no__].ndev
>
> So after this change it will be
> #define cpsw_get_slave_ndev(priv, __slave_no__) priv->slaves[__slave_no__].ndev
>
> Can we just drop cpsw_get_slave_ndev() macro?
Sure. Will drop it in v3.
>
>> #define cpsw_get_slave_priv(priv, __slave_no__) \
>> (((__slave_no__ < priv->data.slaves) && \
>> (priv->slaves[__slave_no__].ndev)) ? \
>>
>
>
--
Regards,
Ivan Khoronzhuk
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web