Subject: Re: kernel config file changes
To: Emmanuel Dreyfus <Emmanuel.Dreyfus@espci.fr>
From: Jachym Holecek <freza@psi.cz>
List: port-hpcarm
Date: 06/30/2003 11:12:55
> > > ../../../../arch/hpcarm/dev/sed_saip.c:90: #error "define btop, ptob."
> > >
> > > Here is the code:
> > >
> > > #if defined __mips__ || defined __sh__ || defined __arm__
> > > #define __BTOP(x) ((paddr_t)(x) >> PGSHIFT)
> > > #define __PTOB(x) ((paddr_t)(x) << PGSHIFT)
> > > #else
> > > #error "define btop, ptob."
> > > #endif
> >
> > Hmm, is it OK for code to check against compiler provided macros (see
> > below) instead of relying on MACHINE (or whatever kernel-provided value
> > appropriate)?
>
> What about just killing this #if? This code will not ever be built for
> mips or sh, it is an arm only file.
Hmm, right. Following patch does the job (the same change goes for
ipaq_lcd.c, for consistency). Now I notice ipaq_lcd.c does not get
built, I'm going to have a look... JORNADA720 built fine.
-- Jachym
--- sed_saip.c.orig Mon Jun 30 13:01:09 2003
+++ sed_saip.c Mon Jun 30 13:13:31 2003
@@ -83,13 +83,6 @@
void sed1356_set_brightness(struct sed1356_softc *, int);
void sed1356_set_contrast(struct sed1356_softc *, int);
-#if defined __mips__ || defined __sh__ || defined __arm__
-#define __BTOP(x) ((paddr_t)(x) >> PGSHIFT)
-#define __PTOB(x) ((paddr_t)(x) << PGSHIFT)
-#else
-#error "define btop, ptob."
-#endif
-
/*
* static variables
*/
@@ -217,7 +210,7 @@
return (-1);
}
fb->hf_offset = (u_long)bootinfo->fb_addr -
- __PTOB(__BTOP(bootinfo->fb_addr));
+ arm_ptob(arm_btop((paddr_t)bootinfo->fb_addr));
/* frame buffer start offset */
fb->hf_bytes_per_line = bootinfo->fb_line_bytes;
fb->hf_nplanes = 1;
@@ -550,7 +543,7 @@
sc->sc_fbconf.hf_offset) < offset)
return -1;
- return __BTOP((u_long)bootinfo->fb_addr + offset);
+ return arm_btop((u_long)bootinfo->fb_addr + offset);
}
--- ipaq_lcd.c.orig Mon Jun 30 13:00:58 2003
+++ ipaq_lcd.c Mon Jun 30 13:15:46 2003
@@ -77,12 +77,6 @@
static int ipaqlcd_ioctl(void *, u_long, caddr_t, int, struct proc *);
static paddr_t ipaqlcd_mmap(void *, off_t offset, int);
-#if defined __mips__ || defined __sh__ || defined __arm__
-#define __BTOP(x) ((paddr_t)(x) >> PGSHIFT)
-#define __PTOB(x) ((paddr_t)(x) << PGSHIFT)
-#else
-#error "define btop, ptob."
-#endif
CFATTACH_DECL(ipaqlcd, sizeof(struct ipaqlcd_softc),
ipaqlcd_match, ipaqlcd_attach, NULL, NULL);
@@ -205,7 +199,7 @@
}
fb->hf_offset = (u_long)bootinfo->fb_addr -
- __PTOB(__BTOP(bootinfo->fb_addr));
+ arm_ptob(arm_btop((paddr_t)bootinfo->fb_addr));
/* frame buffer start offset */
fb->hf_bytes_per_line = bootinfo->fb_line_bytes;
fb->hf_nplanes = 1;
@@ -395,5 +389,5 @@
sc->sc_fbconf.hf_offset) < offset)
return -1;
- return __BTOP((u_long)bootinfo->fb_addr + offset);
+ return arm_btop((u_long)bootinfo->fb_addr + offset);
}