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)
Wed, Oct 23, 3:21 PM
Unknown Object (File)
Oct 8 2024, 9:36 PM
Unknown Object (File)
Oct 3 2024, 4:06 PM
Unknown Object (File)
Oct 2 2024, 8:39 AM
Unknown Object (File)
Sep 12 2024, 1:41 AM
Unknown Object (File)
Sep 11 2024, 10:50 AM
Unknown Object (File)
Sep 5 2024, 5:20 AM
Unknown Object (File)
Aug 16 2024, 9:17 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 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.