public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linux-scsi <linux-scsi@vger.kernel.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: [PATCH] sym53c8xx: Fix bogus sym_que_entry re-implementation of container_of
Date: Mon, 07 Jul 2008 10:50:25 +1000	[thread overview]
Message-ID: <20080707005030.503A3DDE08@ozlabs.org> (raw)

The sym53c8xx driver, for some reason, seems to mostly re-implement
linux/list.h with added bogosity. The main one is it's implementation
of sym_que_entry which spits warnings with recent gcc's on some
64 bits architectures.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

Can somebody with that HW test the patch in case I did something
stupid ? I don't have a symbios controller at hand, it's just that
this driver is part of our defconfig :-)

 drivers/scsi/sym53c8xx_2/sym_misc.h |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- linux-work.orig/drivers/scsi/sym53c8xx_2/sym_misc.h	2008-07-07 10:42:03.000000000 +1000
+++ linux-work/drivers/scsi/sym53c8xx_2/sym_misc.h	2008-07-07 10:44:41.000000000 +1000
@@ -121,9 +121,7 @@ static __inline void sym_que_move(struct
 	}
 }
 
-#define sym_que_entry(ptr, type, member) \
-	((type *)((char *)(ptr)-(unsigned int)(&((type *)0)->member)))
-
+#define sym_que_entry(ptr, type, member) container_of(ptr, type, member)
 
 #define sym_insque(new, pos)		__sym_que_add(new, pos, (pos)->flink)
 

             reply	other threads:[~2008-07-07  0:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-07  0:50 Benjamin Herrenschmidt [this message]
2008-07-07  6:35 ` [PATCH] sym53c8xx: Fix bogus sym_que_entry re-implementation of container_of Grant Grundler
2008-07-07  6:43   ` Benjamin Herrenschmidt
2008-07-07 15:02     ` Grant Grundler

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=20080707005030.503A3DDE08@ozlabs.org \
    --to=benh@kernel.crashing.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox