linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer
@ 2013-09-09  5:06 Jingoo Han
  2013-09-09  5:07 ` [PATCH 2/7] serial: mpsc: " Jingoo Han
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Jingoo Han @ 2013-09-09  5:06 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'
  Cc: linux-serial, 'Vineet Gupta', 'Jingoo Han'

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/tty/serial/arc_uart.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
index 569872f..c9f5c9d 100644
--- a/drivers/tty/serial/arc_uart.c
+++ b/drivers/tty/serial/arc_uart.c
@@ -533,7 +533,7 @@ arc_uart_init_one(struct platform_device *pdev, int dev_id)
 	unsigned long *plat_data;
 	struct arc_uart_port *uart = &arc_uart_ports[dev_id];
 
-	plat_data = (unsigned long *)dev_get_platdata(&pdev->dev);
+	plat_data = dev_get_platdata(&pdev->dev);
 	if (!plat_data)
 		return -ENODEV;
 
-- 
1.7.10.4



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

* [PATCH 2/7] serial: mpsc: Remove casting the return value which is a void pointer
  2013-09-09  5:06 [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer Jingoo Han
@ 2013-09-09  5:07 ` Jingoo Han
  2013-09-09  5:08 ` [PATCH 3/7] serial: bfin_uart: " Jingoo Han
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2013-09-09  5:07 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'; +Cc: linux-serial, 'Jingoo Han'

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/tty/serial/mpsc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c
index 8d70267..e30a3ca 100644
--- a/drivers/tty/serial/mpsc.c
+++ b/drivers/tty/serial/mpsc.c
@@ -2030,7 +2030,7 @@ static void mpsc_drv_get_platform_data(struct mpsc_port_info *pi,
 {
 	struct mpsc_pdata	*pdata;
 
-	pdata = (struct mpsc_pdata *)dev_get_platdata(&pd->dev);
+	pdata = dev_get_platdata(&pd->dev);
 
 	pi->port.uartclk = pdata->brg_clk_freq;
 	pi->port.iotype = UPIO_MEM;
-- 
1.7.10.4



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

* [PATCH 3/7] serial: bfin_uart: Remove casting the return value which is a void pointer
  2013-09-09  5:06 [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer Jingoo Han
  2013-09-09  5:07 ` [PATCH 2/7] serial: mpsc: " Jingoo Han
