From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8D47C433E6 for ; Sat, 6 Feb 2021 14:32:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75BAB64EC5 for ; Sat, 6 Feb 2021 14:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230120AbhBFOb7 (ORCPT ); Sat, 6 Feb 2021 09:31:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:43442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbhBFOb5 (ORCPT ); Sat, 6 Feb 2021 09:31:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4A35264E2C; Sat, 6 Feb 2021 14:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612621876; bh=t1nxghJC+uJ17Dk0GZXqp+NfezDcXVNpaGO/kJgdTHY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PSpEYRP7aWh02tbsPE9rgn3LLCBOp0nBXTHAllTcymz+44qZdy6o89F6iaRsmaNdm JjGl5SXOd2XgJKVkzgs5M5zuhxM3ZO9R7aHlJjcCgXKhd7+A+t51V2daFfuAVBTYgd yM1PAwmc9iVyPZ+R66Szyph5YtJHiheWUpKJOl7LwdrGNhTKGkVArjkkNj/d9qi6Xj fhg3qhH9uroX8OsWJ+OhpUfvaQ0pr/kPvCSoVP+rkBoH0Su0CpNufXeEj8mtu9erVQ 94zHmwNMHNB43KEiUYtmwL779JfB9S03ahtMPyN6UPwuhIUl/sRHb3INwtNWMKJ7ea AtjsOfff5OiaQ== Date: Sat, 6 Feb 2021 09:31:15 -0500 From: Sasha Levin To: Masahiro Yamada Cc: Michal Marek , Linux Kbuild mailing list , Linux Kernel Mailing List , Linus Torvalds , Greg Kroah-Hartman , stable@kernel.org Subject: Re: [PATCH 3/3] kbuild: introduce KERNEL_VERSION2 and LINUX_VERSION_CODE2 Message-ID: <20210206143115.GX4035784@sasha-vm> References: <20210206035033.2036180-1-sashal@kernel.org> <20210206035033.2036180-3-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 06, 2021 at 09:45:44PM +0900, Masahiro Yamada wrote: >On Sat, Feb 6, 2021 at 12:50 PM Sasha Levin wrote: >> - ((c) > 255 ? 255 : (c)))' >> + ((c) > 255 ? 255 : (c)))'; \ >> + echo \#define LINUX_VERSION_CODE2 $(shell \ >> + expr $(VERSION) \* 16777216 + 0$(PATCHLEVEL) \* 65536 + 0$(SUBLEVEL)); \ > > >Is this needed? >No one in this patch uses LINUX_VERSION_CODE2. > >The in-kernel code can use >LINUX_VERSION_MAJOR/PATCHLEVEL/SUBLEVEL directly. > > >Userspace does not need LINUX_VERSION_CODE2 either. > >Your comment in 2/3 states that >userspace only decodes MAJOR and PATCHLEVEL fields, >so LINUX_VERSION_CODE will still do well. Yes, that's fair. I wanted to have that to make it easy for out of tree code to handle in-kernel ABI changes but as we don't care about such code there's no strict need for LINUX_VERSION_CODE2. I'll drop it. >> index ab4b98b3165db..a56bf381335e9 100644 >> --- a/tools/perf/tests/bpf-script-example.c >> +++ b/tools/perf/tests/bpf-script-example.c >> @@ -5,7 +5,7 @@ >> */ >> #ifndef LINUX_VERSION_CODE >> # error Need LINUX_VERSION_CODE >> -# error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x40200" into llvm section of ~/.perfconfig' >> +# error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x4020000" into llvm section of ~/.perfconfig' > > >Is this change needed? Good point, no. I'll resend. -- Thanks, Sasha