arm64: remove unneeded copy to init_utsname()->machine
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 14 Sep 2017 11:40:04 +0000 (20:40 +0900)
committerWill Deacon <will.deacon@arm.com>
Mon, 2 Oct 2017 09:13:05 +0000 (10:13 +0100)
commitc2f0b54f10b12620c57f6e31233589b704a00ed5
tree01c320cd6a06e4794ae93eb1344a7167ca989721
parentf67d5c4fbe8051af33e9109aa3d3024602d29474
arm64: remove unneeded copy to init_utsname()->machine

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 <yamada.masahiro@socionext.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/Makefile
arch/arm64/kernel/setup.c