netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slip: sl_alloc(): remove unused parameter "dev_t line"
@ 2017-12-08 11:18 Marc Kleine-Budde
  2017-12-08 11:22 ` Marc Kleine-Budde
  2017-12-08 19:43 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2017-12-08 11:18 UTC (permalink / raw)
  To: netdev; +Cc: kernel, David Miller, Marc Kleine-Budde

The first and only parameter of sl_alloc() is unused, so remove it.

Fixes: 5342b77c4123 slip: ("Clean up create and destroy")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/slip/slip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index cc63102ca96e..8940417c30e5 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -731,7 +731,7 @@ static void sl_sync(void)
 
 
 /* Find a free SLIP channel, and link in this `tty' line. */
-static struct slip *sl_alloc(dev_t line)
+static struct slip *sl_alloc(void)
 {
 	int i;
 	char name[IFNAMSIZ];
@@ -809,7 +809,7 @@ static int slip_open(struct tty_struct *tty)
 
 	/* OK.  Find a free SLIP channel to use. */
 	err = -ENFILE;
-	sl = sl_alloc(tty_devnum(tty));
+	sl = sl_alloc();
 	if (sl == NULL)
 		goto err_exit;
 
-- 
2.15.0

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

* Re: [PATCH] slip: sl_alloc(): remove unused parameter "dev_t line"
  2017-12-08 11:18 [PATCH] slip: sl_alloc(): remove unused parameter "dev_t line" Marc Kleine-Budde
@ 2017-12-08 11:22 ` Marc Kleine-Budde
  2017-12-09 17:28   ` Oliver Hartkopp
  2017-12-08 19:43 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2017-12-08 11:22 UTC (permalink / raw)
  To: netdev; +Cc: kernel, linux-can, Oliver Hartkopp


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

Hello Oliver,

I've the corresponding slcan patch already in my queue.

Marc

On 12/08/2017 12:18 PM, Marc Kleine-Budde wrote:
> The first and only parameter of sl_alloc() is unused, so remove it.
> 
> Fixes: 5342b77c4123 slip: ("Clean up create and destroy")
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>  drivers/net/slip/slip.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
> index cc63102ca96e..8940417c30e5 100644
> --- a/drivers/net/slip/slip.c
> +++ b/drivers/net/slip/slip.c
> @@ -731,7 +731,7 @@ static void sl_sync(void)
>  
>  
>  /* Find a free SLIP channel, and link in this `tty' line. */
> -static struct slip *sl_alloc(dev_t line)
> +static struct slip *sl_alloc(void)
>  {
>  	int i;
>  	char name[IFNAMSIZ];
> @@ -809,7 +809,7 @@ static int slip_open(struct tty_struct *tty)
>  
>  	/* OK.  Find a free SLIP channel to use. */
>  	err = -ENFILE;
> -	sl = sl_alloc(tty_devnum(tty));
> +	sl = sl_alloc();
>  	if (sl == NULL)
>  		goto err_exit;
>  
> 


-- 
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] 4+ messages in thread

* Re: [PATCH] slip: sl_alloc(): remove unused parameter "dev_t line"
  2017-12-08 11:18 [PATCH] slip: sl_alloc(): remove unused parameter "dev_t line" Marc Kleine-Budde
  2017-12-08 11:22 ` Marc Kleine-Budde
@ 2017-12-08 19:43 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2017-12-08 19:43 UTC (permalink / raw)
  To: mkl; +Cc: netdev, kernel

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri,  8 Dec 2017 12:18:59 +0100

> The first and only parameter of sl_alloc() is unused, so remove it.
> 
> Fixes: 5342b77c4123 slip: ("Clean up create and destroy")
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Applied.

While reviewing this I noticed that slip_devs[], along with the
arbitrary slip_maxdev limit, can be removed and replaced with
a simply linked list.

All the array is used for it proper teardown during module unload.
This is made even more clear by the fact that the index stored
in dev->base_addr is never ever used.

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

* Re: [PATCH] slip: sl_alloc(): remove unused parameter "dev_t line"
  2017-12-08 11:22 ` Marc Kleine-Budde
@ 2017-12-09 17:28   ` Oliver Hartkopp
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Hartkopp @ 2017-12-09 17:28 UTC (permalink / raw)
  To: Marc Kleine-Budde, netdev; +Cc: kernel, linux-can



On 12/08/2017 12:22 PM, Marc Kleine-Budde wrote:
> Hello Oliver,
> 
> I've the corresponding slcan patch already in my queue.

Excellent :-)

Thanks,
Oliver

> 
> Marc
> 
> On 12/08/2017 12:18 PM, Marc Kleine-Budde wrote:
>> The first and only parameter of sl_alloc() is unused, so remove it.
>>
>> Fixes: 5342b77c4123 slip: ("Clean up create and destroy")
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> ---
>>   drivers/net/slip/slip.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
>> index cc63102ca96e..8940417c30e5 100644
>> --- a/drivers/net/slip/slip.c
>> +++ b/drivers/net/slip/slip.c
>> @@ -731,7 +731,7 @@ static void sl_sync(void)
>>   
>>   
>>   /* Find a free SLIP channel, and link in this `tty' line. */
>> -static struct slip *sl_alloc(dev_t line)
>> +static struct slip *sl_alloc(void)
>>   {
>>   	int i;
>>   	char name[IFNAMSIZ];
>> @@ -809,7 +809,7 @@ static int slip_open(struct tty_struct *tty)
>>   
>>   	/* OK.  Find a free SLIP channel to use. */
>>   	err = -ENFILE;
>> -	sl = sl_alloc(tty_devnum(tty));
>> +	sl = sl_alloc();
>>   	if (sl == NULL)
>>   		goto err_exit;
>>   
>>
> 
> 

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

end of thread, other threads:[~2017-12-09 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 11:18 [PATCH] slip: sl_alloc(): remove unused parameter "dev_t line" Marc Kleine-Budde
2017-12-08 11:22 ` Marc Kleine-Budde
2017-12-09 17:28   ` Oliver Hartkopp
2017-12-08 19:43 ` David Miller

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