linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][SSB] Fix a warning in PCI core driver
@ 2007-08-12 23:50 Aurelien Jarno
  2007-08-13  0:02 ` Michael Buesch
  0 siblings, 1 reply; 6+ messages in thread
From: Aurelien Jarno @ 2007-08-12 23:50 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless

The patch below fixes a warning spotted a few days ago by Andrew Morton
while releasing 2.6.23-rc2-mm1.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -278,7 +278,7 @@
 static struct resource ssb_pcicore_mem_resource = {
 	.name	= "SSB PCIcore external memory",
 	.start	= SSB_PCI_DMA,
-	.end	= SSB_PCI_DMA + SSB_PCI_DMA_SZ - 1,
+	.end	= (u32)SSB_PCI_DMA + (u32)SSB_PCI_DMA_SZ - 1,
 	.flags	= IORESOURCE_MEM,
 };
 

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][SSB] Fix a warning in PCI core driver
  2007-08-12 23:50 [PATCH][SSB] Fix a warning in PCI core driver Aurelien Jarno
@ 2007-08-13  0:02 ` Michael Buesch
  2007-08-13  0:18   ` Aurelien Jarno
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Buesch @ 2007-08-13  0:02 UTC (permalink / raw)
  To: Aurelien Jarno; +Cc: linux-wireless, Andrew Morton

On Monday 13 August 2007 01:50:58 Aurelien Jarno wrote:
> The patch below fixes a warning spotted a few days ago by Andrew Morton
> while releasing 2.6.23-rc2-mm1.
> 
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> 
> --- a/drivers/ssb/driver_pcicore.c
> +++ b/drivers/ssb/driver_pcicore.c
> @@ -278,7 +278,7 @@
>  static struct resource ssb_pcicore_mem_resource = {
>  	.name	= "SSB PCIcore external memory",
>  	.start	= SSB_PCI_DMA,
> -	.end	= SSB_PCI_DMA + SSB_PCI_DMA_SZ - 1,
> +	.end	= (u32)SSB_PCI_DMA + (u32)SSB_PCI_DMA_SZ - 1,
>  	.flags	= IORESOURCE_MEM,
>  };
>  
> 

These casts were intentionally removed by me.
I think they are bogus and I have no idea why this
generates this strange compiler warning (I think it
was some overflow warning?).

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][SSB] Fix a warning in PCI core driver
  2007-08-13  0:02 ` Michael Buesch
@ 2007-08-13  0:18   ` Aurelien Jarno
  2007-08-13  2:21     ` Michael Buesch
  0 siblings, 1 reply; 6+ messages in thread
From: Aurelien Jarno @ 2007-08-13  0:18 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless, Andrew Morton

On Mon, Aug 13, 2007 at 02:02:27AM +0200, Michael Buesch wrote:
> On Monday 13 August 2007 01:50:58 Aurelien Jarno wrote:
> > The patch below fixes a warning spotted a few days ago by Andrew Morton
> > while releasing 2.6.23-rc2-mm1.
> > 
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > 
> > --- a/drivers/ssb/driver_pcicore.c
> > +++ b/drivers/ssb/driver_pcicore.c
> > @@ -278,7 +278,7 @@
> >  static struct resource ssb_pcicore_mem_resource = {
> >  	.name	= "SSB PCIcore external memory",
> >  	.start	= SSB_PCI_DMA,
> > -	.end	= SSB_PCI_DMA + SSB_PCI_DMA_SZ - 1,
> > +	.end	= (u32)SSB_PCI_DMA + (u32)SSB_PCI_DMA_SZ - 1,
> >  	.flags	= IORESOURCE_MEM,
> >  };
> >  
> > 
> 
> These casts were intentionally removed by me.
> I think they are bogus and I have no idea why this
> generates this strange compiler warning (I think it
> was some overflow warning?).
> 

Yes it is overflow warning. The compiler thinks that those constant are
signed values and thus generate an overflow.

