From patchwork Thu Sep 14 11:40:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9952877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78478602C9 for ; Thu, 14 Sep 2017 11:41:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4857828F21 for ; Thu, 14 Sep 2017 11:41:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D0FD28F42; Thu, 14 Sep 2017 11:41:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C7D3C28F21 for ; Thu, 14 Sep 2017 11:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=QaWlvoP6+z18OUt7OMF2MII0sBFAm8QOEGRYD8vhnPQ=; b=SnD yKdRCzLnt6tPHb+0JNC0eu4K2oSgZLsbxesN6K7zq8yw/JyxdU8Qms+zydnls1eFAwbcNYjPseqa0 vcWoOGvS0CkHcoSbOi4Q2vOy40xLg/t4V268bBTKcAjRHw/RPMSr2B4w/n6jli69UNmJSMQ3t/PD2 7ddvvlu9hjmlFW/q3sN9+8roa0YxtfugDtl4n5QPTdNYBR39MV2uKbOMoi4yZIH7AmxyCmGycLi0j qA0Z6RObuaDKQzeL6RPjKQwFMCKqm/PDnWad7HJDc9EPS5E0TP3YUWcr21Q6i2m4czcJHyKcyzcAS plEYFwnd40dDbsjhnXq2cDcMfVcgbWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dsSWg-0007WT-3Y; Thu, 14 Sep 2017 11:41:46 +0000 Received: from conuserg-12.nifty.com ([210.131.2.79]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dsSWc-0007Tq-2l for linux-arm-kernel@lists.infradead.org; Thu, 14 Sep 2017 11:41:44 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id v8EBeX4m004121; Thu, 14 Sep 2017 20:40:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v8EBeX4m004121 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505389235; bh=8p6CErog2VDYcdzg5AWkjISENBK47U3vBKPMsJFtVaw=; h=From:To:Cc:Subject:Date:From; b=gMRG+f+9woehcbP1Ve+XCHaBw2Fn5qCWQWCO9vbs4UoDqy9VpRZBhK6Mqqag7i0Gi YxkRgxbGxJzt8bwkNUAwggvNtwQ2onXTLrs5/oC4NESNaP1tO63cywKMlMHKZrw+dD 0gPCKs3qDuryIMLStN4eQunCNXNAo8GE3Q6MIp4RWDM8GUBf4ZytyeXezHg22QaDiE esOOsHSQGpdmPREdI6RtVPsF7ikIH1tEd5q7GTwpk7CX6DrltnclO4NGFSGVdT54gS pBQuqvkU+4/zg3LSNZJx5cee9RbFaxlWEIFO8IyLBhaWKrsXS4jZd4Zr5CHpfs0K83 YZlgOJjpvLcHw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-arm-kernel@lists.infradead.org, Will Deacon , Catalin Marinas Subject: [PATCH] arm64: remove unneeded copy to init_utsname()->machine Date: Thu, 14 Sep 2017 20:40:04 +0900 Message-Id: <1505389204-17231-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170914_044142_393995_0D14EE5D X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Geert Uytterhoeven , AKASHI Takahiro , Ard Biesheuvel , linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek , James Morse , Laura Abbott , Ingo Molnar , Alexander Popov MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As you see in init/version.c, init_uts_ns.name.machine is initially set to UTS_MACHINE. There is no point to copy the same string. I dug the git history to figure out why this line is here. My best guess is like this: - This line has been around here since the initial support of arm64 by commit 9703d9d7f77c ("arm64: Kernel booting and initialisation"). If ARCH (=arm64) and UTS_MACHINE (=aarch64) do not match, arch/$(ARCH)/Makefile is supposed to override UTS_MACHINE, but the initial version of arch/arm64/Makefile missed to do that. Instead, the boot code copied "aarch64" to init_utsname()->machine. - Commit 94ed1f2cb5d4 ("arm64: setup: report ELF_PLATFORM as the machine for utsname") replaced "aarch64" with ELF_PLATFORM to make "uname" to reflect the endianness. - ELF_PLATFORM does not help to provide the UTS machine name to rpm target, so commit cfa88c79462d ("arm64: Set UTS_MACHINE in the Makefile") fixed it. The commit simply replaced ELF_PLATFORM with UTS_MACHINE, but missed the fact the string copy itself is no longer needed. Signed-off-by: Masahiro Yamada --- arch/arm64/kernel/Makefile | 2 -- arch/arm64/kernel/setup.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index f2b4e81..29764d7 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -10,8 +10,6 @@ CFLAGS_REMOVE_ftrace.o = -pg CFLAGS_REMOVE_insn.o = -pg CFLAGS_REMOVE_return_address.o = -pg -CFLAGS_setup.o = -DUTS_MACHINE='"$(UTS_MACHINE)"' - # Object file lists. arm64-obj-y := debug-monitors.o entry.o irq.o fpsimd.o \ entry-fpsimd.o process.o ptrace.o setup.o signal.o \ diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index d4b7405..b2fdb59 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -246,7 +245,6 @@ void __init setup_arch(char **cmdline_p) { pr_info("Boot CPU: AArch64 Processor [%08x]\n", read_cpuid_id()); - sprintf(init_utsname()->machine, UTS_MACHINE); init_mm.start_code = (unsigned long) _text; init_mm.end_code = (unsigned long) _etext; init_mm.end_data = (unsigned long) _edata;