All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@linux.vnet.ibm.com>
To: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Cc: Alan Cox <alan@linux.intel.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] jsm: remove remaining flip buffer code
Date: Thu, 25 Aug 2011 13:54:25 -0300	[thread overview]
Message-ID: <4E567E41.90605@linux.vnet.ibm.com> (raw)
In-Reply-To: <1314202043-12039-1-git-send-email-cascardo@linux.vnet.ibm.com>

Thanks Thadeu. The patches are fine. Please, update the driver version 
due these modifications.

On 08/24/2011 01:07 PM, Thadeu Lima de Souza Cascardo wrote:
> The flip buffer is not used anymore. Remove its allocation and
> declaration in the board structure.
>
> Signed-off-by: Thadeu Lima de Souza Cascardo<cascardo@linux.vnet.ibm.com>
> ---
>   drivers/tty/serial/jsm/jsm.h        |    3 ---
>   drivers/tty/serial/jsm/jsm_driver.c |   18 ------------------
>   2 files changed, 0 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/tty/serial/jsm/jsm.h b/drivers/tty/serial/jsm/jsm.h
> index b704c8c..cd53bdd 100644
> --- a/drivers/tty/serial/jsm/jsm.h
> +++ b/drivers/tty/serial/jsm/jsm.h
> @@ -88,7 +88,6 @@ enum {
>
>   /* 4 extra for alignment play space */
>   #define WRITEBUFLEN	((4096) + 4)
> -#define MYFLIPLEN	N_TTY_BUF_SIZE
>
>   #define JSM_VERSION	"jsm: 1.2-1-INKERNEL"
>   #define JSM_PARTNUM	"40002438_A-INKERNEL"
> @@ -150,7 +149,6 @@ struct jsm_board
>   	u32		bd_uart_offset;	/* Space between each UART */
>
>   	struct jsm_channel *channels[MAXPORTS]; /* array of pointers to our channels. */
> -	char		*flipbuf;	/* Our flip buffer, alloced if board is found */
>
>   	u32		bd_dividend;	/* Board/UARTs specific dividend */
>
> @@ -177,7 +175,6 @@ struct jsm_board
>   #define CH_TX_FIFO_LWM	0x0800		/* TX Fifo is below Low Water	*/
>   #define CH_BREAK_SENDING 0x1000		/* Break is being sent		*/
>   #define CH_LOOPBACK 0x2000		/* Channel is in lookback mode	*/
> -#define CH_FLIPBUF_IN_USE 0x4000	/* Channel's flipbuf is in use	*/
>   #define CH_BAUD0	0x08000		/* Used for checking B0 transitions */
>
>   /* Our Read/Error/Write queue sizes */
> diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c
> index 96da178..1cc8cf6 100644
> --- a/drivers/tty/serial/jsm/jsm_driver.c
> +++ b/drivers/tty/serial/jsm/jsm_driver.c
> @@ -160,27 +160,10 @@ static int __devinit jsm_probe_one(struct pci_dev *pdev, const struct pci_device
>   	dev_info(&pdev->dev, "board %d: Digi Neo (rev %d), irq %d\n",
>   			adapter_count, brd->rev, brd->irq);
>
> -	/*
> -	 * allocate flip buffer for board.
> -	 *
> -	 * Okay to malloc with GFP_KERNEL, we are not at interrupt
> -	 * context, and there are no locks held.
> -	 */
> -	brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
> -	if (!brd->flipbuf) {
> -		/* XXX: leaking all resources from jsm_tty_init and
> -		 	jsm_uart_port_init here! */
> -		dev_err(&pdev->dev, "memory allocation for flipbuf failed\n");
> -		rc = -ENOMEM;
> -		goto out_free_uart;
> -	}
> -
>   	pci_set_drvdata(pdev, brd);
>   	pci_save_state(pdev);
>
>   	return 0;
> - out_free_uart:
> -	jsm_remove_uart_port(brd);
>    out_free_irq:
>   	jsm_remove_uart_port(brd);
>   	free_irq(brd->irq, brd);
> @@ -218,7 +201,6 @@ static void __devexit jsm_remove_one(struct pci_dev *pdev)
>
>   	pci_release_regions(pdev);
>   	pci_disable_device(pdev);
> -	kfree(brd->flipbuf);
>   	kfree(brd);
>   }
>


-- 
Breno Leitão
Advisory Software Engineer
Linux Technology Center
Phone: +55 16 8115-3915
E-Mail: brenohl@br.ibm.com

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Breno Leitao <leitao@linux.vnet.ibm.com>
To: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Cc: Alan Cox <alan@linux.intel.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] jsm: remove remaining flip buffer code
Date: Thu, 25 Aug 2011 13:54:25 -0300	[thread overview]
Message-ID: <4E567E41.90605@linux.vnet.ibm.com> (raw)
In-Reply-To: <1314202043-12039-1-git-send-email-cascardo@linux.vnet.ibm.com>

