LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/3] can: fix ndo_start_xmit()'s return type
@ 2018-04-26 21:13 Luc Van Oostenryck
  2018-04-26 21:13 ` [PATCH 1/3] can: janz-ican3: fix ican3_xmit()'s " Luc Van Oostenryck
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Luc Van Oostenryck @ 2018-04-26 21:13 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Luc Van Oostenryck, Wolfgang Grandegger, Maxime Ripard,
	Chen-Yu Tsai, Michal Simek, open list:CAN NETWORK DRIVERS,
	open list:NETWORKING DRIVERS, open list,
	moderated list:ARM/Allwinner sunXi SoC support

ndo_start_xmit() is defined as returing an 'netdev_tx_t'.
However, several can drivers use 'int' as the return type
of their start_xmit() method.
This series contains the fix for all three of them.

Luc Van Oostenryck (3):
  can: janz-ican3: fix ican3_xmit()'s return type
  can: sun4i: fix sun4ican_start_xmit()'s return type
  can: xilinx: fix xcan_start_xmit()'s return type

 drivers/net/can/janz-ican3.c | 2 +-
 drivers/net/can/sun4i_can.c  | 2 +-
 drivers/net/can/xilinx_can.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.17.0

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

* [PATCH 1/3] can: janz-ican3: fix ican3_xmit()'s return type
  2018-04-26 21:13 [PATCH 0/3] can: fix ndo_start_xmit()'s return type Luc Van Oostenryck
@ 2018-04-26 21:13 ` Luc Van Oostenryck
  2018-04-26 21:13 ` [PATCH 2/3] can: sun4i: fix sun4ican_start_xmit()'s " Luc Van Oostenryck
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Luc Van Oostenryck @ 2018-04-26 21:13 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Luc Van Oostenryck, Wolfgang Grandegger, Maxime Ripard,
	Chen-Yu Tsai, Michal Simek, open list:CAN NETWORK DRIVERS,
	open list:NETWORKING DRIVERS, open list,
	moderated list:ARM/Allwinner sunXi SoC support

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 drivers/net/can/janz-ican3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index adfdb66a4..02042cb09 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1684,7 +1684,7 @@ static int ican3_stop(struct net_device *ndev)
 	return 0;
 }
 
-static int ican3_xmit(struct sk_buff *skb, struct net_device *ndev)
+static netdev_tx_t ican3_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
 	struct ican3_dev *mod = netdev_priv(ndev);
 	struct can_frame *cf = (struct can_frame *)skb->data;
-- 
2.17.0

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

* [PATCH 2/3] can: sun4i: fix sun4ican_start_xmit()'s return type
  2018-04-26 21:13 [PATCH 0/3] can: fix ndo_start_xmit()'s return type Luc Van Oostenryck
  2018-04-26 21:13 ` [PATCH 1/3] can: janz-ican3: fix ican3_xmit()'s " Luc Van Oostenryck
