Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp18507lqf; Tue, 26 Mar 2024 12:52:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUAy4KRvw0bo0/Juaumaq5fqPJQHUhfCZ7J65k69drVccqnausX91dxyNz6smJLcRdO95l1fJOreA3CSCg5y85+yKWo916b6/M+9xhUlQ== X-Google-Smtp-Source: AGHT+IFkDzgX0Kn7Ec36Ip07XHX0PuinVbqmVwguHtDgeuRKh3HRdgmZNve9Tu+cMtN34XZxf7tg X-Received: by 2002:a17:90b:30c5:b0:29b:7206:7023 with SMTP id hi5-20020a17090b30c500b0029b72067023mr8607281pjb.12.1711482749454; Tue, 26 Mar 2024 12:52:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711482749; cv=pass; d=google.com; s=arc-20160816; b=dfYtq53JxNKHhdekVH2BQuaevvNBGX9mT2IS+UmTdXFnOvaPqzYBMrnesmJLhYYOYf 8bDhXr8qQLcMo9KJiDqNUFWqDxciQdVIVyib9T3ZbZVOXWcfJJKupYwT5A/rq8oKcUYb oP1HhzyFsCjm3gUYsPHsjbMmp2WuaKdwNcM1MHJfGA1Zs/c7e/59W7e/x+IA7duIQ6wX wms96epBix95FMrAuVXI9AuEm4n+ka16XyzyIafHuBQCQPYmFxB/mo1OymKu98kaNZfp lmCtyD4FpovMI5aKT5kccuxxfe8AoG1fBqZloUJVYnlG1usEeZ4Byu1X/J23c12iZxKM 2Kug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=vl3cf9QjdwMRhratQlnJ3dDgxi6fBhhAQ3qsq73UpKE=; fh=k2LvgK/KvGluEh1Wgl8WmU95UdPzp4Ti1j5mMYJ9bKc=; b=bzNW1LZeGwCQ+EePpLbgeteC04ITp25s86t92wG3/42DrW32MtH7LDKpfkGX/ljHtE jrqIELRwRjxb4+q+MqeB0m9YU2gw/oKL3n2FAtT52SkLfLCpjIhy8N29D5sCJDAknyRO b1tM3ttVJTrXgmIVovJa2KC/T7teLvkkR5gc56/KqQ5TAFDL9FcBBRqObG6xWMaES74G gieM5FyvdWFTNCLXX2u50YeZOnNTZ0JYvXbBVu5VL15OmsDuC/6SkFsiND0JvQV/RlrC s3B/aDCDbKm5cVY7gNnRreyubO+c1HorI8NjF3FBr5d10XmCeu1AWs4EmHPVsOpQ4Bco EJ5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-119838-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119838-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y10-20020a17090abd0a00b002a00bf17c94si10095175pjr.74.2024.03.26.12.52.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 12:52:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119838-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-119838-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119838-linux.lists.archive=gmail.com@vger.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 27D62327B51 for ; Tue, 26 Mar 2024 19:52:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BC2613D277; Tue, 26 Mar 2024 19:52:23 +0000 (UTC) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 06E8E13D258 for ; Tue, 26 Mar 2024 19:52:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711482742; cv=none; b=RykxMRMM90xpaFB8DMVi4k7PXNNlQ6JEKdOpXkfSyV6F6swW3oKszf3f1h0X9UCOryT6TS9okCuTbyZX0QqtcDHa0czX+1P1gqWEQauZr4S0x+Kz+7m+erLofwbP1WXibNSTzYItLzAkmL5gTYbAFf7zMfWj+UF1Z3pL1JtVxJA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711482742; c=relaxed/simple; bh=6s3IBjP+qBmimLtSS8MdyqdC4aiAyVCcFMCeaaXT0hI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=irgGZU8FANvOzC7BfjkzKZOb0sohHS8TztspdrkILBJuBDqgX4ylfYp3AXgmTkjNBkF/QMPEW2Mzw8iLyqrPN6G6XJ1j3UugiLLfEuV8iJhlDp82fObMN//AU1hW8UR7a/z7CPyx4vFf7b3f3qLPoZC6nvDLWRHMED+Ha5zKrN0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr; spf=pass smtp.mailfrom=ghiti.fr; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id 58212240005; Tue, 26 Mar 2024 19:52:15 +0000 (UTC) Message-ID: <13eb7c38-68da-4635-a713-5791d5294df2@ghiti.fr> Date: Tue, 26 Mar 2024 20:52:14 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] riscv: merge two if-blocks for KBUILD_IMAGE Content-Language: en-US To: Masahiro Yamada , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org References: <20240323113500.1249272-1-masahiroy@kernel.org> From: Alexandre Ghiti In-Reply-To: <20240323113500.1249272-1-masahiroy@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: alex@ghiti.fr Hi Masahiro, On 23/03/2024 12:35, Masahiro Yamada wrote: > 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)) You can add: Reviewed-by: Alexandre Ghiti Thanks, Alex