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)
Sat, Jun 8, 1:26 PM
Unknown Object (File)
Mon, Jun 3, 1:59 AM
Unknown Object (File)
Thu, May 30, 11:52 AM
Unknown Object (File)
Wed, May 29, 8:08 PM
Unknown Object (File)
Tue, May 21, 11:09 AM
Unknown Object (File)
May 2 2024, 10:36 AM
Unknown Object (File)
May 2 2024, 9:44 AM
Unknown Object (File)
May 2 2024, 9:42 AM

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 Not Applicable
Unit
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.
sys/compat/linuxkpi/common/include/linux/io.h
535

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.