lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1292483609-18492-1-git-send-email-tomoya-linux@dsn.okisemi.com>
Date:	Thu, 16 Dec 2010 16:13:29 +0900
From:	Tomoya MORINAGA <tomoya-linux@....okisemi.com>
To:	linux-kernel@...r.kernel.org, gregkh@...e.de
Cc:	qi.wang@...el.com, yong.y.wang@...el.com,
	andrew.chih.howe.khor@...el.com, joel.clark@...el.com,
	kok.howg.ewe@...el.com, margie.foster@...el.com,
	Tomoya MORINAGA <tomoya-linux@....okisemi.com>
Subject: [PATCH linux-next] pch_uart : fix warnings for 64bit compile

Fix the following warnings
drivers/serial/pch_uart.c: In function ‘dma_handle_rx’:
drivers/serial/pch_uart.c:685:24: warning: cast from pointer to integer of different size
drivers/serial/pch_uart.c: In function ‘dma_handle_tx’:
drivers/serial/pch_uart.c:778:23: warning: cast from pointer to integer of different size
drivers/serial/pch_uart.c: In function ‘pch_uart_init_port’:
drivers/serial/pch_uart.c:1289:20: warning: cast to pointer from integer of different size
drivers/serial/pch_uart.c: In function ‘pch_uart_exit_port’:
drivers/serial/pch_uart.c:1328:2: warning: cast from pointer to integer of different size

Signed-off-by: Tomoya MORINAGA <tomoya-linux@....okisemi.com>
Reported-by: Greg Kroah-Hartman <gregkh@...e.de>
---
 drivers/serial/pch_uart.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/serial/pch_uart.c b/drivers/serial/pch_uart.c
index b94d1fa..70a6145 100644
--- a/drivers/serial/pch_uart.c
+++ b/drivers/serial/pch_uart.c
@@ -682,7 +682,8 @@ static int dma_handle_rx(struct eg20t_port *priv)
 	sg_dma_len(sg) = priv->fifo_size;
 
 	sg_set_page(&priv->sg_rx, virt_to_page(priv->rx_buf_virt),
-		     sg_dma_len(sg), (int)priv->rx_buf_virt & ~PAGE_MASK);
+		     sg_dma_len(sg), (unsigned long)priv->rx_buf_virt &
+		     ~PAGE_MASK);
 
 	sg_dma_address(sg) = priv->rx_buf_dma;
 
@@ -1254,7 +1255,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	int ret;
 	unsigned int iobase;
 	unsigned int mapbase;
-	unsigned int rxbuf;
+	unsigned char *rxbuf;
 	int fifosize, base_baud;
 	static int num;
 
@@ -1262,7 +1263,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	if (priv == NULL)
 		goto init_port_alloc_err;
 
-	rxbuf = __get_free_page(GFP_KERNEL);
+	rxbuf = (unsigned char *)__get_free_page(GFP_KERNEL);
 	if (!rxbuf)
 		goto init_port_free_txbuf;
 
@@ -1286,7 +1287,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	priv->iobase = iobase;
 	priv->pdev = pdev;
 	priv->tx_empty = 1;
-	priv->rxbuf.buf = (unsigned char *)rxbuf;
+	priv->rxbuf.buf = rxbuf;
 	priv->rxbuf.size = PAGE_SIZE;
 
 	priv->fifo_size = fifosize;
@@ -1313,7 +1314,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	return priv;
 
 init_port_hal_free:
-	free_page(rxbuf);
+	free_page((unsigned long)rxbuf);
 init_port_free_txbuf:
 	kfree(priv);
 init_port_alloc_err:
@@ -1325,7 +1326,7 @@ static void pch_uart_exit_port(struct eg20t_port *priv)
 {
 	uart_remove_one_port(&pch_uart_driver, &priv->port);
 	pci_set_drvdata(priv->pdev, NULL);
-	free_page((unsigned int)priv->rxbuf.buf);
+	free_page((unsigned long)priv->rxbuf.buf);
 }
 
 static void pch_uart_pci_remove(struct pci_dev *pdev)
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