@ 2018-04-26 21:13 ` Luc Van Oostenryck
  2018-04-26 21:13 ` [PATCH 3/3] can: xilinx: fix xcan_start_xmit()'s " Luc Van Oostenryck
  2018-04-27  7:21 ` [PATCH 0/3] can: fix ndo_start_xmit()'s " Marc Kleine-Budde
  3 siblings, 0 replies; 8+ messages in thread
From: Luc Van Oostenryck @ 2018-04-26 21:13 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Luc Van Oostenryck, Wolfgang Grandegger, Maxime Ripard,
	Chen-Yu Tsai, Michal Simek, open list:CAN NETWORK DRIVERS,
	open list:NETWORKING DRIVERS, open list,
	moderated list:ARM/Allwinner sunXi SoC support

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 drivers/net/can/sun4i_can.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c
index 1ac2090a1..093fc9a52 100644
--- a/drivers/net/can/sun4i_can.c
+++ b/drivers/net/can/sun4i_can.c
@@ -409,7 +409,7 @@ static int sun4ican_set_mode(struct net_device *dev, enum can_mode mode)
  * xx xx xx xx         ff         ll 00 11 22 33 44 55 66 77
  * [ can_id ] [flags] [len] [can data (up to 8 bytes]
  */
-static int sun4ican_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t sun4ican_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct sun4ican_priv *priv = netdev_priv(dev);
 	struct can_frame *cf = (struct can_frame *)skb->data;
-- 
2.17.0

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

* [PATCH 3/3] can: xilinx: fix xcan_start_xmit()'s return type
  2018-04-26 21:13 [PATCH 0/3] can: fix ndo_start_xmit()'s return type Luc Van Oostenryck
  2018-04-26 21:13 ` [PATCH 1/3] can: janz-ican3: fix ican3_xmit()'s " Luc Van Oostenryck
  2018-04-26 21:13 ` [PATCH 2/3] can: sun4i: fix sun4ican_start_xmit()'s " Luc Van Oostenryck
@ 2018-04-26 21:13 ` Luc Van Oostenryck
  2018-04-27  7:49   ` Michal Simek
  2018-04-27  7:21 ` [PATCH 0/3] can: fix ndo_start_xmit()'s " Marc Kleine-Budde
  3 siblings, 1 reply; 8+ messages in thread
From: Luc Van Oostenryck @ 2018-04-26 21:13 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Luc Van Oostenryck, Wolfgang Grandegger, Maxime Ripard,
	Chen-Yu Tsai, Michal Simek, open list:CAN NETWORK DRIVERS,
	open list:NETWORKING DRIVERS, open list,
	moderated list:ARM/Allwinner sunXi SoC support

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 drivers/net/can/xilinx_can.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 89aec07c2..a19648606 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -386,7 +386,7 @@ static int xcan_do_set_mode(struct net_device *ndev, enum can_mode mode)
  *
  * Return: 0 on success and failure value on error
  */
-static int xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+static netdev_tx_t xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
 	struct xcan_priv *priv = netdev_priv(ndev);
 	struct net_device_stats *stats = &ndev->stats;
-- 
2.17.0

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

* Re: [PATCH 0/3] can: fix ndo_start_xmit()'s return type
  2018-04-26 21:13 [PATCH 0/3] can: fix ndo_start_xmit()'s return type Luc Van Oostenryck
                   ` (2 preceding siblings ...)
  2018-04-26 21:13 ` [PATCH 3/3] can: xilinx: fix xcan_start_xmit()'s " Luc Van Oostenryck
@ 2018-04-27  7:21 ` Marc Kleine-Budde
  3 siblings, 0 replies; 8+ messages in thread
From: Marc Kleine-Budde @ 2018-04-27  7:21 UTC (permalink / raw)
  To: Luc Van Oostenryck
  Cc: Wolfgang Grandegger, Maxime Ripard, Chen-Yu Tsai, Michal Simek,
	open list:CAN NETWORK DRIVERS, open list:NETWORKING DRIVERS,
	open list, moderated list:ARM/Allwinner sunXi SoC support


[-- Attachment #1.1: Type: text/plain, Size: 1004 bytes --]

On 04/26/2018 11:13 PM, Luc Van Oostenryck wrote:
> ndo_start_xmit() is defined as returing an 'netdev_tx_t'.
> However, several can drivers use 'int' as the return type
> of their start_xmit() method.
> This series contains the fix for all three of them.
> 
> Luc Van Oostenryck (3):
>   can: janz-ican3: fix ican3_xmit()'s return type
>   can: sun4i: fix sun4ican_start_xmit()'s return type
>   can: xilinx: fix xcan_start_xmit()'s return type
> 
>  drivers/net/can/janz-ican3.c | 2 +-
>  drivers/net/can/sun4i_can.c  | 2 +-
>  drivers/net/can/xilinx_can.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)

Applied all 3 to linux-can-next, added similar patch for the flexcan driver.

Tnx,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 3/3] can: xilinx: fix xcan_start_xmit()'s return type
  2018-04-26 21:13 ` [PATCH 3/3] can: xilinx: fix xcan_start_xmit()'s " Luc Van Oostenryck
