Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1262600pxv; Fri, 23 Jul 2021 04:11:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjPNely/mGE0vnhjRpr/VKXieK8+6vOAGrZuRbu0s4pgK7Bb+KYD2M+J0b/Bfiv9RdP1SH X-Received: by 2002:a5d:904b:: with SMTP id v11mr3733458ioq.7.1627038704719; Fri, 23 Jul 2021 04:11:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627038704; cv=none; d=google.com; s=arc-20160816; b=QRXy8ocfPaCgafEG9mDf0eEyMO4W2Zj7hEl+WbwBIJOKM3ziAxFUpHSCSNaORLf4NC qkFTowroT4MzJ6EpULGD/vJxPR5fl1UcDQXq/2KgaSpmgjuU7DqyljqVr0emVaXb0gap aHb/iTkKabicomD6Tke3QXP9YnyIt9T1KCtqor/xo8+0iO0w/bBBlSiOgymVidbL7TMI OoWmyrDRZ3xiTQg8b81Y33MXvjhHZ1ROsxKCSRkkAvB/iijY+ZEf3vZlK7KWOQb7YMd7 0p07cm777HZD5M4VvZOk2knfajdUi2bliY7+1R/ESQ0lJQEu5GJQd5hfSzA2abI2VNpl pDwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5/VuAuA8TTB/OqfzWiuUX41Ip/fB8TlfGEDwF7IigoI=; b=jLYscUtZtFVekj5sLxYtIwzbal/pgH/fAT/0qjw5wNtErcOrRuhVUhcCLSDdGDkYZ+ cVwPRZpoH/c0JfvP/Q9Q2oT0hJDlS0WEhFmeH6bwj3awm7+QQB4QVaft+LE8xEs0BCV3 Va01VpwcLfKCZiHZlNPor1uF37J0RCYAZl2msS+RPmPAoltb/VT64wKhG21OFvrELauH JGra7Goz4+gFa0q3H130TInYwPdwSNcFXgZX6ZfsdgxrPZZorGgcXbWvm4ONl3H4LZJ2 EexFoJ3qsxwC5nHHSqHZWVzOxzj/omYMPBmXsCLWDqcC9BIGHV2OT+zDgJALLk83c3Ka Kosg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=FOb+yjQ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si33011073ioh.102.2021.07.23.04.11.33; Fri, 23 Jul 2021 04:11:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=FOb+yjQ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234296AbhGWK3O (ORCPT + 99 others); Fri, 23 Jul 2021 06:29:14 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:60006 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232037AbhGWK3K (ORCPT ); Fri, 23 Jul 2021 06:29:10 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 34A9C22651; Fri, 23 Jul 2021 11:09:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1627038583; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5/VuAuA8TTB/OqfzWiuUX41Ip/fB8TlfGEDwF7IigoI=; b=FOb+yjQ4MaUhNtGGVRPLDb3vtFN1lm1zxb1S6okTAfRpEAGH8+DKFbA4+88rj2N350mNbM MtL9b8vXxFE4xwjsEAWV2/+BnPwF+D5Ttn1+aWSCngkpa12R2nWT2x9Asp4UwzEjObAnaA JLbd+Ll+2ys0QvDl2ygoyBx0Hc2+IPA= Received: from suse.cz (unknown [10.100.224.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 06037A3B84; Fri, 23 Jul 2021 11:09:42 +0000 (UTC) Date: Fri, 23 Jul 2021 13:09:42 +0200 From: Petr Mladek To: Chris Down Cc: Stephen Rothwell , Jonathan Corbet , linux-doc@vger.kernel.org, Linux Kernel Mailing List , Linux Next Mailing List Subject: [PATCH] printk/documentation: Update printk()/_printk() documentation Message-ID: References: <20210720162423.75f61ce0@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 337015573718b161 ("printk: Userspace format indexing support") caused the following warning when building htmldocs: kernel/printk/printk.c:1: warning: 'printk' not found The problem is that printk() became a macro that is defined in include/linux/printk.h instead of kernel/printk.c. The original function was renamed to _printk(). Fixes: 337015573718b161 ("printk: Userspace format indexing support") Reported-by: Stephen Rothwell Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/YPbBfdz9srIpI+bb@chrisdown.name --- This should do the trick. I do not longer see the warning. Documentation/core-api/printk-basics.rst | 6 +++--- include/linux/printk.h | 12 ++++++++++++ kernel/printk/printk.c | 3 ++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Documentation/core-api/printk-basics.rst b/Documentation/core-api/printk-basics.rst index 965e4281eddd..3160a73c27b1 100644 --- a/Documentation/core-api/printk-basics.rst +++ b/Documentation/core-api/printk-basics.rst @@ -108,8 +108,8 @@ Function reference ================== .. kernel-doc:: kernel/printk/printk.c - :functions: printk + :functions: _printk .. kernel-doc:: include/linux/printk.h - :functions: pr_emerg pr_alert pr_crit pr_err pr_warn pr_notice pr_info - pr_fmt pr_debug pr_devel pr_cont + :functions: printk pr_emerg pr_alert pr_crit pr_err pr_warn + pr_notice pr_info pr_fmt pr_debug pr_devel pr_cont diff --git a/include/linux/printk.h b/include/linux/printk.h index 2651b82ed352..e0e3411db67b 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -431,6 +431,18 @@ struct pi_entry { }) +/** + * printk - Print a message + * @fmt: format string + * @...: arguments for the format string + * + * This macro generates metadata for printk indexing and prints the message + * using _printk(). It uses pr_fmt() to generate the format string. + * + * The default log level is used when a particular one is not part of + * the message prefix. pr_() macros are preferred because each + * caller should know the exact purpose of the message. + */ #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) #define printk_deferred(fmt, ...) \ printk_index_wrap(_printk_deferred, fmt, ##__VA_ARGS__) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 765f7af6ce56..2e5559175214 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2187,7 +2187,8 @@ EXPORT_SYMBOL_GPL(vprintk_default); * _printk - print a kernel message * @fmt: format string * - * This is _printk(). It can be called from any context. We want it to work. + * This is printk() implementation. It can be called from any context. + * We want it to work. * * If printk indexing is enabled, _printk() is called from printk_index_wrap. * Otherwise, printk is simply #defined to _printk. -- 2.26.2