From patchwork Sun Feb 19 14:15:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13145890 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D61DC677F1 for ; Sun, 19 Feb 2023 14:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbjBSOQ3 (ORCPT ); Sun, 19 Feb 2023 09:16:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230071AbjBSOQ2 (ORCPT ); Sun, 19 Feb 2023 09:16:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A76F8E3AB; Sun, 19 Feb 2023 06:16:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1AA47B808BC; Sun, 19 Feb 2023 14:16:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09A25C4339B; Sun, 19 Feb 2023 14:16:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676816184; bh=OnHesLJjuM4ndL0bx3IO8J099WVFzKW7b0gcW6zf1HY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a6MPY1We5Gq+eXc22qp3LVBeZjtQ1Z9K4zYmKOTvBgVXpowHgmidtMRl1lnjX+aHe cSwsOa/qSSgrAzai3J6hOjqO7LeJjSxQ6oT/URE6opE63Aff3BmdfC0ENb9J1rixzT PHWkYFqeV33fWe0ka3FmpdvF7j8kHwzG01HzNZDrJ0a5ednegxyLc/GpMafMluz80x g7dyQAGoHWthtQ+b7M6pDjzdEW/ekzY0vhkK6vtGsxwjILKNnG99lWS/fFhh9QUdkS cgES0y3+Bqv99Lk08ydycZp0whkYF4a4j6ajTrlIgfmiR8l/llkW/wifvURuSel9WM Kkj0Z+DaVdGqA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Randy Dunlap , Masahiro Yamada , Rich Felker , Yoshinori Sato , linux-sh@vger.kernel.org Subject: [PATCH 4/4] sh: remove compiler flag duplication Date: Sun, 19 Feb 2023 23:15:55 +0900 Message-Id: <20230219141555.2308306-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230219141555.2308306-1-masahiroy@kernel.org> References: <20230219141555.2308306-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Every compiler flag added by arch/sh/Makefile is passed to the compiler twice. $(KBUILD_CPPFLAGS) + $(KBUILD_CFLAGS) is used for compiling *.c $(KBUILD_CPPFLAGS) + $(KBUILD_AFLAGS) is used for compiling *.S Given the above, adding $(cflags-y) to all of KBUILD_{CPP/C/A}FLAGS ends up with duplication. Add -I options to $(KBUILD_CPPFLAGS), and the rest of $(cflags-y) to KBUILD_{C,A}FLAGS. Signed-off-by: Masahiro Yamada Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: John Paul Adrian Glaubitz --- arch/sh/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/sh/Makefile b/arch/sh/Makefile index f1c6aace8acb..cab2f9c011a8 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -145,10 +145,8 @@ cpuincdir-y += cpu-common # Must be last drivers-y += arch/sh/drivers/ -cflags-y += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y)) - +KBUILD_CPPFLAGS += $(addprefix -I $(srctree)/arch/sh/include/, $(cpuincdir-y) $(machdir-y)) KBUILD_CFLAGS += -pipe $(cflags-y) -KBUILD_CPPFLAGS += $(cflags-y) KBUILD_AFLAGS += $(cflags-y) ifeq ($(CONFIG_MCOUNT),y)