From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grzegorz Bernacki Date: Wed, 10 Jun 2009 14:50:49 +0200 Subject: [U-Boot] [PATCH v2 1/3] mpc52xx: Add SPI driver. In-Reply-To: References: <1244549692-68089-1-git-send-email-gjb@semihalf.com> Message-ID: <4A2FAC29.2000304@semihalf.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Detlev Zundel wrote: >> + out8((u32)&spi->brr, 0x77); /* baud rate: IPB clock / 2048 */ > > Ok, we're actually using the accessor macros, but I fail to see why a > (u32) cast is needed here - it even actively prevents one of the > "features" of the macros, namely type checking. > > Why exactly are they needed? Declaration of out8() is in common.h file: void out8(unsigned int, unsigned char); so I think that this cast is necessary. Without it I get warning: mpc52xx_spi.c:38: warning: passing argument 1 of 'out8' makes integer from pointer without a cast regards, Grzesiek