mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] kbuild: make LINUX_VERSION_CODE in <linux/version.h> more readable
Date: Mon, 31 Dec 2018 17:24:11 +0900	[thread overview]
Message-ID: <1546244651-10447-4-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1546244651-10447-1-git-send-email-yamada.masahiro@socionext.com>

Makefile does not need to calculate LINUX_VERSION_CODE.
Let's leave it to the preprocessor.

This commit changes include/generated/uapi/linux/version.h as follows:

Before:

  #define LINUX_VERSION_CODE 267264
  #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

After:

  #define LINUX_VERSION_CODE KERNEL_VERSION(4, 20, 0)
  #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

The latter is more human-readable in my opinion.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 437d603..1ebf5ed 100644
--- a/Makefile
+++ b/Makefile
@@ -1131,8 +1131,7 @@ define filechk_utsrelease.h
 endef
 
 define filechk_version.h
-	echo \#define LINUX_VERSION_CODE $(shell                         \
-	expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
+	echo '#define LINUX_VERSION_CODE KERNEL_VERSION($(VERSION), $(PATCHLEVEL), $(SUBLEVEL))'; \
 	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
 endef
 
-- 
2.7.4


  parent reply	other threads:[~2018-12-31  8:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-31  8:24 [PATCH 1/4] kbuild: remove redundant target cleaning on failure Masahiro Yamada
2018-12-31  8:24 ` [PATCH 2/4] kbuild: change filechk to surround the given command with { } Masahiro Yamada
2018-12-31  8:24 ` [PATCH 3/4] kbuild: remove unnecessary in-subshell execution Masahiro Yamada
2018-12-31 10:21   ` kbuild test robot
2018-12-31 10:52   ` kbuild test robot
2018-12-31  8:24 ` Masahiro Yamada [this message]
2019-01-03  1:14   ` [PATCH 4/4] kbuild: make LINUX_VERSION_CODE in <linux/version.h> more readable Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1546244651-10447-4-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®