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]
Date:	Wed, 15 Sep 2010 23:04:56 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:	Linux Kernel Development <linux-kernel@...r.kernel.org>,
	Mikael Starvik <starvik@...s.com>,
	Jesper Nilsson <jesper.nilsson@...s.com>,
	linux-cris-kernel@...s.com
Subject: Re: Build regressions/improvements in v2.6.36-rc4

Hi Geert,

On Wed, Sep 15, 2010 at 09:29:35PM +0200, Geert Uytterhoeven wrote:
> 	drivers/input/gameport/lightning.c: error: invalid operands to binary & (have 'void *' and 'int'):  => 177, 141, 86
> 	drivers/input/gameport/ns558.c: error: invalid operands to binary & (have 'void *' and 'int'):  => 84
> 	drivers/input/touchscreen/mk712.c: error: invalid operands to binary | (have 'void *' and 'int'):  => 129

I think these (and a few more) should be fixed for the patch below (not
even compiled)...

Thanks.

-- 
Dmitry


[CRIS] Convert io macros into inline functions

From: Dmitry Torokhov <dmitry.torokhov@...il.com>

This should silence warnings such as:

drivers/input/gameport/lightning.c: error: invalid operands to binary &
(have 'void *' and 'int'):  => 177, 141, 86
drivers/input/gameport/ns558.c: error: invalid operands to binary &
(have 'void *' and 'int'):  => 84
drivers/input/touchscreen/mk712.c: error: invalid operands to binary |
(have 'void *' and 'int'):  => 129

Marco argument expansion is a bitch...

This also fixes outsl - size of an 'int' is 4 and not 3.

Reported-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Signed-off-by: Dmitry Torokhov <dtor@...l.ru>
---

 arch/cris/include/asm/io.h |   44 ++++++++++++++++++++++++++++++++------------
 1 files changed, 32 insertions(+), 12 deletions(-)


diff --git a/arch/cris/include/asm/io.h b/arch/cris/include/asm/io.h
index 32567bc..e248589 100644
--- a/arch/cris/include/asm/io.h
+++ b/arch/cris/include/asm/io.h
@@ -127,18 +127,38 @@ static inline void writel(unsigned int b, volatile void __iomem *addr)
  */
 
 #define IO_SPACE_LIMIT 0xffff
-#define inb(port) (cris_iops ? cris_iops->read_io(port,NULL,1,1) : 0)
-#define inw(port) (cris_iops ? cris_iops->read_io(port,NULL,2,1) : 0)
-#define inl(port) (cris_iops ? cris_iops->read_io(port,NULL,4,1) : 0)
-#define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0)
-#define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0)
-#define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0)
-#define outb(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,1,1)
-#define outw(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,2,1)
-#define outl(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,4,1)
-#define outsb(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,1,count)
-#define outsw(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,2,count)
-#define outsl(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,3,count)
+
+#define BUILDIO(bwl, bw, type)						\
+static inline void out##bwl(type value, int port)			\
+{									\
+	if (cris_iops)							\
+		cris_iops->write_io(port, (void *)(unsigned long)value,	\
+				    sizeof(type), 1);			\
+}									\
+									\
+static inline type in##bwl(int port)					\
+{									\
+	return cris_iops ?						\
+		cris_iops->read_io(port, NULL, sizeof(type), 1) : 0;	\
+}									\
+									\
+static inline void outs##bwl(int port,					\
+			     const void *addr, unsigned long count)	\
+{									\
+	if (cris_iops)							\
+		cris_iops->write_io(port,				\
+				(void *)addr, sizeof(type), count);	\
+}									\
+									\
+static inline void ins##bwl(int port, void *addr, unsigned long count)	\
+{									\
+	if (cris_iops)							\
+		cris_iops->read_io(port, addr, sizeof(type), count);	\
+}
+
+BUILDIO(b, unsigned char)
+BUILDIO(w, unsigned short)
+BUILDIO(l, unsigned int)
 
 /*
  * Convert a physical pointer to a virtual kernel pointer for /dev/mem
--
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