Another fix would be to postfix those constants by U.

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][SSB] Fix a warning in PCI core driver
  2007-08-13  0:18   ` Aurelien Jarno
@ 2007-08-13  2:21     ` Michael Buesch
  2007-08-13  9:07       ` Aurelien Jarno
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Buesch @ 2007-08-13  2:21 UTC (permalink / raw)
  To: Aurelien Jarno; +Cc: linux-wireless, Andrew Morton

On Monday 13 August 2007 02:18:49 Aurelien Jarno wrote:
> On Mon, Aug 13, 2007 at 02:02:27AM +0200, Michael Buesch wrote:
> > On Monday 13 August 2007 01:50:58 Aurelien Jarno wrote:
> > > The patch below fixes a warning spotted a few days ago by Andrew Morton
> > > while releasing 2.6.23-rc2-mm1.
> > > 
> > > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > > 
> > > --- a/drivers/ssb/driver_pcicore.c
> > > +++ b/drivers/ssb/driver_pcicore.c
> > > @@ -278,7 +278,7 @@
> > >  static struct resource ssb_pcicore_mem_resource = {
> > >  	.name	= "SSB PCIcore external memory",
> > >  	.start	= SSB_PCI_DMA,
> > > -	.end	= SSB_PCI_DMA + SSB_PCI_DMA_SZ - 1,
> > > +	.end	= (u32)SSB_PCI_DMA + (u32)SSB_PCI_DMA_SZ - 1,
> > >  	.flags	= IORESOURCE_MEM,
> > >  };
> > >  
> > > 
> > 
> > These casts were intentionally removed by me.
> > I think they are bogus and I have no idea why this
> > generates this strange compiler warning (I think it
> > was some overflow warning?).
> > 
> 
> Yes it is overflow warning. The compiler thinks that those constant are
> signed values and thus generate an overflow.
> 
> Another fix would be to postfix those constants by U.
> 

Can you please do this?

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][SSB] Fix a warning in PCI core driver
  2007-08-13  2:21     ` Michael Buesch
@ 2007-08-13  9:07       ` Aurelien Jarno
  2007-08-13 12:18         ` Michael Buesch
  0 siblings, 1 reply; 6+ messages in thread
From: Aurelien Jarno @ 2007-08-13  9:07 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless, Andrew Morton

On Mon, Aug 13, 2007 at 04:21:31AM +0200, Michael Buesch wrote:
> > Yes it is overflow warning. The compiler thinks that those constant are
> > signed values and thus generate an overflow.
> > 
> > Another fix would be to postfix those constants by U.
> > 
> 
> Can you please do this?
> 

Please find a patch below. I did the same for the whole address map for
consistency.

Aurelien



The patch below fixes a warning spotted a few days ago by Andrew Morton
while releasing 2.6.23-rc2-mm1.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

--- a/include/linux/ssb/ssb_regs.h
+++ a/include/linux/ssb/ssb_regs.h
@@ -5,24 +5,24 @@
 /* SiliconBackplane Address Map.
  * All regions may not exist on all chips.
  */
