Page MenuHomeFreeBSD

LinuxKPI: Add IOMEM_ERR_PTR() to linux/io.h
ClosedPublic

Authored by wulf on Nov 28 2023, 9:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 17, 10:54 AM
Unknown Object (File)
Sun, Mar 17, 10:54 AM
Unknown Object (File)
Sun, Mar 17, 10:54 AM
Unknown Object (File)
Sun, Mar 17, 10:54 AM
Unknown Object (File)
Mar 14 2024, 6:10 PM
Unknown Object (File)
Feb 20 2024, 4:24 AM
Unknown Object (File)
Dec 24 2023, 9:37 PM
Unknown Object (File)
Dec 24 2023, 12:15 PM

Details

Summary

The function creates an error pointer.

Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week

Diff Detail

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

Event Timeline

wulf requested review of this revision.Nov 28 2023, 9:04 PM
This revision is now accepted and ready to land.Nov 29 2023, 6:12 AM
bz requested changes to this revision.Dec 8 2023, 5:25 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/io.h
534

That'll fail to compile I bet; at least on i386?

(a) given this is not ERR_PTR (despite it is defined to nothing on FreeBSD) we should add __iomem.

static inline void __iomem *
IOMEM_ERR_PTR(long error)
{
        return (void __iomem *)(intptr_t)error;
}

or if you wish (probably needs linux/err.h then):

#define IOMEM_ERR_PTR(_e) (void __iomem *)ERR_PTR(_e)
This revision now requires changes to proceed.Dec 8 2023, 5:25 PM
wulf edited the summary of this revision. (Show Details)

Make IOMEM_ERR_PTR sparse-friendly and convert to macro to match Linux

wulf marked an inline comment as done.Dec 9 2023, 11:45 AM
This revision is now accepted and ready to land.Dec 12 2023, 1:39 AM
This revision was automatically updated to reflect the committed changes.