All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] board/linkstation/ide.c: Fix compile warning
Date: Fri, 11 Sep 2009 14:00:06 +0200	[thread overview]
Message-ID: <20090911120006.A6AB3832E8DE@gemini.denx.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0909111259280.6139@axis700.grange>

Dear Guennadi Liakhovetski,

In message <Pine.LNX.4.64.0909111259280.6139@axis700.grange> you wrote:
> Hi Wolfgang
> 
> On Fri, 11 Sep 2009, Wolfgang Denk wrote:
> 
> > Fix warning: ide.c:60: warning: dereferencing type-punned pointer will
> > break strict-aliasing rules
> > 
> > Signed-off-by: Wolfgang Denk <wd@denx.de>
> > Cc: Guennadi Liakhovetski <lg@denx.de>
> > ---
> >  board/linkstation/ide.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> > 
> > diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
> > index 2c89d62..5dd1d0e 100644
> > --- a/board/linkstation/ide.c
> > +++ b/board/linkstation/ide.c
> > @@ -54,10 +54,12 @@ int ide_preinit (void)
> >  	if (devbusfn == -1)
> >  		devbusfn = pci_find_device(PCI_VENDOR_ID_ITE,PCI_DEVICE_ID_ITE_8212,0);
> >  	if (devbusfn != -1) {
> > +		ulong *ide_bus_offset_ptr = &ide_bus_offset[0];
> > +
> >  		status = 0;
> >  
> >  		pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
> > -							   (u32 *) &ide_bus_offset[0]);
> > +							   (u32 *)ide_bus_offset_ptr);
> 
> Can we also use this occasion to get rid of this typecast?

No, as this would result in

ide.c:62: warning: passing argument 3 of 'pci_read_config_dword' from
incompatible pointer type

OK, we can declare ide_bus_offset_ptr as u32 8, but then we need the
cast there to avoid a "initialization from incompatible pointer type"
warning - so this isn't exactly an improvement.

I suggest we leave it as is, as this is the minimal-invasive change.

If you want to submit a more general cleanup patch (unifying data
types) you are welcome (but that would be a separate action in any
case).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If I had to live my life again,  I'd  make  the  same  mistakes, only
sooner.                                          -- Tallulah Bankhead

  reply	other threads:[~2009-09-11 12:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11  9:49 [U-Boot] [PATCH] board/dave/common/flash.c: fix compile warning Wolfgang Denk
2009-09-11  9:49 ` [U-Boot] [PATCH] board/amcc/common/flash.c: Fix " Wolfgang Denk
2009-09-11 13:06   ` Stefan Roese
2009-09-14 22:30   ` Wolfgang Denk
2009-09-11  9:49 ` [U-Boot] [PATCH] board/etin/debris/phantom.c: Fix compile error Wolfgang Denk
2009-09-14 22:18   ` Wolfgang Denk
2009-09-11  9:49 ` [U-Boot] [PATCH] board/linkstation/ide.c: Fix compile warning Wolfgang Denk
2009-09-11 11:00   ` Guennadi Liakhovetski
2009-09-11 12:00     ` Wolfgang Denk [this message]
2009-09-11 12:03       ` Guennadi Liakhovetski
2009-09-11 17:54       ` Scott Wood
2009-09-14 22:26         ` [U-Boot] [PATCH v2] " Wolfgang Denk
2009-09-15 20:42           ` Guennadi Liakhovetski
2009-09-15 21:16             ` Wolfgang Denk
2009-09-16 20:42               ` Guennadi Liakhovetski
2009-09-22 20:26                 ` Wolfgang Denk
2009-09-22 20:51                   ` Guennadi Liakhovetski
2009-09-22 21:54                     ` Wolfgang Denk
2009-09-22 21:54           ` Wolfgang Denk
2009-09-11  9:49 ` [U-Boot] [PATCH] board/amcc/taihu/flash.c: " Wolfgang Denk
2009-09-11 13:07   ` Stefan Roese
2009-09-14 22:28   ` Wolfgang Denk
2009-09-11  9:49 ` [U-Boot] [PATCH] board/amcc/yucca/flash.c: " Wolfgang Denk
2009-09-11 13:08   ` Stefan Roese
2009-09-14 22:29   ` Wolfgang Denk
2009-09-14 22:16 ` [U-Boot] [PATCH] board/dave/common/flash.c: fix " Wolfgang Denk

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=20090911120006.A6AB3832E8DE@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /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.