netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xilinx:Remove unused variable num_frag in the function axienet_start_xmit
@ 2015-06-17 15:52 Nicholas Krause
  2015-06-17 16:07 ` Sören Brinkmann
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Krause @ 2015-06-17 15:52 UTC (permalink / raw)
  To: anirudh
  Cc: netdev, linux-kernel, michal.simek, soren.brinkmann, John.Linn,
	linux-arm-kernel

This removes the unused variable num_frag and the setting of it
to the number of fragments from the passed sk_buff pointer by
this function's caller due to this variable never being used
in this particular function and is not declared as  global so
setting it for global use in this file is pointless.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 28b7e7d..624dce4 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -651,7 +651,6 @@ static inline int axienet_check_tx_bd_space(struct axienet_local *lp,
 static int axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
 	u32 ii;
-	u32 num_frag;
 	u32 csum_start_off;
 	u32 csum_index_off;
 	skb_frag_t *frag;
@@ -659,7 +658,6 @@ static int axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 	struct axienet_local *lp = netdev_priv(ndev);
 	struct axidma_bd *cur_p;
 
-	num_frag = skb_shinfo(skb)->nr_frags;
 	cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
 
 	if (axienet_check_tx_bd_space(lp, num_frag)) {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] xilinx:Remove unused variable num_frag in the function axienet_start_xmit
  2015-06-17 15:52 [PATCH] xilinx:Remove unused variable num_frag in the function axienet_start_xmit Nicholas Krause
@ 2015-06-17 16:07 ` Sören Brinkmann
  2015-06-17 16:21   ` Nicholas Krause
  0 siblings, 1 reply; 5+ messages in thread
From: Sören Brinkmann @ 2015-06-17 16:07 UTC (permalink / raw)
  To: Nicholas Krause
  Cc: anirudh, John.Linn, michal.simek, netdev, linux-arm-kernel,
	linux-kernel

On Wed, 2015-06-17 at 11:52AM -0400, Nicholas Krause wrote:
> This removes the unused variable num_frag and the setting of it
> to the number of fragments from the passed sk_buff pointer by
> this function's caller due to this variable never being used
> in this particular function and is not declared as  global so
> setting it for global use in this file is pointless.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 28b7e7d..624dce4 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -651,7 +651,6 @@ static inline int axienet_check_tx_bd_space(struct axienet_local *lp,
>  static int axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>  {
>  	u32 ii;
> -	u32 num_frag;
>  	u32 csum_start_off;
>  	u32 csum_index_off;
>  	skb_frag_t *frag;
> @@ -659,7 +658,6 @@ static int axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>  	struct axienet_local *lp = netdev_priv(ndev);
>  	struct axidma_bd *cur_p;
>  
> -	num_frag = skb_shinfo(skb)->nr_frags;
>  	cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
>  
>  	if (axienet_check_tx_bd_space(lp, num_frag)) {

It's used right here, isn't it (and further down in this function too)?
Does your tree compile with this change?

	Sören

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xilinx:Remove unused variable num_frag in the function axienet_start_xmit
  2015-06-17 16:07 ` Sören Brinkmann
@ 2015-06-17 16:21   ` Nicholas Krause
  2015-06-17 18:58     ` Sören Brinkmann
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Krause @ 2015-06-17 16:21 UTC (permalink / raw)
  To: Sören Brinkmann
  Cc: netdev, linux-kernel, michal.simek, anirudh, John.Linn,
	linux-arm-kernel