@ 2018-04-27  7:49   ` Michal Simek
  2018-04-27  7:55     ` Marc Kleine-Budde
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Simek @ 2018-04-27  7:49 UTC (permalink / raw)
  To: Luc Van Oostenryck, Marc Kleine-Budde
  Cc: Wolfgang Grandegger, Maxime Ripard, Chen-Yu Tsai, Michal Simek,
	open list:CAN NETWORK DRIVERS, open list:NETWORKING DRIVERS,
	open list, moderated list:ARM/Allwinner sunXi SoC support

On 26.4.2018 23:13, Luc Van Oostenryck wrote:
> The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
> which is a typedef for an enum type, but the implementation in this
> driver returns an 'int'.
> 
> Fix this by returning 'netdev_tx_t' in this driver too.
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
>  drivers/net/can/xilinx_can.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
> index 89aec07c2..a19648606 100644
> --- a/drivers/net/can/xilinx_can.c
> +++ b/drivers/net/can/xilinx_can.c
> @@ -386,7 +386,7 @@ static int xcan_do_set_mode(struct net_device *ndev, enum can_mode mode)
>   *
>   * Return: 0 on success and failure value on error
>   */
> -static int xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> +static netdev_tx_t xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>  {
>  	struct xcan_priv *priv = netdev_priv(ndev);
>  	struct net_device_stats *stats = &ndev->stats;
> 

It was applied already but there should be also kernel-doc update too to
use enum values instead of 0.

M

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

* Re: [PATCH 3/3] can: xilinx: fix xcan_start_xmit()'s return type
  2018-04-27  7:49   ` Michal Simek
@ 2018-04-27  7:55     ` Marc Kleine-Budde
  2018-04-27  8:03       ` Michal Simek
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Kleine-Budde @ 2018-04-27  7:55 UTC (permalink / raw)
  To: Michal Simek, Luc Van Oostenryck
  Cc: Wolfgang Grandegger, Maxime Ripard, Chen-Yu Tsai,
	open list:CAN NETWORK DRIVERS, open list:NETWORKING DRIVERS,
	open list, moderated list:ARM/Allwinner sunXi SoC support


[-- Attachment #1.1: Type: text/plain, Size: 2245 bytes --]

On 04/27/2018 09:49 AM, Michal Simek wrote:
> On 26.4.2018 23:13, Luc Van Oostenryck wrote:
>> The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
>> which is a typedef for an enum type, but the implementation in this
>> driver returns an 'int'.
>>
>> Fix this by returning 'netdev_tx_t' in this driver too.
>>
>> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
>> ---
>>  drivers/net/can/xilinx_can.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
>> index 89aec07c2..a19648606 100644
>> --- a/drivers/net/can/xilinx_can.c
>> +++ b/drivers/net/can/xilinx_can.c
>> @@ -386,7 +386,7 @@ static int xcan_do_set_mode(struct net_device *ndev, enum can_mode mode)
>>   *
>>   * Return: 0 on success and failure value on error
>>   */
>> -static int xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>> +static netdev_tx_t xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>>  {
>>  	struct xcan_priv *priv = netdev_priv(ndev);
>>  	struct net_device_stats *stats = &ndev->stats;
>>
> 
> It was applied already but there should be also kernel-doc update too to
> use enum values instead of 0.

Like this:

> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
> index f07ce4945356..d0ad1473f689 100644
> --- a/drivers/net/can/xilinx_can.c
> +++ b/drivers/net/can/xilinx_can.c
> @@ -398,7 +398,7 @@ static int xcan_do_set_mode(struct net_device *ndev, enum can_mode mode)
>   * function uses the next available free txbuff and populates their fields to
>   * start the transmission.
>   *
> - * Return: 0 on success and failure value on error
> + * Return: NETDEV_TX_OK on success and NETDEV_TX_BUSY when the tx queue is full
>   */
>  static netdev_tx_t xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>  {

I can squash in that change.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 3/3] can: xilinx: fix xcan_start_xmit()'s return type
  2018-04-27  7:55     ` Marc Kleine-Budde
@ 2018-04-27  8:03       ` Michal Simek
  0 siblings, 0 replies; 8+ messages in thread
From: Michal Simek @ 2018-04-27  8:03 UTC (permalink / raw)
  To: Marc Kleine-Budde, Michal Simek, Luc Van Oostenryck
  Cc: Wolfgang Grandegger, Maxime Ripard, Chen-Yu Tsai,
	open list:CAN NETWORK DRIVERS, open list:NETWORKING DRIVERS,
	open list, moderated list:ARM/Allwinner sunXi SoC support

On 27.4.2018 09:55, Marc Kleine-Budde wrote:
> On 04/27/2018 09:49 AM, Michal Simek wrote:
>> On 26.4.2018 23:13, Luc Van Oostenryck wrote:
>>> The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
>>> which is a typedef for an enum type, but the implementation in this
>>> driver returns an 'int'.
>>>
>>> Fix this by returning 'netdev_tx_t' in this driver too.
>>>
>>> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
>>> ---
>>>  drivers/net/can/xilinx_can.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
>>> index 89aec07c2..a19648606 100644
>>> --- a/drivers/net/can/xilinx_can.c
>>> +++ b/drivers/net/can/xilinx_can.c
>>> @@ -386,7 +386,7 @@ static int xcan_do_set_mode(struct net_device *ndev, enum can_mode mode)
>>>   *
>>>   * Return: 0 on success and failure value on error
>>>   */
>>> -static int xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>>> +static netdev_tx_t xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>>>  {
>>>  	struct xcan_priv *priv = netdev_priv(ndev);
>>>  	struct net_device_stats *stats = &ndev->stats;
>>>
>>
>> It was applied already but there should be also kernel-doc update too to
>> use enum values instead of 0.
> 
> Like this:
> 
>> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
>> index f07ce4945356..d0ad1473f689 100644
>> --- a/drivers/net/can/xilinx_can.c
>> +++ b/drivers/net/can/xilinx_can.c
>> @@ -398,7 +398,7 @@ static int xcan_do_set_mode(struct net_device *ndev, enum can_mode mode)
>>   * function uses the next available free txbuff and populates their fields to
>>   * start the transmission.
>>   *
>> - * Return: 0 on success and failure value on error
>> + * Return: NETDEV_TX_OK on success and NETDEV_TX_BUSY when the tx queue is full
>>   */
>>  static netdev_tx_t xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>>  {
> 
> I can squash in that change.

looks good to me.
Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

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

end of thread, other threads:[~2018-04-27  8:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 21:13 [PATCH 0/3] can: fix ndo_start_xmit()'s return type Luc Van Oostenryck
2018-04-26 21:13 ` [PATCH 1/3] can: janz-ican3: fix ican3_xmit()'s " Luc Van Oostenryck
2018-04-26 21:13 ` [PATCH 2/3] can: sun4i: fix sun4ican_start_xmit()'s " Luc Van Oostenryck
2018-04-26 21:13 ` [PATCH 3/3] can: xilinx: fix xcan_start_xmit()'s " Luc Van Oostenryck
2018-04-27  7:49   ` Michal Simek
2018-04-27  7:55     ` Marc Kleine-Budde
2018-04-27  8:03       ` Michal Simek
2018-04-27  7:21 ` [PATCH 0/3] can: fix ndo_start_xmit()'s " Marc Kleine-Budde

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).