Thanks Thadeu. The patches are fine. Please, update the driver version 
due these modifications.

On 08/24/2011 01:07 PM, Thadeu Lima de Souza Cascardo wrote:
> The flip buffer is not used anymore. Remove its allocation and
> declaration in the board structure.
>
> Signed-off-by: Thadeu Lima de Souza Cascardo<cascardo@linux.vnet.ibm.com>
> ---
>   drivers/tty/serial/jsm/jsm.h        |    3 ---
>   drivers/tty/serial/jsm/jsm_driver.c |   18 ------------------
>   2 files changed, 0 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/tty/serial/jsm/jsm.h b/drivers/tty/serial/jsm/jsm.h
> index b704c8c..cd53bdd 100644
> --- a/drivers/tty/serial/jsm/jsm.h
> +++ b/drivers/tty/serial/jsm/jsm.h
> @@ -88,7 +88,6 @@ enum {
>
>   /* 4 extra for alignment play space */
>   #define WRITEBUFLEN	((4096) + 4)
> -#define MYFLIPLEN	N_TTY_BUF_SIZE
>
>   #define JSM_VERSION	"jsm: 1.2-1-INKERNEL"
>   #define JSM_PARTNUM	"40002438_A-INKERNEL"
> @@ -150,7 +149,6 @@ struct jsm_board
>   	u32		bd_uart_offset;	/* Space between each UART */
>
>   	struct jsm_channel *channels[MAXPORTS]; /* array of pointers to our channels. */
> -	char		*flipbuf;	/* Our flip buffer, alloced if board is found */
>
>   	u32		bd_dividend;	/* Board/UARTs specific dividend */
>
> @@ -177,7 +175,6 @@ struct jsm_board
>   #define CH_TX_FIFO_LWM	0x0800		/* TX Fifo is below Low Water	*/
>   #define CH_BREAK_SENDING 0x1000		/* Break is being sent		*/
>   #define CH_LOOPBACK 0x2000		/* Channel is in lookback mode	*/
> -#define CH_FLIPBUF_IN_USE 0x4000	/* Channel's flipbuf is in use	*/
>   #define CH_BAUD0	0x08000		/* Used for checking B0 transitions */
>
>   /* Our Read/Error/Write queue sizes */
> diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c
> index 96da178..1cc8cf6 100644
> --- a/drivers/tty/serial/jsm/jsm_driver.c
> +++ b/drivers/tty/serial/jsm/jsm_driver.c
> @@ -160,27 +160,10 @@ static int __devinit jsm_probe_one(struct pci_dev *pdev, const struct pci_device
>   	dev_info(&pdev->dev, "board %d: Digi Neo (rev %d), irq %d\n",
>   			adapter_count, brd->rev, brd->irq);
>
> -	/*
> -	 * allocate flip buffer for board.
> -	 *
> -	 * Okay to malloc with GFP_KERNEL, we are not at interrupt
> -	 * context, and there are no locks held.
> -	 */
> -	brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
> -	if (!brd->flipbuf) {
> -		/* XXX: leaking all resources from jsm_tty_init and
> -		 	jsm_uart_port_init here! */
> -		dev_err(&pdev->dev, "memory allocation for flipbuf failed\n");
> -		rc = -ENOMEM;
> -		goto out_free_uart;
> -	}
> -
>   	pci_set_drvdata(pdev, brd);
>   	pci_save_state(pdev);
>
>   	return 0;
> - out_free_uart:
> -	jsm_remove_uart_port(brd);
>    out_free_irq:
>   	jsm_remove_uart_port(brd);
>   	free_irq(brd->irq, brd);
> @@ -218,7 +201,6 @@ static void __devexit jsm_remove_one(struct pci_dev *pdev)
>
>   	pci_release_regions(pdev);
>   	pci_disable_device(pdev);
> -	kfree(brd->flipbuf);
>   	kfree(brd);
>   }
>


-- 
Breno Leitão
Advisory Software Engineer
Linux Technology Center
Phone: +55 16 8115-3915
E-Mail: brenohl@br.ibm.com


       reply	other threads:[~2011-08-25 16:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1314202043-12039-1-git-send-email-cascardo@linux.vnet.ibm.com>
2011-08-25 16:54 ` Breno Leitao [this message]
2011-08-25 16:54   ` [PATCH 1/3] jsm: remove remaining flip buffer code Breno Leitao
2011-08-24 16:14 Thadeu Lima de Souza Cascardo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E567E41.90605@linux.vnet.ibm.com \
    --to=leitao@linux.vnet.ibm.com \
    --cc=alan@linux.intel.com \
    --cc=cascardo@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.