Page MenuHomeFreeBSD

LinuxKPI: fix argument type to lkpi_pci_msi_desc_alloc()
AcceptedPublic

Authored by bz on Sun, Aug 16, 10:17 PM.
Referenced Files
F171603229: D58879.id.diff
Sat, Sep 12, 2:08 AM
Unknown Object (File)
Fri, Sep 11, 2:12 AM
Unknown Object (File)
Thu, Sep 10, 7:39 AM
Unknown Object (File)
Tue, Sep 8, 7:47 AM
Unknown Object (File)
Mon, Sep 7, 8:07 PM
Unknown Object (File)
Sun, Sep 6, 7:49 AM
Unknown Object (File)
Fri, Sep 4, 8:49 PM
Unknown Object (File)
Fri, Sep 4, 7:56 AM

Details

Reviewers
dumbbell
Group Reviewers
linuxkpi
Summary

lkpi_pci_msi_desc_alloc() takes an unsigned int, not an int.
While here make sure the prototype is visibile in interrupt.h as
well before use to avoid -Wimplicit-function-declaration errors.

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 75635
Build 72518: arc lint + arc unit

Event Timeline

bz requested review of this revision.Sun, Aug 16, 10:17 PM
dumbbell added inline comments.
sys/compat/linuxkpi/common/include/linux/pci.h
391

Isn’t this a duplicate declaration now that <linux/interrupt.h> is included?

sys/compat/linuxkpi/common/include/linux/pci.h
391

Yes it would be; but it belongs here.
The function declaration in interrupt.h is needed in case something includes pci.h before interrupt.h now as pci.h includes interrupt.h and the function is not declared at that point yet as the "circular" include of pci.h in interrupt.h is prevented by the header guards.

The question is why did I have to include interrupt.h here as well; that likely should be a different change? Let me go and find the error I encountered.

sys/compat/linuxkpi/common/include/linux/pci.h
391

On Linux, <linux/pci.h> includes <linux/interrupt.h>, thus I believe this is right.

Don’t you get a compiler warning because of this duplicate?

sys/compat/linuxkpi/common/include/linux/pci.h
391

No, why?
For as long as the function declarations are matching you can have as many as you want.
There's not duplicate public function with the same name here.

I do not think we apply GCC's -Wredundant-decls anywhere; at least with clang that would not complain either.

This revision is now accepted and ready to land.Thu, Sep 10, 8:24 PM