Skip to content

kernel.h: Add wrapper for renamed from_timer function for rhel 8.9#106

Open
phoneben wants to merge 1 commit intoasterisk:masterfrom
phoneben:from_timer
Open

kernel.h: Add wrapper for renamed from_timer function for rhel 8.9#106
phoneben wants to merge 1 commit intoasterisk:masterfrom
phoneben:from_timer

Conversation

@phoneben
Copy link
Contributor

@phoneben phoneben commented Mar 4, 2026

kernel.h: Add wrapper for renamed from_timer function for rhel 8.9
see original issue #95

Introduce RHEL_VERSION_GE() helper to simplify and standardize RHEL version checks.
Future checks can use RHEL_VERSION_GE(x, y) instead of repeating the full macro guard.

#include <linux/poll.h>

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)||(defined(RHEL_RELEASE_CODE) && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 8)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need spaces before and after ||

Copy link
Contributor Author

@phoneben phoneben Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look this is good for me centos 9 will it brake for other rhel users ?
is there a better way maybe ?

#if !defined(from_timer) && defined(timer_container_of)
#define from_timer timer_container_of
#endif

Copy link
Contributor

@InterLinked1 InterLinked1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this won't cause issues if RHEL_RELEASE_CODE and RHEL_RELEASE_VERSION are not both defined (only one is)? I seem to recall that being an issue before - see ce694ac

Copy link
Contributor

@InterLinked1 InterLinked1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good... though at some point down the line, we should probably clean up and simplify some of the RHEL macros for consistency

#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0) ||(defined(RHEL_RELEASE_CODE) && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 8)))
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0) ||(defined(RHEL_RELEASE_CODE) && defined(RHEL_RELEASE_VERSION) && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 8)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after || in these

@phoneben phoneben force-pushed the from_timer branch 2 times, most recently from 897f65f to 538b1c3 Compare March 4, 2026 17:28
kernel.h: Add wrapper for renamed from_timer function for rhel 8.9
see original issue asterisk#95

Introduce `RHEL_VERSION_GE()` helper to simplify and standardize RHEL version checks.
Future checks can use `RHEL_VERSION_GE(x, y)` instead of repeating the full macro guard.
@phoneben
Copy link
Contributor Author

phoneben commented Mar 4, 2026

is this good ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants