Page MenuHomeFreeBSD

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

Authored by wulf on Nov 28 2023, 9:04 PM.
Referenced Files
Wed, May 29, 8:08 PM
Unknown Object (File)
Tue, May 21, 11:09 AM
Unknown Object (File)
Thu, May 2, 10:36 AM
Unknown Object (File)
Thu, May 2, 9:44 AM
Unknown Object (File)
Thu, May 2, 9:42 AM
Unknown Object (File)
Thu, May 2, 9:06 AM
Unknown Object (File)
Apr 22 2024, 12:48 AM
Unknown Object (File)
Mar 17 2024, 10:54 AM



The function creates an error pointer.

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

Diff Detail

rG FreeBSD src repository
Lint Passed
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.

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.