[parisc-linux] [PATCH] PDC cleanup and encapsulation

Bjorn Helgaas bjorn_helgaas@hp.com
Wed, 4 Apr 2001 09:57:25 -0700


--------------Boundary-00=_PR1A3TL1EFSHDQCUCEMZ
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 8bit

Looks good to me.  A couple minor questions/comments, more for my 
edification than anything else:

- pdc.h contains a commented-out struct pdc_iodc.  The comment suggests 
possible issues with using it with 64-bit firmware, but I think the fear 
is unfounded.  There are several places that use pdc_iodc_read(), but they 
all seem to define their own equivalent of struct pdc_iodc.  I'm not sure 
why they don't use struct pdc_iodc.  Also, include/asm-parisc/hardware.h 
contains #defines for the IODC_TYPE field (HPHW_NPROC, etc); should these 
be defined alongside struct pdc_iodc?

- What are the guidelines for #ifdef __LP64__ vs CONFIG_PA20?  You 
replaced __LP64__ with CONFIG_PA20 in some places but not others and I'm 
not clear on the difference.

- In firmware.c, the "yes 'int', not 'long' -- IODC I/O is always 32-bit 
stuff" comment moved from pdc.h seems obsolete, or at least, I can't 
figure out what the 'int' refers to.  I'd remove the "This means Cxxx 
boxes can't run wide kernels right now." comment, since CONFIG_PDC_NARROW 
addresses that issue.

I attached a diff that fixes a few typos.

Bjorn

--------------Boundary-00=_PR1A3TL1EFSHDQCUCEMZ
Content-Type: text/english;
  name="spell"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="spell"

ZGlmZiAtdXJOIGxpbnV4L2FyY2gvcGFyaXNjL2tlcm5lbC9maXJtd2FyZS5jIGxpbnV4LndpcC9h
cmNoL3BhcmlzYy9rZXJuZWwvZmlybXdhcmUuYwotLS0gbGludXgvYXJjaC9wYXJpc2Mva2VybmVs
L2Zpcm13YXJlLmMJV2VkIEFwciAgNCAxMDozNTo1OCAyMDAxCisrKyBsaW51eC53aXAvYXJjaC9w
YXJpc2Mva2VybmVsL2Zpcm13YXJlLmMJV2VkIEFwciAgNCAxMDo0OTowOSAyMDAxCkBAIC0xMiw3
ICsxMiw3IEBACiAgKgkgL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