Skip to content

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

Merged
push143smart merged 1 commit into
asterisk:masterfrom
phoneben:from_timer
Aug 14, 2026
Merged

kernel.h: Add wrapper for renamed from_timer function for rhel 8.9#106
push143smart merged 1 commit into
asterisk:masterfrom
phoneben:from_timer

Conversation

@phoneben

@phoneben phoneben commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

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.

Comment thread include/dahdi/kernel.h Outdated
#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
Copy Markdown
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 ||

@phoneben phoneben Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@InterLinked1 InterLinked1 left a comment

Copy link
Copy Markdown
Contributor

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

@InterLinked1 InterLinked1 left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread drivers/dahdi/xpp/xbus-sysfs.c Outdated
#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
Copy Markdown
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 3 times, most recently from 538b1c3 to 5c768e8 Compare March 4, 2026 17:29
@phoneben

phoneben commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

is this good ?

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.
@chrsmj

chrsmj commented Aug 14, 2026

Copy link
Copy Markdown

This patch lets it build on Debian 13 as well, thank you.

@chrsmj
chrsmj requested a review from push143smart August 14, 2026 02:40
@push143smart
push143smart merged commit 276c914 into asterisk:master Aug 14, 2026
1 check passed
@phoneben
phoneben deleted the from_timer branch August 14, 2026 07:12
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.

4 participants