diff options
author | Sasha Levin <sashal@kernel.org> | 2021-02-12 11:29:24 -0500 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2021-02-16 12:01:45 +0900 |
commit | 88a686728b3739d3598851e729c0e81f194e5c53 (patch) | |
tree | 4de7baef4769c087f14d7aef4f0b4803cd290706 /drivers/net | |
parent | 9b82f13e7ef316cdc0a8858f1349f4defce3f9e0 (diff) | |
download | linux-stable-88a686728b3739d3598851e729c0e81f194e5c53.tar.gz linux-stable-88a686728b3739d3598851e729c0e81f194e5c53.tar.bz2 linux-stable-88a686728b3739d3598851e729c0e81f194e5c53.zip |
kbuild: simplify access to the kernel's version
Instead of storing the version in a single integer and having various
kernel (and userspace) code how it's constructed, export individual
(major, patchlevel, sublevel) components and simplify kernel code that
uses it.
This should also make it easier on userspace.
Signed-off-by: Sasha Levin <sashal@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index ca6f2fc39ea0..29f886263dc5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -235,8 +235,8 @@ static void mlx5_set_driver_version(struct mlx5_core_dev *dev) remaining_size = max_t(int, 0, driver_ver_sz - strlen(string)); snprintf(string + strlen(string), remaining_size, "%u.%u.%u", - (u8)((LINUX_VERSION_CODE >> 16) & 0xff), (u8)((LINUX_VERSION_CODE >> 8) & 0xff), - (u16)(LINUX_VERSION_CODE & 0xffff)); + LINUX_VERSION_MAJOR, LINUX_VERSION_PATCHLEVEL, + LINUX_VERSION_SUBLEVEL); /*Send the command*/ MLX5_SET(set_driver_version_in, in, opcode, |