Skip to content

Commit

Permalink
Don't fail if this_cpu_inc does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Marturana committed Oct 5, 2017
1 parent b08ba64 commit 16ef7df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions driver/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,8 +1799,11 @@ static inline void g_n_tracepoint_hit_inc(void)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
this_cpu_inc(g_n_tracepoint_hit);
#else
/*
#elif defined(this_cpu_inc)
/* this_cpu_inc has been added with 2.6.33 but backported by RHEL/CentOS to 2.6.32
* so just checking the existence of the symbol rather than matching the kernel version
* https://github.com/torvalds/linux/commit/7340a0b15280c9d902c7dd0608b8e751b5a7c403
*
* per_cpu_var removed with:
* https://github.com/torvalds/linux/commit/dd17c8f72993f9461e9c19250e3f155d6d99df22
*/
Expand Down

0 comments on commit 16ef7df

Please sign in to comment.