Page MenuHomeFreeBSD

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

Authored by wulf on Nov 28 2023, 9:04 PM.
Referenced Files
Unknown Object (File)
Tue, Feb 20, 4:24 AM
Unknown Object (File)
Dec 24 2023, 9:37 PM
Unknown Object (File)
Dec 24 2023, 12:15 PM
Unknown Object (File)
Dec 23 2023, 10:08 AM
Unknown Object (File)
Dec 21 2023, 11:11 PM
Unknown Object (File)
Dec 11 2023, 5:32 PM



The function creates an error pointer.

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

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

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.