<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [PATCH 1/2] [v3][POWERPC] refactor dcr code</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<BR>
<P><FONT SIZE=2>> > +void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c)<BR>
> > +{<BR>
> > + if (host.type == NATIVE)<BR>
> > + dcr_unmap_native(host.host.native, dcr_c);<BR>
> > + else<BR>
> > + dcr_unmap_mmio(host.host.mmio, dcr_c);<BR>
><BR>
> What happens if host.type == INVALID? Same question for the other<BR>
> accessors in dcr_*_generic.<BR>
<BR>
I guess looking back on it, I assumed that MAP_OK would return 0, meaning that behavior was undefined,<BR>
but I agree it's probably safer to have some error reporting there... There starts to become a speed tradeoff<BR>
at some point, which would make function pointers more attractive. If the ioremap does fail, or the<BR>
dcr-access-method can't be determined, then dcr_unmap_mmio would probably SEGV anyway, although that's<BR>
not something I'd really want to rely on. I'll put an error case in there.<BR>
<BR>
> > +enum host_type_t {MMIO, NATIVE, INVALID};<BR>
><BR>
> Should these be DCR_HOST_MMIO, DCR_HOST_NATIVE, DCR_HOST_INVALID?<BR>
><BR>
> I worry about the generic nature of the names.<BR>
<BR>
Also seems reasonable,<BR>
<BR>
Steve<BR>
</FONT>
</P>
</BODY>
</HTML>