From nobody Sat Sep 28 10:38:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XG3hb34jyz5X8SS; Sat, 28 Sep 2024 10:38:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XG3hb0Lysz470R; Sat, 28 Sep 2024 10:38:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727519903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W9URgyKzT0eMv7evW5XZfydzb7C/8atQ64obH8el3O0=; b=eOWTMybI9LovldsHZx2C5+fP4ZbEPwK8LzGn/hx7sWgYIq7FJAlYTN1lXUY80KiUZUsDUK JM5HDPDTSLXCzG2lv/ywrS2YoErug1Z6L4uuthAgKynKP5dfvWPszJo/ud7Un6wGZGfaZr 3V4AinoS/MnOKUryt8V1wmqKqS8fBmxrFikNQVxHPTdDcFb9RGQxqdIab1VorUjvwL1FNH et0sKV5xe/nSdhftCBu9vXDCyYOQraotcG6/Ta+oyYk8sNHm0FAHrIPzqnRttGkxJlJjyb Esaub69IvcsiyLXpH3Ah/BkoMDHIcWbYbNadGz2zrlZBJZ/9XrzwsWig/ml9nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727519903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W9URgyKzT0eMv7evW5XZfydzb7C/8atQ64obH8el3O0=; b=yTWGl1k5jk4AEECFtaqbWUjhk8KFFaQlqtxigZYyM+8kvSDsitORNNa7xDnZ7AU0i4YPOn /u6QIfN9j9Hb8UPk8RmdKBu/uHeZfElWuVMd3i59Jqp5KJ6ovq1rPFg2JI/rUkzVOHdUmb yU7fVLATApkRHLkISoWFhW/j6Fb8sB2ZOQ1ySPisuUerfNHactPa3vGIxFZGVuy6JvrJkO KcYeJk/UNv7gjgmlRTcPll3WBlBMtdVFQL+qh543jtnUgk+qL6Z///F/6mtzKfoo1MBObw fwk53NcLJMcG0O9CiBu0ojvgV7v9D4NlT1cmZGNq1tRkL071SQK9cdtlD0VxQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727519903; a=rsa-sha256; cv=none; b=CRAn7RVTB15uVeHS5Y9JzCHBHL8vKtpwDPFvs6rAeGApfPJFT56dftoZB4ogw8L2h8XZqX qzJ/b50ae6f/nmAtYY3d4Pn+ptwLDa+DMLA/dNdPmeSA540eQzlAabRGBv8VEk6k0SMNve EUY1NxZ099ieENvAOJx4aR3oBy0orSS06gVIjKirmgLoNp3j2BIWXrWHrQyzG39b5gRpXL Jxg9hB+8rHNHadrImQPFXYd9iY1Kgc5f8rpdZQdapl/V8xTJEUynU4MqosviNvK6O5ZqXD kWfmoLggCM4ec/AhVtcnJPmfk6RaZ0h6adD3lrLxk9GhgFIhnY3i5HedqiZ6AQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XG3hZ74f7zLrF; Sat, 28 Sep 2024 10:38:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48SAcMsm098146; Sat, 28 Sep 2024 10:38:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SAcMw5098143; Sat, 28 Sep 2024 10:38:22 GMT (envelope-from git) Date: Sat, 28 Sep 2024 10:38:22 GMT Message-Id: <202409281038.48SAcMw5098143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: cedae002cba4 - stable/14 - LinuxKPI: add no_printk List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cedae002cba47fbeb5e0de2393eb3a4673590019 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=cedae002cba47fbeb5e0de2393eb3a4673590019 commit cedae002cba47fbeb5e0de2393eb3a4673590019 Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 21:12:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-09-28 10:35:14 +0000 LinuxKPI: add no_printk Add a version of no_printk(), which seems to be there to have format string checking while never calling the printk. It seems a very weird thing and it needs a return code and for some reason my initial while (0) { } version hadn't worked while porting over new code but could have been further downstream format string problems. if (0) seems to do the job though I would have expected that to more likely simply get optimised out without any futher format checking. Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46463 (cherry picked from commit 1847e63d63f440cfcb2f4ee2c2ee8990f0272d88) --- sys/compat/linuxkpi/common/include/linux/printk.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/printk.h b/sys/compat/linuxkpi/common/include/linux/printk.h index 933d5aa6f94a..3840a6e5fb8a 100644 --- a/sys/compat/linuxkpi/common/include/linux/printk.h +++ b/sys/compat/linuxkpi/common/include/linux/printk.h @@ -125,4 +125,11 @@ print_hex_dump_bytes(const char *prefix_str, const int prefix_type, #define pr_info_ratelimited(fmt, ...) \ printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define no_printk(fmt, ...) \ +({ \ + if (0) \ + printk(pr_fmt(fmt), ##__VA_ARGS__); \ + 0; \ +}) + #endif /* _LINUXKPI_LINUX_PRINTK_H_ */