Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1676185lqp; Sat, 23 Mar 2024 04:35:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvQtMy+zWFgQU5o1O7JMgwbl1g6hTJX+ZWzwSkr4o7YMfcTWH7Y1V12rwP6Fj5+pv3ue1t6el9svsbYFxIwBr6M2s+jYgprPFAiyHfqg== X-Google-Smtp-Source: AGHT+IHpC9YteiKeIeNUkoU9rDB3uQdMMDs8BtFpn766QCAKSiELX4A/d0B5i9elYQZdGgMAa8qP X-Received: by 2002:a05:6a00:80f:b0:6e8:a703:d911 with SMTP id m15-20020a056a00080f00b006e8a703d911mr2284141pfk.1.1711193720283; Sat, 23 Mar 2024 04:35:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711193720; cv=pass; d=google.com; s=arc-20160816; b=Dt0fhvdpW5sG0yvwWtp+2HYSCL2bhToYxjSJZ8cgZbmYDogXPPwtElL20RUketUcGq rOYa8rR9pHegEFUpyGGTaKQwd1TbEpQRVnQFYIznC4lMDdH9EcH3Nbv9/FrcZIQ9tr7Q BwO9DEcWtDOxjKFdlQ3hc4JFKUTLnQ0A3yCe/uwiM+nAf72IP8PyoTCeu+ut+Konw25t gxInj6dRQidJGFLFV3DEmHfEsOM6B9g8XnNHEBwog7QR3Y71IkazfONnOXkDOcBzlngc fdNChwB4Q/7d/2y5WXPZFS9gphukjPLqi5CCw5qWLGydL+n5lXBMMmeSswgC01JWNHyd Qkew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=pfvci262wpi9Db9APCaPl8+cPg4cackEymsOCZcluZ0=; fh=hgLCm/Y8NHdmEmc4VmlrfA93JDtWn0wUUP0uNnU6rCM=; b=E5yDXEEoInonsfptQSefM2qTzT1udPaXpzjmptffNIZ3R/tosK5j9jiF//lLMzHw9x 8suL/pwkEId4Phb1zWPXLEpnvoy7Bkn4HuB19jOB7x5ie4lEoDyWdt/y1XPh+ICaVhEm mpdlHczeSc41Y46kr/nQCvIXn/vUNChk3Kyxqbg1DnZ+O6FgjQElsu82EvQNqTJ/xhQa MZ0s2ITmDh4xjtYf5D5jyZq+U5cvZqy+8x3CZpQ6sT21XH904C5LBKNhNl7NPFhO2tDO To335TjrvQizgG7HoFQ33amR/gW5xMJnvtkzrjvpYu6WtTRzBn7f0sS0LwgW+u89kTa9 iE0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HLIkyaAV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112314-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112314-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o15-20020a056a001b4f00b006e747cba5c9si1399112pfv.310.2024.03.23.04.35.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 04:35:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112314-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HLIkyaAV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112314-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112314-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EAF4F282778 for ; Sat, 23 Mar 2024 11:35:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB37E171BF; Sat, 23 Mar 2024 11:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HLIkyaAV" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E20C013FEA for ; Sat, 23 Mar 2024 11:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711193714; cv=none; b=EzEU8G1AFh8XStDys7zHB4pDeuWaao6ucHMjnoLyj83add8FqZ/ddJcqQt3Neg/9HeCIjaWuaCfF+WYCgvrBuiQokqBRS7xCH9wO8/QhH/c6a5eyeCb5SWuf2cOdBZu2OUJLi5JTzdAMXNAbFWFoG8vgCS1aMHO2qckpcVhsoXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711193714; c=relaxed/simple; bh=s3Msyc9z8t/gpktSf5g/K9aT1iYIR1/xxL+MBJH1F94=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=fVGAHY5neG0n0IvduWHc368Yq14wjic8HLj95TuPX12OnuKsV0ewptyL/aJNJPAkz+9SolRnFgJhMuF1KKl+94c/kLULhLn2ICEDasBTBtyc1mBGfBL7W7GOIL8k7NQdhHQW7NjibSKYb4L2dH6+TKoZW83DtwFHiZhpwai4OGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HLIkyaAV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2199C433C7; Sat, 23 Mar 2024 11:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711193713; bh=s3Msyc9z8t/gpktSf5g/K9aT1iYIR1/xxL+MBJH1F94=; h=From:To:Cc:Subject:Date:From; b=HLIkyaAVFf3l3DbhPZk9xviQiFV/PGYTECEs1BTZqZnoenoLlJYx1xvTka2Xflj4s K1kxHD1db8ZLETyX1l9dUaYRgOQyqT53YjWx08x6nEtjpj4z45UYo+7Nb+KgelULNi 7QeXf8ZtKyST67cH3XrYNk+F4uf0AxxF6fJSC/zVhbvexyyO5IQ939J6JP8I4VJe7v jLV3DY+mPInjpatl7g5TE3wqNDFCSRV2jW71xeMx0MkyCA9i8TE4Dvwt7jOvJKIeKx 1J1fGPX4n4ButwoQSsqJrJVfUZzbUGsNcfM4/B8Z0lIm4bB0Xpjk3m8GLFTBuFT7h3 IhsT5FtpJ+WUw== From: Masahiro Yamada To: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH] riscv: merge two if-blocks for KBUILD_IMAGE Date: Sat, 23 Mar 2024 20:35:00 +0900 Message-Id: <20240323113500.1249272-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In arch/riscv/Makefile, KBUILD_IMAGE is assigned in two separate if-blocks. When CONFIG_XIP_KERNEL is disabled, the decision made by the first if-block is overwritten by the second one, which is redundant and unreadable. Merge the two if-blocks. Signed-off-by: Masahiro Yamada --- arch/riscv/Makefile | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 252d63942f34..a74e70405d3f 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -133,7 +133,15 @@ boot := arch/riscv/boot ifeq ($(CONFIG_XIP_KERNEL),y) KBUILD_IMAGE := $(boot)/xipImage else +ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy) +KBUILD_IMAGE := $(boot)/loader.bin +else +ifeq ($(CONFIG_EFI_ZBOOT),) KBUILD_IMAGE := $(boot)/Image.gz +else +KBUILD_IMAGE := $(boot)/vmlinuz.efi +endif +endif endif libs-y += arch/riscv/lib/ @@ -153,17 +161,6 @@ endif vdso-install-y += arch/riscv/kernel/vdso/vdso.so.dbg vdso-install-$(CONFIG_COMPAT) += arch/riscv/kernel/compat_vdso/compat_vdso.so.dbg:../compat_vdso/compat_vdso.so -ifneq ($(CONFIG_XIP_KERNEL),y) -ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy) -KBUILD_IMAGE := $(boot)/loader.bin -else -ifeq ($(CONFIG_EFI_ZBOOT),) -KBUILD_IMAGE := $(boot)/Image.gz -else -KBUILD_IMAGE := $(boot)/vmlinuz.efi -endif -endif -endif BOOT_TARGETS := Image Image.gz loader loader.bin xipImage vmlinuz.efi all: $(notdir $(KBUILD_IMAGE)) -- 2.40.1