Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2564328rbb; Wed, 28 Feb 2024 06:01:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUEZ8V18sYdIJwTD5h6glCc4YV+9wE/lez4gGVLHVxfSmbxArQa/qGQQ2GhtOyN9Mf96P3cgaO2VWr93LyD/A1vjav3GH9pmQ+ceCWMyQ== X-Google-Smtp-Source: AGHT+IFrrRQhOQ25W2nI8GOuMfIEuilzioYJVC9dLwOgpGIjk34+Q4iOHWJrw2xblZ4NybufZrVD X-Received: by 2002:a92:ce0e:0:b0:365:b570:cbbc with SMTP id b14-20020a92ce0e000000b00365b570cbbcmr2724827ilo.10.1709128886296; Wed, 28 Feb 2024 06:01:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709128886; cv=pass; d=google.com; s=arc-20160816; b=yPCwBG3hB0OwC+dwIOqix7Ju4dp2nJnJHDKJDTYaWT4jAi6w+ejGfXA7l/xojKcVzl fvlzA+ZbiNGeedpfi7vfN1rW3y+SeJaWFOPAm8b/KmfWCyvAvlygLJ1uZr4G4XHPfP4J TV7R/K8C76O+C2xSvrRpYXm8HaDUv8zPAk2ip1lBMZ/7vC6o+hKgufeK7/4TTMQtGe2p hoYv+Eey2KuLF0KIWUI2e+S+uAX/dfGT7dUTYkQXqyVNWFbqh+TfcjbRTJe7+TJH2kZy gX1iZLb9bMpS5GYKwX7gaLEJb8/z4WFsUuFEHvb0Z25VcjZ1fvdin8ybFTERzg/6OMwM +agQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=5CqHIB/+yVl7zUasDoEG1ZQzRHgoATSAN7WIOhikcvI=; fh=pROKrtudychdWfX1/6j/Uq9afXUKMuzpYQEwL/mZsxw=; b=yF4ZZCPXsDMiGSXacGRCV2SJGOxMS5K8yKL6w3f1/qmAorfe1bY8fIZjwQQhU0T1xA m30sH3jsdHFsUdSEmd6CnjxuGcBaIDjXW5IxRG/TIkDSbljd92hKdAX3slVwBEEDy0iw AoXjZnqQWzNixNaNo1Gk6JWgW5IA9tdGlc2m1hOjs4+cgkxtZ/1YJJ0BeKFzaEFTzLDY B6/S3zAOgfibpLDK1N8KVZ2CSAEtOAmfIuj8Ksgz/OsbGo3rwocllYmvMykT33en2txD I6xaDBfYZl2r+H64kE5hVIse6yKdgUeE8nupVy8qDRvUVWgukxsBPBwLP4ftW2CsSwEf NTxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85145-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 f1-20020a056e0204c100b003657afc0703si2811746ils.179.2024.02.28.06.01.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 06:01:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85145-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 (google.com: domain of linux-kernel+bounces-85145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85145-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 46DF22870EC for ; Wed, 28 Feb 2024 14:00:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E92415699F; Wed, 28 Feb 2024 14:00:24 +0000 (UTC) Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [195.130.137.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C55E215098D for ; Wed, 28 Feb 2024 14:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.89 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709128823; cv=none; b=IWdj8EvukAT6UQhVQnQ1eY4MG4TLOByf2JScXvLj8gxiIN9LbnmPEuCg/qkPnfbMp2LmJxIGS88YRerLOEnaZE8iGg8boL2iKDKgu3CN9h+LvE0KYb3J1/w5lKbUy14qdVW4677OOf5Zwk94HScFnQM/1Yi3YwhG0phEtHJWtS4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709128823; c=relaxed/simple; bh=G6EOV4ZQQfHL4BuKa3yWbKTAxpwYG330vI+JSSZwK9g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kf28Haelumbg+BwDNBpt039IlotigW7PMejILbpSEYZGReGSczFWH+ZkHI96SlBvOU4WX5u8ZehXaTDVkBwG5A6TCk7Y5BvN/55T1ge17aYscSnF9ZDDPdl55vSHEYflIkjS3zzJLFb5cDzVkmuj9JEyLLYmUMW4Z7Czi2LYpcM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:48c4:26a9:d9ec:22cb]) by laurent.telenet-ops.be with bizsmtp id se072B0034gWvPH01e07CA; Wed, 28 Feb 2024 15:00:13 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1rfKTV-001tZ9-DK; Wed, 28 Feb 2024 15:00:07 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1rfKTe-006hl9-S8; Wed, 28 Feb 2024 15:00:06 +0100 From: Geert Uytterhoeven To: Chris Down , Petr Mladek , Greg Kroah-Hartman , Andy Shevchenko , Jessica Yu , Steven Rostedt , John Ogness , Sergey Senozhatsky , Jason Baron , Jim Cromie , Ilya Dryomov , Xiubo Li , Jeff Layton Cc: linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 1/4] printk: Let no_printk() use _printk() Date: Wed, 28 Feb 2024 15:00:02 +0100 Message-Id: <56cf92edccffea970e1f40a075334dd6cf5bb2a4.1709127473.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When printk-indexing is enabled, each printk() invocation emits a pi_entry structure, containing the format string and other information related to its location in the kernel sources. This is even true for no_printk(): while the actual code to print the message is optimized out by the compiler due to the always-false check, the pi_entry structure is still emitted. As the main purpose of no_printk() is to provide a helper to maintain printf()-style format checking when debugging is disabled, this leads to the inclusion in the index of lots of printk formats that cannot be emitted by the current kernel. Fix this by switching no_printk() from printk() to _printk(). This reduces the size of an arm64 defconfig kernel with CONFIG_PRINTK_INDEX=y by 576 KiB. Fixes: 337015573718b161 ("printk: Userspace format indexing support") Signed-off-by: Geert Uytterhoeven --- include/linux/printk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index 8ef499ab3c1ed2ec..e4878bb58f663370 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -126,7 +126,7 @@ struct va_format { #define no_printk(fmt, ...) \ ({ \ if (0) \ - printk(fmt, ##__VA_ARGS__); \ + _printk(fmt, ##__VA_ARGS__); \ 0; \ }) -- 2.34.1