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] [day] [month] [year] [list]
Date:	Fri, 27 Apr 2007 02:11:35 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	"l l" <happyarch@...il.com>
Cc:	"Adrian Bunk" <bunk@...sta.de>, linux-kernel@...r.kernel.org,
	Evgeniy Polyakov <johnpol@....mipt.ru>
Subject: Re: linux-2.6.21 and __udivid3

On Fri, 27 Apr 2007 09:56:03 +0900 "l l" <happyarch@...il.com> wrote:

> Here is another compilation failure.
> 
> make
>   CHK     include/linux/version.h
>   CHK     include/linux/utsrelease.h
>   CHK     include/linux/compile.h
>   CC [M]  drivers/w1/w1.o
> drivers/w1/w1.c: In function 'w1_slave_read_id':
> drivers/w1/w1.c:118: error: cannot take address of bit-field 'family'
> drivers/w1/w1.c:118: error: cannot take address of bit-field 'family'
> drivers/w1/w1.c:118: error: cannot take address of bit-field 'family'
> drivers/w1/w1.c:118: error: cannot take address of bit-field 'family'
> drivers/w1/w1.c:118: error: cannot take address of bit-field 'family'
> drivers/w1/w1.c:118: error: cannot take address of bit-field 'family'
> make[2]: *** [drivers/w1/w1.o] Error 1
> make[1]: *** [drivers/w1] Error 2
> make: *** [drivers] Error 2

hm,

		memcpy(buf, (u8 *)&sl->reg_num, count);

and

struct w1_reg_num
{
#if defined(__LITTLE_ENDIAN_BITFIELD)
	__u64	family:8,
		id:48,
		crc:8;
#elif defined(__BIG_ENDIAN_BITFIELD)
	__u64	crc:8,
		id:48,
		family:8;
#else
#error "Please fix <asm/byteorder.h>"
#endif
};

the compiler is being a bit pedantic there, IMO.  What version of gcc are
you using?

Does this help?


--- a/drivers/w1/w1.h~w1-build-fix
+++ a/drivers/w1/w1.h
@@ -22,19 +22,23 @@
 #ifndef __W1_H
 #define __W1_H
 
-struct w1_reg_num
-{
+struct w1_reg_num {
+	union {
+		__u64 unused;	/* So gcc will permit pointers to this struct */
+		struct {
 #if defined(__LITTLE_ENDIAN_BITFIELD)
-	__u64	family:8,
-		id:48,
-		crc:8;
+			__u64	family:8,
+				id:48,
+				crc:8;
 #elif defined(__BIG_ENDIAN_BITFIELD)
-	__u64	crc:8,
-		id:48,
-		family:8;
+			__u64	crc:8,
+				id:48,
+				family:8;
 #else
 #error "Please fix <asm/byteorder.h>"
 #endif
+		};
+	};
 };
 
 #ifdef __KERNEL__
_

-
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