All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "l l" <happyarch@gmail.com>
Cc: "Adrian Bunk" <bunk@stusta.de>,
	linux-kernel@vger.kernel.org,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Subject: Re: linux-2.6.21 and __udivid3
Date: Fri, 27 Apr 2007 02:11:35 -0700	[thread overview]
Message-ID: <20070427021135.0e8afbc1.akpm@linux-foundation.org> (raw)
In-Reply-To: <768a59a70704261756x5b588ef0y3a3ac9460e437b89@mail.gmail.com>

On Fri, 27 Apr 2007 09:56:03 +0900 "l l" <happyarch@gmail.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__
_


      reply	other threads:[~2007-04-27  9:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-26 15:24 linux-2.6.21 and __udivid3 l l
2007-04-26 15:32 ` Peter Zijlstra
2007-04-26 17:55 ` Adrian Bunk
2007-04-26 19:57   ` Stephen Hemminger
2007-04-27  0:30   ` l l
2007-04-27  0:56     ` l l
2007-04-27  9:11       ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070427021135.0e8afbc1.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bunk@stusta.de \
    --cc=happyarch@gmail.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.