Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp699242pxt; Fri, 6 Aug 2021 11:29:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGBq3NV/omedSjtKAHAfvP7rYGHQ7CygiwetKmfjWRVSPkHPvPAC6dGcTKcpaYVRKTVPiW X-Received: by 2002:a92:da4a:: with SMTP id p10mr329963ilq.290.1628274542683; Fri, 06 Aug 2021 11:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628274542; cv=none; d=google.com; s=arc-20160816; b=o0we2Los5mDnlm1jSRO8cn5kkT+nNhpLYklbfdiJYxLA4PokDAQCnYPJHhWPyanl2P O9t/dIbCPCtYdpWCFrJHb6CXPrD6wH7P8+sepsyMzVnZHA2kh7efZAVcCqgA31sOd9Pv Gi7UsPJ2+rKHKfBdOm9XQXFJ66zbZrFIKR9Ou0oqiuF8dIhSEhZEwZbrpA38rgkisyJM r+iT9UBvEv9sqxqUvYMsjswl9uuv/7Bwb9asb/hIA12AGe6exulHuzKnb8bZH/arA23F IEE4cv59kt6T5ILap0jU4mkYSdg4Kx0jI1I3iTYJkRB1JKWuwafArL454Vd8/v7uhPpk dG7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=JR8mZQiiH7oUmHN4ES6S490WwMOYDz5AaU+8qiqrWeQ=; b=W9BDzM+hrhkr9rt1LJll/omfN2X410MwzQsIFBui7o5Dim3faSQg98n2pTWrHBmcST jv3BS+GF6lDud9HNA9K80fTl+jM9LXo/ZiBqpWFrCeMz4oriO/LCIkB7iCOOXlv+ED7J /KHm8TvVmlzrCxOLTmBUiy6oBNlrH5B+u3LoJeQHWHLrA/dZsQgb7Q+sFGEllBsh6OmC d8ghkcqNvUnqzVkqoxYZn0RfyBjzGZTU34BnYCwTXAGMBMIi01C9Ped4u2U0s3QSfY8A HC55RU2NB8ZzQJjNColpT0LWB7EAA8GQtdUm/ZXtWC4HNJdzOjsu4M6HrJ2T/VI3dbBL NEEg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si9442524ios.26.2021.08.06.11.28.49; Fri, 06 Aug 2021 11:29:02 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343934AbhHFNBT (ORCPT + 99 others); Fri, 6 Aug 2021 09:01:19 -0400 Received: from mail-ot1-f45.google.com ([209.85.210.45]:33626 "EHLO mail-ot1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343928AbhHFNBS (ORCPT ); Fri, 6 Aug 2021 09:01:18 -0400 Received: by mail-ot1-f45.google.com with SMTP id 61-20020a9d0d430000b02903eabfc221a9so8838688oti.0; Fri, 06 Aug 2021 06:01:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JR8mZQiiH7oUmHN4ES6S490WwMOYDz5AaU+8qiqrWeQ=; b=NxOi/y5WoPEOFnMfwo8wGYa57XJ7GLD7vum3NcsADtADtB8TQzr3IZDXeymcJdLq8G Amg6mssuKAHUel9lwUXF3j8EXCGhsjLzq9a2DA1sttMM0io44uPCVpEx4mMde7KhMoJp XDpcBfC91F0l1V7XFHamKAf4sBt3GtuwzscWccYkiY9QxlXEzwLV2wzSiJXzo+lKHNuX mkuG9rhq4DG2ZeCIuZvCrwn4DWnY8xQEPD9C7ckbC25c5ZlZODNoRupLC0yZY9UG8ikG w6Z1IHrQAjsWxdtIETnQxk1WJQyCkVVeBlyX0heKsAKThM6Xiv/atDPAbcPkWo9HUcqx +KFw== X-Gm-Message-State: AOAM530fOXbYbIMbtexcXnY/YTsb3o3B0o+otscuaRm/JhWnH28PipUO EeHImjPOkoPFdVGHMShLbGKc4e65beBWf0MysFc= X-Received: by 2002:a05:6830:1f59:: with SMTP id u25mr7539208oth.321.1628254860622; Fri, 06 Aug 2021 06:01:00 -0700 (PDT) MIME-Version: 1.0 References: <20210801201336.2224111-1-adobriyan@gmail.com> <20210801201336.2224111-2-adobriyan@gmail.com> In-Reply-To: <20210801201336.2224111-2-adobriyan@gmail.com> From: "Rafael J. Wysocki" Date: Fri, 6 Aug 2021 15:00:49 +0200 Message-ID: Subject: Re: [PATCH 2/3] isystem: ship and use stdarg.h To: Alexey Dobriyan Cc: Andrew Morton , Linux Kernel Mailing List , linux-arch , Masahiro Yamada , "Rafael J. Wysocki" , Len Brown , ACPI Devel Maling List , Ard Biesheuvel , linux-efi Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 1, 2021 at 10:13 PM Alexey Dobriyan wrote: > > Ship minimal stdarg.h (1 type, 4 macros) as . > stdarg.h is the only userspace header commonly used in the kernel. > > GPL 2 version of can be extracted from > http://archive.debian.org/debian/pool/main/g/gcc-4.2/gcc-4.2_4.2.4.orig.tar.gz > > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Cc: linux-acpi@vger.kernel.org > Cc: Ard Biesheuvel > Cc: linux-efi@vger.kernel.org > Signed-off-by: Alexey Dobriyan For the ACPI part: Acked-by: Rafael J. Wysocki > --- > arch/parisc/kernel/firmware.c | 2 +- > arch/powerpc/kernel/prom_init.c | 2 +- > arch/powerpc/kernel/rtas.c | 2 +- > arch/powerpc/kernel/udbg.c | 2 +- > arch/s390/boot/pgm_check_info.c | 2 +- > arch/x86/boot/boot.h | 2 +- > drivers/firmware/efi/libstub/efi-stub-helper.c | 2 +- > drivers/firmware/efi/libstub/vsprintf.c | 2 +- > drivers/gpu/drm/amd/display/dc/dc_helper.c | 2 +- > drivers/gpu/drm/drm_print.c | 2 +- > drivers/isdn/capi/capiutil.c | 2 +- > drivers/macintosh/via-cuda.c | 2 +- > drivers/macintosh/via-pmu.c | 2 +- > .../atomisp/pci/hive_isp_css_include/print_support.h | 2 +- > drivers/staging/media/atomisp/pci/ia_css_env.h | 2 +- > .../pci/runtime/debug/interface/ia_css_debug.h | 2 +- > drivers/staging/media/atomisp/pci/sh_css_internal.h | 2 +- > fs/befs/debug.c | 2 +- > fs/reiserfs/prints.c | 2 +- > fs/ufs/super.c | 2 +- > include/acpi/platform/acgcc.h | 2 +- > include/linux/kernel.h | 2 +- > include/linux/printk.h | 2 +- > include/linux/stdarg.h | 11 +++++++++++ > include/linux/string.h | 2 +- > lib/debug_info.c | 3 +-- > lib/kasprintf.c | 2 +- > lib/kunit/string-stream.h | 2 +- > lib/vsprintf.c | 2 +- > mm/kfence/report.c | 2 +- > net/batman-adv/log.c | 2 +- > 31 files changed, 41 insertions(+), 31 deletions(-) > create mode 100644 include/linux/stdarg.h > > diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c > index 665b70086685..7034227dbdf3 100644 > --- a/arch/parisc/kernel/firmware.c > +++ b/arch/parisc/kernel/firmware.c > @@ -51,7 +51,7 @@ > * prumpf 991016 > */ > > -#include > +#include > > #include > #include > diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c > index a5bf355ce1d6..10664633f7e3 100644 > --- a/arch/powerpc/kernel/prom_init.c > +++ b/arch/powerpc/kernel/prom_init.c > @@ -14,7 +14,7 @@ > /* we cannot use FORTIFY as it brings in new symbols */ > #define __NO_FORTIFY > > -#include > +#include > #include > #include > #include > diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c > index 99f2cce635fb..ff80bbad22a5 100644 > --- a/arch/powerpc/kernel/rtas.c > +++ b/arch/powerpc/kernel/rtas.c > @@ -7,7 +7,7 @@ > * Copyright (C) 2001 IBM. > */ > > -#include > +#include > #include > #include > #include > diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c > index 01595e8cafe7..b1544b2f6321 100644 > --- a/arch/powerpc/kernel/udbg.c > +++ b/arch/powerpc/kernel/udbg.c > @@ -5,7 +5,7 @@ > * c 2001 PPC 64 Team, IBM Corp > */ > > -#include > +#include > #include > #include > #include > diff --git a/arch/s390/boot/pgm_check_info.c b/arch/s390/boot/pgm_check_info.c > index 3a46abed2549..b7d8dd88bbf2 100644 > --- a/arch/s390/boot/pgm_check_info.c > +++ b/arch/s390/boot/pgm_check_info.c > @@ -1,5 +1,6 @@ > // SPDX-License-Identifier: GPL-2.0 > #include > +#include > #include > #include > #include > @@ -8,7 +9,6 @@ > #include > #include > #include > -#include > #include "boot.h" > > const char hex_asc[] = "0123456789abcdef"; > diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h > index ca866f1cca2e..34c9dbb6a47d 100644 > --- a/arch/x86/boot/boot.h > +++ b/arch/x86/boot/boot.h > @@ -18,7 +18,7 @@ > > #ifndef __ASSEMBLY__ > > -#include > +#include > #include > #include > #include > diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c > index ae87dded989d..d489bdc645fe 100644 > --- a/drivers/firmware/efi/libstub/efi-stub-helper.c > +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c > @@ -7,7 +7,7 @@ > * Copyright 2011 Intel Corporation; author Matt Fleming > */ > > -#include > +#include > > #include > #include > diff --git a/drivers/firmware/efi/libstub/vsprintf.c b/drivers/firmware/efi/libstub/vsprintf.c > index 1088e288c04d..71c71c222346 100644 > --- a/drivers/firmware/efi/libstub/vsprintf.c > +++ b/drivers/firmware/efi/libstub/vsprintf.c > @@ -10,7 +10,7 @@ > * Oh, it's a waste of space, but oh-so-yummy for debugging. > */ > > -#include > +#include > > #include > #include > diff --git a/drivers/gpu/drm/amd/display/dc/dc_helper.c b/drivers/gpu/drm/amd/display/dc/dc_helper.c > index a612ba6dc389..ab6bc5d79012 100644 > --- a/drivers/gpu/drm/amd/display/dc/dc_helper.c > +++ b/drivers/gpu/drm/amd/display/dc/dc_helper.c > @@ -28,9 +28,9 @@ > */ > > #include > +#include > > #include "dm_services.h" > -#include > > #include "dc.h" > #include "dc_dmub_srv.h" > diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c > index 111b932cf2a9..f783d4963d4b 100644 > --- a/drivers/gpu/drm/drm_print.c > +++ b/drivers/gpu/drm/drm_print.c > @@ -25,7 +25,7 @@ > > #define DEBUG /* for pr_debug() */ > > -#include > +#include > > #include > #include > diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c > index f26bf3c66d7e..d7ae42edc4a8 100644 > --- a/drivers/isdn/capi/capiutil.c > +++ b/drivers/isdn/capi/capiutil.c > @@ -379,7 +379,7 @@ static char *pnames[] = > /*2f */ "Useruserdata" > }; > > -#include > +#include > > /*-------------------------------------------------------*/ > static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt, ...) > diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c > index 3581abfb0c6a..cd267392289c 100644 > --- a/drivers/macintosh/via-cuda.c > +++ b/drivers/macintosh/via-cuda.c > @@ -9,7 +9,7 @@ > * > * Copyright (C) 1996 Paul Mackerras. > */ > -#include > +#include > #include > #include > #include > diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c > index 4bdd4c45e7a7..4b98bc26a94b 100644 > --- a/drivers/macintosh/via-pmu.c > +++ b/drivers/macintosh/via-pmu.c > @@ -18,7 +18,7 @@ > * a sleep or a freq. switch > * > */ > -#include > +#include > #include > #include > #include > diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h b/drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h > index 540b405cc0f7..a3c7f3de6d17 100644 > --- a/drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h > +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_include/print_support.h > @@ -16,7 +16,7 @@ > #ifndef __PRINT_SUPPORT_H_INCLUDED__ > #define __PRINT_SUPPORT_H_INCLUDED__ > > -#include > +#include > > extern int (*sh_css_printf)(const char *fmt, va_list args); > /* depends on host supplied print function in ia_css_init() */ > diff --git a/drivers/staging/media/atomisp/pci/ia_css_env.h b/drivers/staging/media/atomisp/pci/ia_css_env.h > index 6b38723b27cd..3b89bbd837a0 100644 > --- a/drivers/staging/media/atomisp/pci/ia_css_env.h > +++ b/drivers/staging/media/atomisp/pci/ia_css_env.h > @@ -17,7 +17,7 @@ > #define __IA_CSS_ENV_H > > #include > -#include /* va_list */ > +#include /* va_list */ > #include "ia_css_types.h" > #include "ia_css_acc_types.h" > > diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h b/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h > index 5e6e7447ae00..e37ef4232c55 100644 > --- a/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h > +++ b/drivers/staging/media/atomisp/pci/runtime/debug/interface/ia_css_debug.h > @@ -19,7 +19,7 @@ > /*! \file */ > > #include > -#include > +#include > #include "ia_css_types.h" > #include "ia_css_binary.h" > #include "ia_css_frame_public.h" > diff --git a/drivers/staging/media/atomisp/pci/sh_css_internal.h b/drivers/staging/media/atomisp/pci/sh_css_internal.h > index 3c669ec79b68..496faa7297a5 100644 > --- a/drivers/staging/media/atomisp/pci/sh_css_internal.h > +++ b/drivers/staging/media/atomisp/pci/sh_css_internal.h > @@ -20,7 +20,7 @@ > #include > #include > #include > -#include > +#include > > #if !defined(ISP2401) > #include "input_formatter.h" > diff --git a/fs/befs/debug.c b/fs/befs/debug.c > index eb7bd6c692c7..02fa66fb82c2 100644 > --- a/fs/befs/debug.c > +++ b/fs/befs/debug.c > @@ -14,7 +14,7 @@ > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > #ifdef __KERNEL__ > > -#include > +#include > #include > #include > #include > diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c > index 500f2000eb41..30319dc33c18 100644 > --- a/fs/reiserfs/prints.c > +++ b/fs/reiserfs/prints.c > @@ -8,7 +8,7 @@ > #include > #include > > -#include > +#include > > static char error_buf[1024]; > static char fmt_buf[1024]; > diff --git a/fs/ufs/super.c b/fs/ufs/super.c > index 74028b5a7b0a..00a01471ea05 100644 > --- a/fs/ufs/super.c > +++ b/fs/ufs/super.c > @@ -70,7 +70,7 @@ > #include > #include > > -#include > +#include > > #include > > diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h > index f6656be81760..fb172a03a753 100644 > --- a/include/acpi/platform/acgcc.h > +++ b/include/acpi/platform/acgcc.h > @@ -22,7 +22,7 @@ typedef __builtin_va_list va_list; > #define va_arg(v, l) __builtin_va_arg(v, l) > #define va_copy(d, s) __builtin_va_copy(d, s) > #else > -#include > +#include > #endif > #endif > > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > index 1b2f0a7e00d6..2776423a587e 100644 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -2,7 +2,7 @@ > #ifndef _LINUX_KERNEL_H > #define _LINUX_KERNEL_H > > -#include > +#include > #include > #include > #include > diff --git a/include/linux/printk.h b/include/linux/printk.h > index e834d78f0478..9f3f29ea348e 100644 > --- a/include/linux/printk.h > +++ b/include/linux/printk.h > @@ -2,7 +2,7 @@ > #ifndef __KERNEL_PRINTK__ > #define __KERNEL_PRINTK__ > > -#include > +#include > #include > #include > #include > diff --git a/include/linux/stdarg.h b/include/linux/stdarg.h > new file mode 100644 > index 000000000000..c8dc7f4f390c > --- /dev/null > +++ b/include/linux/stdarg.h > @@ -0,0 +1,11 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +#ifndef _LINUX_STDARG_H > +#define _LINUX_STDARG_H > + > +typedef __builtin_va_list va_list; > +#define va_start(v, l) __builtin_va_start(v, l) > +#define va_end(v) __builtin_va_end(v) > +#define va_arg(v, T) __builtin_va_arg(v, T) > +#define va_copy(d, s) __builtin_va_copy(d, s) > + > +#endif > diff --git a/include/linux/string.h b/include/linux/string.h > index b48d2d28e0b1..5e96d656be7a 100644 > --- a/include/linux/string.h > +++ b/include/linux/string.h > @@ -6,7 +6,7 @@ > #include /* for size_t */ > #include /* for NULL */ > #include /* for E2BIG */ > -#include > +#include > #include > > extern char *strndup_user(const char __user *, long); > diff --git a/lib/debug_info.c b/lib/debug_info.c > index 36daf753293c..cc4723c74af5 100644 > --- a/lib/debug_info.c > +++ b/lib/debug_info.c > @@ -5,8 +5,6 @@ > * CONFIG_DEBUG_INFO_REDUCED. Please do not add actual code. However, > * adding appropriate #includes is fine. > */ > -#include > - > #include > #include > #include > @@ -22,6 +20,7 @@ > #include > #include > #include > +#include > #include > #include > #include > diff --git a/lib/kasprintf.c b/lib/kasprintf.c > index bacf7b83ccf0..cd2f5974ed98 100644 > --- a/lib/kasprintf.c > +++ b/lib/kasprintf.c > @@ -5,7 +5,7 @@ > * Copyright (C) 1991, 1992 Linus Torvalds > */ > > -#include > +#include > #include > #include > #include > diff --git a/lib/kunit/string-stream.h b/lib/kunit/string-stream.h > index 5e94b623454f..43f9508a55b4 100644 > --- a/lib/kunit/string-stream.h > +++ b/lib/kunit/string-stream.h > @@ -11,7 +11,7 @@ > > #include > #include > -#include > +#include > > struct string_stream_fragment { > struct kunit *test; > diff --git a/lib/vsprintf.c b/lib/vsprintf.c > index 26c83943748a..3bcb7be03f93 100644 > --- a/lib/vsprintf.c > +++ b/lib/vsprintf.c > @@ -17,7 +17,7 @@ > * - scnprintf and vscnprintf > */ > > -#include > +#include > #include > #include > #include > diff --git a/mm/kfence/report.c b/mm/kfence/report.c > index 2a319c21c939..4b891dd75650 100644 > --- a/mm/kfence/report.c > +++ b/mm/kfence/report.c > @@ -5,7 +5,7 @@ > * Copyright (C) 2020, Google LLC. > */ > > -#include > +#include > > #include > #include > diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c > index f0e5d1429662..7a93a1e94c40 100644 > --- a/net/batman-adv/log.c > +++ b/net/batman-adv/log.c > @@ -7,7 +7,7 @@ > #include "log.h" > #include "main.h" > > -#include > +#include > > #include "trace.h" > > -- > 2.31.1 >