@ 2013-09-09  5:08 ` Jingoo Han
  2013-09-09  7:27   ` Zhang, Sonic
  2013-09-09  5:09 ` [PATCH 4/7] serial: bfin_sport_uart: " Jingoo Han
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 9+ messages in thread
From: Jingoo Han @ 2013-09-09  5:08 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'
  Cc: linux-serial, 'Sonic Zhang', 'Jingoo Han'

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/tty/serial/bfin_uart.c |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index 3c75e8e..74749a6 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -1240,7 +1240,7 @@ static int bfin_serial_probe(struct platform_device *pdev)
 			 */
 #endif
 		ret = peripheral_request_list(
-			(unsigned short *)dev_get_platdata(&pdev->dev),
+			dev_get_platdata(&pdev->dev),
 			DRIVER_NAME);
 		if (ret) {
 			dev_err(&pdev->dev,
@@ -1358,8 +1358,7 @@ static int bfin_serial_probe(struct platform_device *pdev)
 out_error_unmap:
 		iounmap(uart->port.membase);
 out_error_free_peripherals:
-		peripheral_free_list(
-			(unsigned short *)dev_get_platdata(&pdev->dev));
+		peripheral_free_list(dev_get_platdata(&pdev->dev));
 out_error_free_mem:
 		kfree(uart);
 		bfin_serial_ports[pdev->id] = NULL;
@@ -1377,8 +1376,7 @@ static int bfin_serial_remove(struct platform_device *pdev)
 	if (uart) {
 		uart_remove_one_port(&bfin_serial_reg, &uart->port);
 		iounmap(uart->port.membase);
-		peripheral_free_list(
-			(unsigned short *)dev_get_platdata(&pdev->dev));
+		peripheral_free_list(dev_get_platdata(&pdev->dev));
 		kfree(uart);
 		bfin_serial_ports[pdev->id] = NULL;
 	}
@@ -1432,8 +1430,8 @@ static int bfin_earlyprintk_probe(struct platform_device *pdev)
 		return -ENOENT;
 	}
 
-	ret = peripheral_request_list(
-		(unsigned short *)dev_get_platdata(&pdev->dev), DRIVER_NAME);
+	ret = peripheral_request_list(dev_get_platdata(&pdev->dev),
+					DRIVER_NAME);
 	if (ret) {
 		dev_err(&pdev->dev,
 				"fail to request bfin serial peripherals\n");
@@ -1463,8 +1461,7 @@ static int bfin_earlyprintk_probe(struct platform_device *pdev)
 	return 0;
 
 out_error_free_peripherals:
-	peripheral_free_list(
-		(unsigned short *)dev_get_platdata(&pdev->dev));
+	peripheral_free_list(dev_get_platdata(&pdev->dev));
 
 	return ret;
 }
-- 
1.7.10.4



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

* [PATCH 4/7] serial: bfin_sport_uart: Remove casting the return value which is a void pointer
  2013-09-09  5:06 [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer Jingoo Han
  2013-09-09  5:07 ` [PATCH 2/7] serial: mpsc: " Jingoo Han
  2013-09-09  5:08 ` [PATCH 3/7] serial: bfin_uart: " Jingoo Han
@ 2013-09-09  5:09 ` Jingoo Han
  2013-09-09  5:09 ` [PATCH 5/7] serial: ifx6x60: " Jingoo Han
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2013-09-09  5:09 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'; +Cc: linux-serial, 'Jingoo Han'

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/tty/serial/bfin_sport_uart.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c
index 87636cc..4f22970 100644
--- a/drivers/tty/serial/bfin_sport_uart.c
+++ b/drivers/tty/serial/bfin_sport_uart.c
@@ -766,9 +766,8 @@ static int sport_uart_probe(struct platform_device *pdev)
 			return -ENOMEM;
 		}
 
-		ret = peripheral_request_list(
-			(unsigned short *)dev_get_platdata(&pdev->dev),
-			DRV_NAME);
+		ret = peripheral_request_list(dev_get_platdata(&pdev->dev),
+						DRV_NAME);
 		if (ret) {
 			dev_err(&pdev->dev,
 				"Fail to request SPORT peripherals\n");
@@ -844,8 +843,7 @@ static int sport_uart_probe(struct platform_device *pdev)
 out_error_unmap:
 		iounmap(sport->port.membase);
 out_error_free_peripherals:
-		peripheral_free_list(
-			(unsigned short *)dev_get_platdata(&pdev->dev));
+		peripheral_free_list(dev_get_platdata(&pdev->dev));
 out_error_free_mem:
 		kfree(sport);
 		bfin_sport_uart_ports[pdev->id] = NULL;
@@ -864,8 +862,7 @@ static int sport_uart_remove(struct platform_device *pdev)
 	if (sport) {
 		uart_remove_one_port(&sport_uart_reg, &sport->port);
 		iounmap(sport->port.membase);
-		peripheral_free_list(
-			(unsigned short *)dev_get_platdata(&pdev->dev));
+		peripheral_free_list(dev_get_platdata(&pdev->dev));
 		kfree(sport);
 		bfin_sport_uart_ports[pdev->id] = NULL;
 	}
-- 
1.7.10.4



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

* [PATCH 5/7] serial: ifx6x60: Remove casting the return value which is a void pointer
  2013-09-09  5:06 [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer Jingoo Han
                   ` (2 preceding siblings ...)
  2013-09-09  5:09 ` [PATCH 4/7] serial: bfin_sport_uart: " Jingoo Han
@ 2013-09-09  5:09 ` Jingoo Han
  2013-09-09  5:10 ` [PATCH 6/7] serial: samsung: " Jingoo Han
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2013-09-09  5:09 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'; +Cc: linux-serial, 'Jingoo Han'

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/tty/serial/ifx6x60.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index af286e6..5903909 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -1008,7 +1008,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
 		return -ENODEV;
 	}
 
-	pl_data = (struct ifx_modem_platform_data *)dev_get_platdata(&spi->dev);
+	pl_data = dev_get_platdata(&spi->dev);
 	if (!pl_data) {
 		dev_err(&spi->dev, "missing platform data!");
 		return -ENODEV;
-- 
1.7.10.4



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

* [PATCH 6/7] serial: samsung: Remove casting the return value which is a void pointer
  2013-09-09  5:06 [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer Jingoo Han
                   ` (3 preceding siblings ...)
  2013-09-09  5:09 ` [PATCH 5/7] serial: ifx6x60: " Jingoo Han
@ 2013-09-09  5:10 ` Jingoo Han
  2013-09-09  5:11 ` [PATCH 7/7] serial: mpc512x: " Jingoo Han
  2013-09-09  6:05 ` [PATCH 1/7] serial: arc_uart: " Vineet Gupta
  6 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2013-09-09  5:10 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'; +Cc: linux-serial, 'Jingoo Han'

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/tty/serial/samsung.c |    2 +-
 drivers/tty/serial/samsung.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index f3dfa19..81f3dba 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1254,7 +1254,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
 	ourport->baudclk = ERR_PTR(-EINVAL);
 	ourport->info = ourport->drv_data->info;
 	ourport->cfg = (dev_get_platdata(&pdev->dev)) ?
