Messages in this thread Patch in this message | | | Date | Sun, 19 Sep 2004 12:44:26 +0200 (MEST) | From | Mikael Pettersson <> | Subject | Re: [PATCH][2.6.9-rc2] Specialix RIO driver gcc-3.4 fixes |
| |
On Sat, 18 Sep 2004 16:28:10 +0300, Denis Vlasenko wrote: >On Saturday 18 September 2004 15:42, Mikael Pettersson wrote: >> This patch fixes gcc-3.4 cast-as-lvalue warnings in the 2.6.9-rc2 >> kernel's Specialix RIO driver. This is a forward port of the fix >> I made for the 2.4 kernel. >> >> /Mikael >> >> --- linux-2.6.9-rc2/drivers/char/rio/rio_linux.c.~1~ 2004-03-11 14:01:27.000000000 +0100 >> +++ linux-2.6.9-rc2/drivers/char/rio/rio_linux.c 2004-09-18 14:27:33.000000000 +0200 >> @@ -1139,7 +1139,7 @@ >> if (((1 << hp->Ivec) & rio_irqmask) == 0) >> hp->Ivec = 0; >> hp->CardP = (struct DpRam *) >> - hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); >> + (hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN)); > >I think it's best to untangle assignments, it's easier to read this way: > > hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); > hp->CardP = (struct DpRam *) hp->Caddr;
Ok. I don't want to get into general cleanups, but this one can easily be combined with the actual fix. Here's a revised patch:
--- linux-2.6.9-rc2/drivers/char/rio/rio_linux.c.~1~ 2004-03-11 14:01:27.000000000 +0100 +++ linux-2.6.9-rc2/drivers/char/rio/rio_linux.c 2004-09-19 12:26:42.000000000 +0200 @@ -1138,8 +1138,8 @@ hp->Ivec = pdev->irq; if (((1 << hp->Ivec) & rio_irqmask) == 0) hp->Ivec = 0; - hp->CardP = (struct DpRam *) hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); + hp->CardP = (struct DpRam *) hp->Caddr; hp->Type = RIO_PCI; hp->Copy = rio_pcicopy; hp->Mode = RIO_PCI_BOOT_FROM_RAM; @@ -1196,8 +1196,8 @@ if (((1 << hp->Ivec) & rio_irqmask) == 0) hp->Ivec = 0; hp->Ivec |= 0x8000; /* Mark as non-sharable */ - hp->CardP = (struct DpRam *) hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); + hp->CardP = (struct DpRam *) hp->Caddr; hp->Type = RIO_PCI; hp->Copy = rio_pcicopy; hp->Mode = RIO_PCI_BOOT_FROM_RAM; @@ -1242,8 +1242,8 @@ hp->PaddrP = rio_probe_addrs[i]; /* There was something about the IRQs of these cards. 'Forget what.--REW */ hp->Ivec = 0; - hp->CardP = (struct DpRam *) hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); + hp->CardP = (struct DpRam *) hp->Caddr; hp->Type = RIO_AT; hp->Copy = rio_pcicopy; /* AT card PCI???? - PVDL * -- YES! this is now a normal copy. Only the - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |