SLED 15 SUSE Release version macro to check supported kernel API's

SUSE 15 kernel have backported many kernel api’s from higher linux version to SUSE 15 kernel(4.12.14).
Do SUSE provide release version macro to check supported kernel API’s.
RHEL also does same but RHEL provide “RHEL_RELEASE_VERSION” macro to check supported API version.

Does SUSE also have any such macro to get released version?

There is no way to check for “supported kernel APIs” for the simple reason - there is no definitive list of APIs and their versions.

RHEL also does same but RHEL provide “RHEL_RELEASE_VERSION” macro to check supported API version.

You are mistaken. Macro RHEL_RELEASE_VERSION has nothing to do with kernel API. As its name suggests, it is simply version of RHEL for which this kernel was built. Nothing more. It tells you nothing about whether some kernel API was changed in this particular kernel or whether kernel APIs in RHEL_RELEASE_VERSION 1794 are actually compatible to (or are super set or subset of) kernel APIs in RHEL_RELEASE_VERSION 1793.

Does SUSE also have any such macro to get released version?

If all that you are after is (open)SUSE distribution version number:

## SUSE Release Details
#
CONFIG_SUSE_PRODUCT_SLE=y
# CONFIG_SUSE_PRODUCT_OPENSUSE_LEAP is not set
# CONFIG_SUSE_PRODUCT_OPENSUSE_TUMBLEWEED is not set
CONFIG_SUSE_PRODUCT_CODE=1
CONFIG_SUSE_VERSION=15
CONFIG_SUSE_PATCHLEVEL=2
CONFIG_SUSE_AUXRELEASE=0
CONFIG_SUSE_KERNEL_SUPPORTED=y
# CONFIG_SUSE_KERNEL_RELEASE is not set
# end of SUSE Release Details

Thanks arvidjaar,

In linux kernel verion 4.12.14, we see release pages defination as “void release_pages(struct page **pages, int nr, bool cold);”
but from linux version 4.15 api defination is “void release_pages(struct page **pages, int nr);”
SUSE 15 kerenl verion is 4.12.14 but it has newer defination of api “void release_pages(struct page **pages, int nr);”

if i am developing a kernel module for 4.12.14 kernel i expect it work every where with same kernel verion but it breaks in SUSE 15. How i solve this issue?

Why your question may be more general, I want to bring to your attention that these are the openSUSE forums and NOT the SLES/SLED forums.

You should have gone to https://forums.suse.com/forum.php
Same username/password as here.

You check whether you are building for (open)SUSE kernel and then check for specific (open)SUSE kernel or distribution version.

it just not SUSE but problem exist in openSUSE also and I already posted it on [LEFT]SLES/SLED forums.[/LEFT]

Code becomes deficult to maintain and this is not scalable solution.

As I said, it seems to be a more general question, but you nowwhere hinted at knowing where you are, on the contrary by telling us explicitly that it is about SLED 15.

Nor did you BTW explain which application you are asking about in this Applications sub-forum.

i am new to this forum and will appreciate if you guide me to right place.

Wll, you still did not tell us what application this is about or what you are trying to achieve…

From a quick look to me it is more developement. And as you should have seen, we have a Development part with several sub-forums.

When you want this to be moved somewhere there, please ask (and please do not start a second thread about the same subject there).

I am trying to write driver for my FPGA card. This driver will be used by user space application to access hardware.
Please move this post to right sub-forum.

Well, as you (knowing much better then I what you are doing and from what sort of people you want help) seem to have problems choosing the most fitting sub-forums within Development, I moved it to Development > Programming/Scripting.

That is exactly what RHEL_RELEASE_VERSION does. You yourself said it is sufficient for you. What makes SUSE macros more difficult and less scalable?