-			(struct s3c2410_uartcfg *)dev_get_platdata(&pdev->dev) :
+			dev_get_platdata(&pdev->dev) :
 			ourport->drv_data->def_cfg;
 
 	ourport->port.fifosize = (ourport->info->fifosize) ?
diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
index aaa617a..8827e54 100644
--- a/drivers/tty/serial/samsung.h
+++ b/drivers/tty/serial/samsung.h
@@ -63,7 +63,7 @@ struct s3c24xx_uart_port {
 
 /* conversion functions */
 
-#define s3c24xx_dev_to_port(__dev) (struct uart_port *)dev_get_drvdata(__dev)
+#define s3c24xx_dev_to_port(__dev) dev_get_drvdata(__dev)
 
 /* register access controls */
 
-- 
1.7.10.4



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

* [PATCH 7/7] serial: mpc512x: Remove casting the return value which is a void pointer
  2013-09-09  5:06 [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer Jingoo Han
                   ` (4 preceding siblings ...)
  2013-09-09  5:10 ` [PATCH 6/7] serial: samsung: " Jingoo Han
@ 2013-09-09  5:11 ` Jingoo Han
  2013-09-09  6:05 ` [PATCH 1/7] serial: arc_uart: " Vineet Gupta
  6 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2013-09-09  5:11 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'; +Cc: linux-serial, 'Jingoo Han'

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/tty/serial/mpc52xx_uart.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index 5be1df3..e05a3b1 100644
--- a/drivers/tty/serial/mpc52xx_uart.c
+++ b/drivers/tty/serial/mpc52xx_uart.c
@@ -1766,7 +1766,7 @@ mpc52xx_uart_of_remove(struct platform_device *op)
 static int
 mpc52xx_uart_of_suspend(struct platform_device *op, pm_message_t state)
 {
-	struct uart_port *port = (struct uart_port *) platform_get_drvdata(op);
+	struct uart_port *port = platform_get_drvdata(op);
 
 	if (port)
 		uart_suspend_port(&mpc52xx_uart_driver, port);
@@ -1777,7 +1777,7 @@ mpc52xx_uart_of_suspend(struct platform_device *op, pm_message_t state)
 static int
 mpc52xx_uart_of_resume(struct platform_device *op)
 {
-	struct uart_port *port = (struct uart_port *) platform_get_drvdata(op);
+	struct uart_port *port = platform_get_drvdata(op);
 
 	if (port)
 		uart_resume_port(&mpc52xx_uart_driver, port);
-- 
1.7.10.4



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

* Re: [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer
  2013-09-09  5:06 [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer Jingoo Han
                   ` (5 preceding siblings ...)
  2013-09-09  5:11 ` [PATCH 7/7] serial: mpc512x: " Jingoo Han
@ 2013-09-09  6:05 ` Vineet Gupta
  6 siblings, 0 replies; 9+ messages in thread
From: Vineet Gupta @ 2013-09-09  6:05 UTC (permalink / raw)
  To: Jingoo Han; +Cc: 'Greg Kroah-Hartman', linux-serial@vger.kernel.org

On 09/09/2013 10:36 AM, Jingoo Han wrote:
> Casting the return value which is a void pointer is redundant.
> The conversion from void pointer to any other pointer type is
> guaranteed by the C programming language.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
>

Acked-by: Vineet Gupta <vgupta@synopsys.com>

Thx for the cleanup.
-Vineet

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

* RE: [PATCH 3/7] serial: bfin_uart: Remove casting the return value which is a void pointer
  2013-09-09  5:08 ` [PATCH 3/7] serial: bfin_uart: " Jingoo Han
@ 2013-09-09  7:27   ` Zhang, Sonic
  0 siblings, 0 replies; 9+ messages in thread
From: Zhang, Sonic @ 2013-09-09  7:27 UTC (permalink / raw)
  To: Jingoo Han, 'Greg Kroah-Hartman'; +Cc: linux-serial@vger.kernel.org

Acked-by: Sonic Zhang<sonic.zhang@analog.com>

>-----Original Message-----
>From: Jingoo Han [mailto:jg1.han@samsung.com]
>Sent: Monday, September 09, 2013 1:09 PM
>To: 'Greg Kroah-Hartman'
>Cc: linux-serial@vger.kernel.org; Zhang, Sonic; 'Jingoo Han'
>Subject: [PATCH 3/7] serial: bfin_uart: Remove casting the return value which is a
>void pointer
>
>Casting the return value which is a void pointer is redundant.
>The conversion from void pointer to any other pointer type is guaranteed by the C
>programming language.
>
>Signed-off-by: Jingoo Han <jg1.han@samsung.com>
>---
> drivers/tty/serial/bfin_uart.c |   15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
>diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c index
>3c75e8e..74749a6 100644
>--- a/drivers/tty/serial/bfin_uart.c
>+++ b/drivers/tty/serial/bfin_uart.c
>@@ -1240,7 +1240,7 @@ static int bfin_serial_probe(struct platform_device *pdev)
>                        */
> #endif
>               ret = peripheral_request_list(
>-                      (unsigned short *)dev_get_platdata(&pdev->dev),
>+                      dev_get_platdata(&pdev->dev),
>                       DRIVER_NAME);
>               if (ret) {
>                       dev_err(&pdev->dev,
>@@ -1358,8 +1358,7 @@ static int bfin_serial_probe(struct platform_device *pdev)
> out_error_unmap:
>               iounmap(uart->port.membase);
> out_error_free_peripherals:
>-              peripheral_free_list(
>-                      (unsigned short *)dev_get_platdata(&pdev->dev));
>+              peripheral_free_list(dev_get_platdata(&pdev->dev));
> out_error_free_mem:
>               kfree(uart);
>               bfin_serial_ports[pdev->id] = NULL;
>@@ -1377,8 +1376,7 @@ static int bfin_serial_remove(struct platform_device *pdev)
>       if (uart) {
>               uart_remove_one_port(&bfin_serial_reg, &uart->port);
>               iounmap(uart->port.membase);
>-              peripheral_free_list(
>-                      (unsigned short *)dev_get_platdata(&pdev->dev));
>+              peripheral_free_list(dev_get_platdata(&pdev->dev));
>               kfree(uart);
>               bfin_serial_ports[pdev->id] = NULL;
>       }
>@@ -1432,8 +1430,8 @@ static int bfin_earlyprintk_probe(struct platform_device
>*pdev)
>               return -ENOENT;
>       }
>
>-      ret = peripheral_request_list(
>-              (unsigned short *)dev_get_platdata(&pdev->dev), DRIVER_NAME);
>+      ret = peripheral_request_list(dev_get_platdata(&pdev->dev),
>+                                      DRIVER_NAME);
>       if (ret) {
>               dev_err(&pdev->dev,
>                               "fail to request bfin serial peripherals\n"); @@ -1463,8
>+1461,7 @@ static int bfin_earlyprintk_probe(struct platform_device *pdev)
>       return 0;
>
> out_error_free_peripherals:
>-      peripheral_free_list(
>-              (unsigned short *)dev_get_platdata(&pdev->dev));
>+      peripheral_free_list(dev_get_platdata(&pdev->dev));
>
>       return ret;
> }
>--
>1.7.10.4
>
>



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

end of thread, other threads:[~2013-09-09  7:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09  5:06 [PATCH 1/7] serial: arc_uart: Remove casting the return value which is a void pointer Jingoo Han
2013-09-09  5:07 ` [PATCH 2/7] serial: mpsc: " Jingoo Han
2013-09-09  5:08 ` [PATCH 3/7] serial: bfin_uart: " Jingoo Han
2013-09-09  7:27   ` Zhang, Sonic
2013-09-09  5:09 ` [PATCH 4/7] serial: bfin_sport_uart: " Jingoo Han
2013-09-09  5:09 ` [PATCH 5/7] serial: ifx6x60: " Jingoo Han
2013-09-09  5:10 ` [PATCH 6/7] serial: samsung: " Jingoo Han
2013-09-09  5:11 ` [PATCH 7/7] serial: mpc512x: " Jingoo Han
2013-09-09  6:05 ` [PATCH 1/7] serial: arc_uart: " Vineet Gupta

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