Re: [PATCH] kbuild: simplify access to the kernel's version

Sasha Levin
2021-02-08T18:18:47Z

On Mon, Feb 08, 2021 at 04:28:00AM +0100, Sedat Dilek wrote:
>[ Please CC me directly ]
>
>Hi Sasha,
>
>I like that patch from [1].
>
>What was the Linux-source base?
>
>Searching in Linux v5.11-rc7:
>
>$ git grep -E 'LINUX_VERSION_CODE >> (16|8)'
>drivers/net/ethernet/mellanox/mlx5/core/main.c:
>(u8)((LINUX_VERSION_CODE >> 16) & 0xff), (u8)((LINUX_VERSION_CODE >>
>8) & 0xff),
>drivers/scsi/gdth.c: osv.version = (u8)(LINUX_VERSION_CODE >> 16);
>drivers/scsi/gdth.c: osv.subversion = (u8)(LINUX_VERSION_CODE >> 8);
>drivers/usb/core/hcd.c:#define KERNEL_REL
>bin2bcd(((LINUX_VERSION_CODE >> 16) & 0x0ff))
>drivers/usb/core/hcd.c:#define KERNEL_VER
>bin2bcd(((LINUX_VERSION_CODE >> 8) & 0x0ff))
>drivers/usb/gadget/udc/aspeed-vhub/hub.c:#define KERNEL_REL
>bin2bcd(((LINUX_VERSION_CODE >> 16) & 0x0ff))
>drivers/usb/gadget/udc/aspeed-vhub/hub.c:#define KERNEL_VER
>bin2bcd(((LINUX_VERSION_CODE >> 8) & 0x0ff))
>include/linux/usb/composite.h: bcdDevice =
>bin2bcd((LINUX_VERSION_CODE >> 16 & 0xff)) << 8;
>include/linux/usb/composite.h: bcdDevice |=
>bin2bcd((LINUX_VERSION_CODE >> 8 & 0xff));
>kernel/sys.c: v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
>
>So, drivers/scsi/gdth.c file is missing in your list of file:

Right. It's on it's way out: 0653c358d2dc ("scsi: Drop gdth driver").

In theory I should have fixed it too, but given that this patch is
cosmetic I just wanted to avoid unnecessary conflicts for SFR... If it
doesn't end up being removed we can always fix it up there.

--
Thanks,
Sasha