From patchwork Mon Dec 31 08:24:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154625 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp10684787ljp; Mon, 31 Dec 2018 00:24:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN7XvBE+6Tpkt9f9zr2tkKl7cAjAMhq1PkhmZx3Et9MQ2wb6scZuF0Jyn6TnKOQCNxgTTK0Z X-Received: by 2002:a63:60cf:: with SMTP id u198mr6855250pgb.323.1546244676981; Mon, 31 Dec 2018 00:24:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546244676; cv=none; d=google.com; s=arc-20160816; b=T1np7DvYXX/3npPFseJS5kj4woqOJr8HkdgIVAl08FRCNy6RCZtnP60yofWjM8uwSw 83zorO+PWcPWjm1XxSUd8myhCFr1kVEvQ+cr9Shb/Oi8Dh/Pr3gs/AALoDb5tdrkTRsi 5Wt8GcuvWbklRNn2r3cX5T6yLjOhye4tvYnwh+lrQFNSlTjT1WBeJN3W4zWTzVsmmr+D MUiuRZDbFzH3GWVLTzGw00p7d816nya+bcxJZz75Ef5ixpXFGgvC/hzYKyQ4yyL9Kaga 2yQ2AGjEatdKOjkj1uQ+i7OXd0r+2/nupRDvV5+98VrBEBs7904A4mECa6e2NzsjmdCW 0NSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=MSX7E/Yr9wKRJPYXLcNN01TdcBq4zxC6Gw6XsUjaLF4=; b=ffnV0SCUfom5C7zVD0Cn4DuIGcS8bvHiCzjmS3kiS+Rf8cT+p4TfTSZRxpVX9iTD4v vvosYP6bUekU1a0qvecR32/Ozgb1J+ONzp7v6BU4aDOR3XwMmf3JjqxNB/gywX/cjvBH Fx989QENWTLbE+eHQVrKWGI5dSgE4VxkrxBZ9WB5MdkFQTa0WJ4Fzwiqp3dInymKBzxX l1KDyrKOkKKiM/2ySUgZL4FL3UQBhQ3F/PHzNuLaD1kHbW0Y0WPLLaM5OgDHhShLxYpX see05ZShaE7LeAcMl7rE/bf1bDj4RSEpAYRjvjSXvnty64PO8xWfGaVTjcaAQVKnloga Ov1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=GgqVkxlL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i64si484478pge.361.2018.12.31.00.24.36; Mon, 31 Dec 2018 00:24:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=GgqVkxlL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727153AbeLaIYe (ORCPT + 31 others); Mon, 31 Dec 2018 03:24:34 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:31572 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbeLaIYc (ORCPT ); Mon, 31 Dec 2018 03:24:32 -0500 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBV8OIjs008355; Mon, 31 Dec 2018 17:24:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBV8OIjs008355 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1546244662; bh=MSX7E/Yr9wKRJPYXLcNN01TdcBq4zxC6Gw6XsUjaLF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GgqVkxlL2rzuH5ZCWkx9kSR2xufulpUA3iFmrIf1SfG9Vp+UrLBTJdafFnHYqsPq1 w2qrmJE2Slxtlh/schtjztYO5ypfWP+Hj/2c76xAxajTTBqZKCfE2ob9yMqgNlWYzl TnwWvcpX5H1kM2xfqQgapag1DMVOPtn1W338TaY5VtWJYlm07gZ4iSAwM5FDXFtgSU u9b/ko61kejrLas6I8YyjmR0nw9TDT73Vst4m3WtdILtc5h1sB/3izf+VHsAxLU5u+ RlE5pNOGKYMJQ8xcjNDenGdbNO9Yz/t0iwqakkQtjHG7r7su5wfV/4aVO06ynO6GzS BEDLyE7x/loBQ== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 4/4] kbuild: make LINUX_VERSION_CODE in more readable Date: Mon, 31 Dec 2018 17:24:11 +0900 Message-Id: <1546244651-10447-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546244651-10447-1-git-send-email-yamada.masahiro@socionext.com> References: <1546244651-10447-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 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