[parisc-linux] small STI patch

Helge Deller deller@gmx.de
Tue, 13 Feb 2001 22:17:05 +0100


Hi,

I've just committed a small patch, which saves us to copy a whole struct from 
the STI ROM just to get one value (the ROM size) out of it.

Helge

--- sticon-wmode.c      2001/02/04 21:22:59     1.3
+++ sticon-wmode.c      2001/02/13 20:56:54     1.4
@@ -119,13 +119,9 @@
        if (!(raw && cooked))
                goto out_err;
 
-       /* copy raw rom header & get the real size */
-       sti_rom_copy(address, 0, sizeof(*raw), raw);
-       wmode_sti_dump_rom(raw);
-       size = raw->last_addr;
-       kfree(raw);
+       /* read the ROM size directly from the struct in ROM */
+       size = gsc_readl(address + offsetof(struct sti_rom,last_addr));
 
-       /* now copy raw rom with real size */
        raw = kmalloc(size, GFP_KERNEL);
        if(!raw)
                goto out_err;