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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a391e4df7c080c6a4d7eac58708967d02f0449fa.camel@perches.com>
Date:   Mon, 04 Nov 2019 10:39:03 -0800
From:   Joe Perches <joe@...ches.com>
To:     John Garry <john.garry@...wei.com>, xuwei5@...wei.com
Cc:     linuxarm@...wei.com, linux-kernel@...r.kernel.org, olof@...om.net,
        bhelgaas@...gle.com, arnd@...db.de
Subject: Re: [PATCH v3 3/5] bus: hisi_lpc: Clean some types

On Tue, 2019-11-05 at 01:22 +0800, John Garry wrote:
> Sparse complains of these:
> drivers/bus/hisi_lpc.c:82:38: warning: incorrect type in argument 1 (different address spaces)
> drivers/bus/hisi_lpc.c:82:38:    expected void const volatile [noderef] <asn:2>*addr
> drivers/bus/hisi_lpc.c:82:38:    got unsigned char *
> drivers/bus/hisi_lpc.c:131:35: warning: incorrect type in argument 1 (different address spaces)
> drivers/bus/hisi_lpc.c:131:35:    expected unsigned char *mbase
> drivers/bus/hisi_lpc.c:131:35:    got void [noderef] <asn:2>*membase
> drivers/bus/hisi_lpc.c:186:35: warning: incorrect type in argument 1 (different address spaces)
> drivers/bus/hisi_lpc.c:186:35:    expected unsigned char *mbase
> drivers/bus/hisi_lpc.c:186:35:    got void [noderef] <asn:2>*membase
> drivers/bus/hisi_lpc.c:228:16: warning: cast to restricted __le32
> drivers/bus/hisi_lpc.c:251:13: warning: incorrect type in assignment (different base types)
> drivers/bus/hisi_lpc.c:251:13:    expected unsigned int [unsigned] [usertype] val
> drivers/bus/hisi_lpc.c:251:13:    got restricted __le32 [usertype] <noident>
> 
> Clean them up.

OK, it might also be good to change the _in and _out functions
to use void * and not unsigned char * for buf

---
 drivers/bus/hisi_lpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c
index 20c9571..ec2bfb 100644
--- a/drivers/bus/hisi_lpc.c
+++ b/drivers/bus/hisi_lpc.c
@@ -100,7 +100,7 @@ static int wait_lpc_idle(unsigned char *mbase, unsigned int waitcnt)
  */
 static int hisi_lpc_target_in(struct hisi_lpc_dev *lpcdev,
 			      struct lpc_cycle_para *para, unsigned long addr,
-			      unsigned char *buf, unsigned long opcnt)
+			      void *buf, unsigned long opcnt)
 {
 	unsigned int cmd_word;
 	unsigned int waitcnt;
@@ -153,7 +153,7 @@ static int hisi_lpc_target_in(struct hisi_lpc_dev *lpcdev,
  */
 static int hisi_lpc_target_out(struct hisi_lpc_dev *lpcdev,
 			       struct lpc_cycle_para *para, unsigned long addr,
-			       const unsigned char *buf, unsigned long opcnt)
+			       const void *buf, unsigned long opcnt)
 {
 	unsigned int waitcnt;
 	unsigned long flags;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