On June 17, 2015 12:07:30 PM EDT, "Sören Brinkmann" <soren.brinkmann@xilinx.com> wrote:
>On Wed, 2015-06-17 at 11:52AM -0400, Nicholas Krause wrote:
>> This removes the unused variable num_frag and the setting of it
>> to the number of fragments from the passed sk_buff pointer by
>> this function's caller due to this variable never being used
>> in this particular function and is not declared as  global so
>> setting it for global use in this file is pointless.
>> 
>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>> ---
>>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 --
>>  1 file changed, 2 deletions(-)
>> 
>> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>> index 28b7e7d..624dce4 100644
>> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>> @@ -651,7 +651,6 @@ static inline int
>axienet_check_tx_bd_space(struct axienet_local *lp,
>>  static int axienet_start_xmit(struct sk_buff *skb, struct net_device
>*ndev)
>>  {
>>  	u32 ii;
>> -	u32 num_frag;
>>  	u32 csum_start_off;
>>  	u32 csum_index_off;
>>  	skb_frag_t *frag;
>> @@ -659,7 +658,6 @@ static int axienet_start_xmit(struct sk_buff
>*skb, struct net_device *ndev)
>>  	struct axienet_local *lp = netdev_priv(ndev);
>>  	struct axidma_bd *cur_p;
>>  
>> -	num_frag = skb_shinfo(skb)->nr_frags;
>>  	cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
>>  
>>  	if (axienet_check_tx_bd_space(lp, num_frag)) {
>
>It's used right here, isn't it (and further down in this function too)?
>Does your tree compile with this change?
>
>	Sören
My tree does compile with this change. 
Nick 

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xilinx:Remove unused variable num_frag in the function axienet_start_xmit
  2015-06-17 16:21   ` Nicholas Krause
@ 2015-06-17 18:58     ` Sören Brinkmann
  2015-06-18  3:10       ` nick
  0 siblings, 1 reply; 5+ messages in thread
From: Sören Brinkmann @ 2015-06-17 18:58 UTC (permalink / raw)
  To: Nicholas Krause
  Cc: anirudh, John.Linn, michal.simek, netdev, linux-arm-kernel,
	linux-kernel

On Wed, 2015-06-17 at 12:21PM -0400, Nicholas Krause wrote:
> 
> 
> On June 17, 2015 12:07:30 PM EDT, "Sören Brinkmann" <soren.brinkmann@xilinx.com> wrote:
> >On Wed, 2015-06-17 at 11:52AM -0400, Nicholas Krause wrote:
> >> This removes the unused variable num_frag and the setting of it
> >> to the number of fragments from the passed sk_buff pointer by
> >> this function's caller due to this variable never being used
> >> in this particular function and is not declared as  global so
> >> setting it for global use in this file is pointless.
> >> 
> >> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> >> ---
> >>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 --
> >>  1 file changed, 2 deletions(-)
> >> 
> >> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> >b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> >> index 28b7e7d..624dce4 100644
> >> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> >> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> >> @@ -651,7 +651,6 @@ static inline int
> >axienet_check_tx_bd_space(struct axienet_local *lp,
> >>  static int axienet_start_xmit(struct sk_buff *skb, struct net_device
> >*ndev)
> >>  {
> >>  	u32 ii;
> >> -	u32 num_frag;
> >>  	u32 csum_start_off;
> >>  	u32 csum_index_off;
> >>  	skb_frag_t *frag;
> >> @@ -659,7 +658,6 @@ static int axienet_start_xmit(struct sk_buff
> >*skb, struct net_device *ndev)
> >>  	struct axienet_local *lp = netdev_priv(ndev);
> >>  	struct axidma_bd *cur_p;
> >>  
> >> -	num_frag = skb_shinfo(skb)->nr_frags;
> >>  	cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
> >>  
> >>  	if (axienet_check_tx_bd_space(lp, num_frag)) {
> >
> >It's used right here, isn't it (and further down in this function too)?
> >Does your tree compile with this change?
> >
> >	Sören
> My tree does compile with this change. 

You have to fix your testing process:
    CHK     include/config/kernel.release
    UPD     include/config/kernel.release
    CHK     include/generated/uapi/linux/version.h
    CHK     include/generated/utsrelease.h
    UPD     include/generated/utsrelease.h
    CHK     include/generated/bounds.h
    CHK     include/generated/timeconst.h
    CHK     include/generated/asm-offsets.h
    CALL    scripts/checksyscalls.sh
  <stdin>:1253:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
    CC      drivers/net/ethernet/xilinx/xilinx_axienet_main.o
  drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_start_xmit':
  drivers/net/ethernet/xilinx/xilinx_axienet_main.c:667:36: error: 'num_frag' undeclared (first use in this function)
    if (axienet_check_tx_bd_space(lp, num_frag)) {
                                      ^
  drivers/net/ethernet/xilinx/xilinx_axienet_main.c:667:36: note: each undeclared identifier is reported only once for each function it appears in
  scripts/Makefile.build:258: recipe for target 'drivers/net/ethernet/xilinx/xilinx_axienet_main.o' failed
  make[1]: *** [drivers/net/ethernet/xilinx/xilinx_axienet_main.o] Error 1
  Makefile:1545: recipe for target 'drivers/net/ethernet/xilinx/xilinx_axienet_main.o' failed
  make: *** [drivers/net/ethernet/xilinx/xilinx_axienet_main.o] Error 2

NACK for the patch.

	Sören

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xilinx:Remove unused variable num_frag in the function axienet_start_xmit
  2015-06-17 18:58     ` Sören Brinkmann
@ 2015-06-18  3:10       ` nick
  0 siblings, 0 replies; 5+ messages in thread
From: nick @ 2015-06-18  3:10 UTC (permalink / raw)
  To: Sören Brinkmann
  Cc: netdev, linux-kernel, michal.simek, anirudh, John.Linn,
	linux-arm-kernel



On 2015-06-17 02:58 PM, Sören Brinkmann wrote:
> On Wed, 2015-06-17 at 12:21PM -0400, Nicholas Krause wrote:
>>
>>
>> On June 17, 2015 12:07:30 PM EDT, "Sören Brinkmann" <soren.brinkmann@xilinx.com> wrote:
>>> On Wed, 2015-06-17 at 11:52AM -0400, Nicholas Krause wrote:
>>>> This removes the unused variable num_frag and the setting of it
>>>> to the number of fragments from the passed sk_buff pointer by
>>>> this function's caller due to this variable never being used
>>>> in this particular function and is not declared as  global so
>>>> setting it for global use in this file is pointless.
>>>>
>>>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>>>> ---
>>>>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 --
>>>>  1 file changed, 2 deletions(-)
>>>>
>>>> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>>> b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>>>> index 28b7e7d..624dce4 100644
>>>> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>>>> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
>>>> @@ -651,7 +651,6 @@ static inline int
>>> axienet_check_tx_bd_space(struct axienet_local *lp,
>>>>  static int axienet_start_xmit(struct sk_buff *skb, struct net_device
>>> *ndev)
>>>>  {
>>>>  	u32 ii;
>>>> -	u32 num_frag;
>>>>  	u32 csum_start_off;
>>>>  	u32 csum_index_off;
>>>>  	skb_frag_t *frag;
>>>> @@ -659,7 +658,6 @@ static int axienet_start_xmit(struct sk_buff
>>> *skb, struct net_device *ndev)
>>>>  	struct axienet_local *lp = netdev_priv(ndev);
>>>>  	struct axidma_bd *cur_p;
>>>>  
>>>> -	num_frag = skb_shinfo(skb)->nr_frags;
>>>>  	cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
>>>>  
>>>>  	if (axienet_check_tx_bd_space(lp, num_frag)) {
>>>
>>> It's used right here, isn't it (and further down in this function too)?
>>> Does your tree compile with this change?
>>>
>>> 	Sören
>> My tree does compile with this change. 
> 
> You have to fix your testing process:
>     CHK     include/config/kernel.release
>     UPD     include/config/kernel.release
>     CHK     include/generated/uapi/linux/version.h
>     CHK     include/generated/utsrelease.h
>     UPD     include/generated/utsrelease.h
>     CHK     include/generated/bounds.h
>     CHK     include/generated/timeconst.h
>     CHK     include/generated/asm-offsets.h
>     CALL    scripts/checksyscalls.sh
>   <stdin>:1253:2: warning: #warning syscall userfaultfd not implemented [-Wcpp]
>     CC      drivers/net/ethernet/xilinx/xilinx_axienet_main.o
>   drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_start_xmit':
>   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:667:36: error: 'num_frag' undeclared (first use in this function)
>     if (axienet_check_tx_bd_space(lp, num_frag)) {
>                                       ^
>   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:667:36: note: each undeclared identifier is reported only once for each function it appears in
>   scripts/Makefile.build:258: recipe for target 'drivers/net/ethernet/xilinx/xilinx_axienet_main.o' failed
>   make[1]: *** [drivers/net/ethernet/xilinx/xilinx_axienet_main.o] Error 1
>   Makefile:1545: recipe for target 'drivers/net/ethernet/xilinx/xilinx_axienet_main.o' failed
>   make: *** [drivers/net/ethernet/xilinx/xilinx_axienet_main.o] Error 2
> 
> NACK for the patch.
> 
> 	Sören
> 
Sorry about that as I tried again and it didn't build. Weird issue maybe something with ccache.
Nick

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-18  3:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-17 15:52 [PATCH] xilinx:Remove unused variable num_frag in the function axienet_start_xmit Nicholas Krause
2015-06-17 16:07 ` Sören Brinkmann
2015-06-17 16:21   ` Nicholas Krause
2015-06-17 18:58     ` Sören Brinkmann
2015-06-18  3:10       ` nick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).