From patchwork Wed May 17 13:10:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13244894 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BDADC7EE22 for ; Wed, 17 May 2023 13:12:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA7AE900003; Wed, 17 May 2023 09:12:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C59E9280003; Wed, 17 May 2023 09:12:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFC69900007; Wed, 17 May 2023 09:12:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9F078900003 for ; Wed, 17 May 2023 09:12:13 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1E111804B6 for ; Wed, 17 May 2023 13:12:13 +0000 (UTC) X-FDA: 80799785346.21.F919746 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf14.hostedemail.com (Postfix) with ESMTP id F151510000D for ; Wed, 17 May 2023 13:12:10 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=I6TCINxJ; spf=pass (imf14.hostedemail.com: domain of arnd@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=arnd@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684329131; a=rsa-sha256; cv=none; b=iKysH3K09sRqcXvvMhnybmcFZMdUzDzIwc2dbyHMEYW4llNKtltcoAldzKteXwWwdIWiCe uJFhMDuuFnZzeTffI0OrcVTuCobWWSf3eMDKL1rRFmR71O35aW9NLdJtp6IcLnUUJJmqv9 /3l6h4Z7+a+/LMY7yEDK72gxLPSUI2w= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=I6TCINxJ; spf=pass (imf14.hostedemail.com: domain of arnd@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=arnd@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684329131; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FtDFA91ypS9ZA0IR38/PvWFBEIGzGOUQK4+dY24nL+I=; b=S3cPKuignkeI4LnTqcZ3hV4nSCg5Td5Kqv86/n8LRAAcSavKSuTwzBkEF8NOpBUhNC51Xh gqoc0r/IgMvmf9G+BGHmRrcDobhUWJHvhc7YrPYgg1syOxIQhM2K5HfGFCk1JQ7xhSVdEf WdBwqCXYD9d8Q7mNdW+ULLbd/co/we0= 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 dfw.source.kernel.org (Postfix) with ESMTPS id EF48963B88; Wed, 17 May 2023 13:12:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E219C433A8; Wed, 17 May 2023 13:12:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684329129; bh=m4CC8jzjsL/DB4zhl/Y597jyiUuMzUYclEl5YRgzTWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I6TCINxJI0woqSGR6ssIvaSj6epLLVO81LOzyVaPT8/vzZI9AB8IWfkQCSXQEHhXj emmu7MtAnphbx6efp3NtZZlhdUPe7PobFSbrgE0GW1MxwsjqRKhXtsARowKgI7TJl1 M8K+xUmMlgWQeI0sMhDqBlo2KcTRfdwZaRrzSuAmdzwi2gCudljKNjdsRsUPUgknLD dFngQPAXjy/SCR0E/q5jywBkSs9H4bdCiuKXgEHWHkpEKogI02+rydRudhNs/4FwF/ rKa/Win+V5kAOFnp1Q7tVYGNdR9eUslE6Gou6+cruOq5EcoezzwmGP3r8Tp1Dhm35i hSLiw0TbCv7FA== From: Arnd Bergmann To: Andrew Morton Cc: linux-mm@kvack.org, Arnd Bergmann , Russell King , Catalin Marinas , Will Deacon , Michal Simek , Thomas Bogendoerfer , Helge Deller , Michael Ellerman , Palmer Dabbelt , Heiko Carstens , Thomas Gleixner , Ingo Molnar , x86@kernel.org, "Rafael J. Wysocki" , Paul Moore , Eric Paris , Dennis Zhou , Tejun Heo , Christoph Lameter , Pavel Machek , Peter Zijlstra , Waiman Long , Boqun Feng , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, audit@vger.kernel.org, linux-pm@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Subject: [PATCH 04/14] audit: avoid missing-prototype warnings Date: Wed, 17 May 2023 15:10:52 +0200 Message-Id: <20230517131102.934196-5-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517131102.934196-1-arnd@kernel.org> References: <20230517131102.934196-1-arnd@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: F151510000D X-Stat-Signature: 7tjq6dk1oh9kasy1oddzqw4bkuhzgi6a X-HE-Tag: 1684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6uaLpItnMF/esYFyxIKQZhY8cXXZj4tJQQ5ASxa8zrVb2+kpxPbiTlJCjMi+fcSVEnNnqtl2tzhthNzhUyriSdECIENgVAkxBN5a/X1MGyQtNWAwMebh5qCpEOIQ2Yx61tLy7mmtx7IbcWBpP+Lib52CofXkoRROouJRqTCpUwIWcNl1kMfR/YkiV4Fjj2IstUR2nYAIWAiLL54EPIeioPknB8pySfv97MflbOMgj8tPr26qypukMGrm8VbXccGLo9JmCzKO+GZx9DxpXGrXaGZ13gwrdTkPnEK X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Arnd Bergmann Building with 'make W=1' reveals two function definitions without a previous prototype in the audit code: lib/compat_audit.c:32:5: error: no previous prototype for 'audit_classify_compat_syscall' [-Werror=missing-prototypes] kernel/audit.c:1813:14: error: no previous prototype for 'audit_serial' [-Werror=missing-prototypes] The first one needs a declaration from linux/audit.h but cannot include that header without causing conflicting (compat) syscall number definitions, so move the it into linux/audit_arch.h. The second one is declared conditionally based on CONFIG_AUDITSYSCALL but needed as a local function even when that option is disabled, so move the declaration out of the #ifdef block. Signed-off-by: Arnd Bergmann --- include/linux/audit.h | 2 -- include/linux/audit_arch.h | 2 ++ kernel/audit.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/audit.h b/include/linux/audit.h index 31086a72e32a..6a3a9e122bb5 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -130,8 +130,6 @@ extern unsigned compat_dir_class[]; extern unsigned compat_chattr_class[]; extern unsigned compat_signal_class[]; -extern int audit_classify_compat_syscall(int abi, unsigned syscall); - /* audit_names->type values */ #define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */ #define AUDIT_TYPE_NORMAL 1 /* a "normal" audit record */ diff --git a/include/linux/audit_arch.h b/include/linux/audit_arch.h index 8fdb1afe251a..0e34d673ef17 100644 --- a/include/linux/audit_arch.h +++ b/include/linux/audit_arch.h @@ -21,4 +21,6 @@ enum auditsc_class_t { AUDITSC_NVALS /* count */ }; +extern int audit_classify_compat_syscall(int abi, unsigned syscall); + #endif diff --git a/kernel/audit.h b/kernel/audit.h index c57b008b9914..94738bce40b2 100644 --- a/kernel/audit.h +++ b/kernel/audit.h @@ -259,8 +259,8 @@ extern struct tty_struct *audit_get_tty(void); extern void audit_put_tty(struct tty_struct *tty); /* audit watch/mark/tree functions */ -#ifdef CONFIG_AUDITSYSCALL extern unsigned int audit_serial(void); +#ifdef CONFIG_AUDITSYSCALL extern int auditsc_get_stamp(struct audit_context *ctx, struct timespec64 *t, unsigned int *serial);