-#define SSB_SDRAM_BASE		0x00000000	/* Physical SDRAM */
-#define SSB_PCI_MEM		0x08000000	/* Host Mode sb2pcitranslation0 (64 MB) */
-#define SSB_PCI_CFG		0x0c000000	/* Host Mode sb2pcitranslation1 (64 MB) */
-#define	SSB_SDRAM_SWAPPED	0x10000000	/* Byteswapped Physical SDRAM */
-#define SSB_ENUM_BASE    	0x18000000	/* Enumeration space base */
-#define	SSB_ENUM_LIMIT		0x18010000	/* Enumeration space limit */
-
-#define	SSB_FLASH2		0x1c000000	/* Flash Region 2 (region 1 shadowed here) */
-#define	SSB_FLASH2_SZ		0x02000000	/* Size of Flash Region 2 */
-
-#define	SSB_EXTIF_BASE		0x1f000000	/* External Interface region base address */
-#define	SSB_FLASH1		0x1fc00000	/* Flash Region 1 */
-#define	SSB_FLASH1_SZ		0x00400000	/* Size of Flash Region 1 */
-
-#define SSB_PCI_DMA		0x40000000	/* Client Mode sb2pcitranslation2 (1 GB) */
-#define SSB_PCI_DMA_SZ		0x40000000	/* Client Mode sb2pcitranslation2 size in bytes */
-#define SSB_PCIE_DMA_L32	0x00000000	/* PCIE Client Mode sb2pcitranslation2 (2 ZettaBytes), low 32 bits */
-#define SSB_PCIE_DMA_H32	0x80000000	/* PCIE Client Mode sb2pcitranslation2 (2 ZettaBytes), high 32 bits */
+#define SSB_SDRAM_BASE		0x00000000U	/* Physical SDRAM */
+#define SSB_PCI_MEM		0x08000000U	/* Host Mode sb2pcitranslation0 (64 MB) */
+#define SSB_PCI_CFG		0x0c000000U	/* Host Mode sb2pcitranslation1 (64 MB) */
+#define	SSB_SDRAM_SWAPPED	0x10000000U	/* Byteswapped Physical SDRAM */
+#define SSB_ENUM_BASE    	0x18000000U	/* Enumeration space base */
+#define	SSB_ENUM_LIMIT		0x18010000U	/* Enumeration space limit */
+
+#define	SSB_FLASH2		0x1c000000U	/* Flash Region 2 (region 1 shadowed here) */
+#define	SSB_FLASH2_SZ		0x02000000U	/* Size of Flash Region 2 */
+
+#define	SSB_EXTIF_BASE		0x1f000000U	/* External Interface region base address */
+#define	SSB_FLASH1		0x1fc00000U	/* Flash Region 1 */
+#define	SSB_FLASH1_SZ		0x00400000U	/* Size of Flash Region 1 */
+
+#define SSB_PCI_DMA		0x40000000U	/* Client Mode sb2pcitranslation2 (1 GB) */
+#define SSB_PCI_DMA_SZ		0x40000000U	/* Client Mode sb2pcitranslation2 size in bytes */
+#define SSB_PCIE_DMA_L32	0x00000000U	/* PCIE Client Mode sb2pcitranslation2 (2 ZettaBytes), low 32 bits */
+#define SSB_PCIE_DMA_H32	0x80000000U	/* PCIE Client Mode sb2pcitranslation2 (2 ZettaBytes), high 32 bits */
 #define	SSB_EUART		(SSB_EXTIF_BASE + 0x00800000)
 #define	SSB_LED			(SSB_EXTIF_BASE + 0x00900000)
 

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][SSB] Fix a warning in PCI core driver
  2007-08-13  9:07       ` Aurelien Jarno
@ 2007-08-13 12:18         ` Michael Buesch
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Buesch @ 2007-08-13 12:18 UTC (permalink / raw)
  To: Aurelien Jarno; +Cc: linux-wireless, Andrew Morton

On Monday 13 August 2007 11:07:10 Aurelien Jarno wrote:
> On Mon, Aug 13, 2007 at 04:21:31AM +0200, Michael Buesch wrote:
> > > Yes it is overflow warning. The compiler thinks that those constant are
> > > signed values and thus generate an overflow.
> > > 
> > > Another fix would be to postfix those constants by U.
> > > 
> > 
> > Can you please do this?
> > 
> 
> Please find a patch below. I did the same for the whole address map for
> consistency.
> 
> Aurelien

Queued, thanks!

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-13 12:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-12 23:50 [PATCH][SSB] Fix a warning in PCI core driver Aurelien Jarno
2007-08-13  0:02 ` Michael Buesch
2007-08-13  0:18   ` Aurelien Jarno
2007-08-13  2:21     ` Michael Buesch
2007-08-13  9:07       ` Aurelien Jarno
2007-08-13 12:18         ` Michael Buesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).