Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1283202lqh; Mon, 6 May 2024 02:58:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6tf0YQJi/xtgagJZihvdJCaRpRveiAvU8iMFD1UjrMSflsMil5ZAXiz29j+cHF98JEP/72PVlukAbCUhEmRbH6J1VUxJPj9OLZxqjZw== X-Google-Smtp-Source: AGHT+IHgwVWp2yIb2n3Wul2k2WVkzORBCzXMFLsJyn+YdOwspPd3ZDGBtvhWo+gvC0SP+tWqPSPQ X-Received: by 2002:a50:c002:0:b0:572:a198:49ca with SMTP id r2-20020a50c002000000b00572a19849camr6660086edb.20.1714989508213; Mon, 06 May 2024 02:58:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714989508; cv=pass; d=google.com; s=arc-20160816; b=glWYrPdhZqObhzEcXO4wx/GEjSFVnQWjGC7VCEtuc1y2okSno73ASuIGaqjNkw3Kc3 uJ6c2kUf3bmlqrktlfAjjY36T8Jp6qBAQX1zAEBBSLrkB/brTBxPKCUjRTLR55tFYZOc AOO3HJk2hniyNxdfeKVVr1Mx/ss9NJHb13OT8enMMbxxqspE2G0pA/WMVLUuW9GvXSAj zhX3QvD27QZp1zZV61svtfrNuGzNG/9pkkVKY+b0YytUDiQurZvHFYaMaQbcwsw29v/5 QGiD6pcS0FN5a1cEOAGxRnXxV21IbXgcNNLvpkNbFaG0i/gSJWOciCM+n9O+djozEbg4 TNvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=KxaapcokfgFuUbfz89vv5wfELr6zFPpz8003UyV3aWM=; fh=hS2TLF6D0KMTOvjyu+sMwheC0LjipmvE8pzm1FkF9nM=; b=o4TegbPZVEDC+zOkcJe7LOgyf33Rk6B1btjZjMQ8yu0Y3emEIhbnDw2ISjaX8g42FZ QYfstZlq8tgYdo5IWlxMskTqGt8UI8vyUWWEWYeeFzaVroqx3Lpt9euqZnMkFwGG+v9q un8rV7qwe/jSY8PXiW0O0LnxQhtVRG9zLyLg3JiRfxQDZNt0ELlAphLuogN96XNw6yd5 G2NdTyWMZBlG6rFuz7lgfaFN0KHshR2ubhus9tTpjrPfyN63BZILFM3Z7j0YZqFKVVvC qCUoMAbllLpS/P6a2M6SPPrQgcu4MPPW3NhyCLP4UaAjZBpcq8x23zPtQzTNUFq3JyTK fQeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=Xw5Wosq4; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fGcTaVQQ; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-169629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169629-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i22-20020a05640242d600b00572bcb0c926si4805301edc.29.2024.05.06.02.58.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 02:58:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=Xw5Wosq4; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fGcTaVQQ; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-169629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169629-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 858E71F21D42 for ; Mon, 6 May 2024 09:58:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1BC4142634; Mon, 6 May 2024 09:58:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="Xw5Wosq4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fGcTaVQQ" Received: from wfhigh5-smtp.messagingengine.com (wfhigh5-smtp.messagingengine.com [64.147.123.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E29B94205F for ; Mon, 6 May 2024 09:57:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714989479; cv=none; b=PnpGRxBeIemCbkQtobj0Q5hA6Z31VlD7Lnhx66Fugv1StRFO/pSarzT4nvbJxUQKIjAon6dJ5iXJ/Nvjji4vThEPtvoMPdh65OdtRMXMGZfAn2Q6cXfR0SRwAQehHFUMFQ0pfJ0/CwmKD3qhKqnJGYC2JxUwyVY7Y912uqej57w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714989479; c=relaxed/simple; bh=RGG/95bqgbV0UxC4j43Z4dKYTNz41JiHRc7ZYvy2ASI=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=OvuYYP4Qyt/L4HnludL4ST08v+iQiVWkbNsIK2vOO7yUANz84iqoGNPpD/Wbmh4O6b5M5dFsw1FdnHSX47hAjSG0769LjR98Y1QJEMUIsE8S0KFVec9DR+F0BBUryM4YEYrzbZbDbd1yRjU2rkPaf3JQaH1hWvRmNstwOusMIbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=Xw5Wosq4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fGcTaVQQ; arc=none smtp.client-ip=64.147.123.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id D7F4518000BA; Mon, 6 May 2024 05:57:55 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 06 May 2024 05:57:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1714989475; x=1715075875; bh=Kxaapcokfg FuUbfz89vv5wfELr6zFPpz8003UyV3aWM=; b=Xw5Wosq4086aDVg44LtHOuNw7J OHfat0R3Sr/CbDkAfawLrS8DG8B9Yo4bUuNpLKJWbandjeKnf5qK+WVwakNGQG80 xOwPZ5osFtuigL+vBOIUq/oIUguOnxVZ2Ui19ZapSi0nwqtoVgCuPiPaIA35vVWC t23YHcHLs0pOlx4oEUtsEvhLxe7ULoXrnW+/JZdr+bc2sZevHYOTMFVDZ1PYrn4q rBM53Gs3H0J5MznsyvJaFEE02pqH/NGjpu8Hv8wPMWQ61X5YUcKlnYyNIcpPAWNo LrbbauYZq1+N7BtWZX6ZD1uxNd68WI2nd64/EJyguYmwvzgk97VcbUQASkGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1714989475; x=1715075875; bh=KxaapcokfgFuUbfz89vv5wfELr6z FPpz8003UyV3aWM=; b=fGcTaVQQmov4GGZQDUAqm4iz6RAss5GQ4St9nIfSWgR8 4StYSqvY70EN8HG5Q/q1nPOdujdmDrkOW6HI0eDSbabksJeTPl6mkmxgEYZ4+ca0 cR0hnNyWy/CIzRAhrMGGNFMyt//JPxiwclPldo4lmN4eo6BBvlqniSTQhjNMyQcM t+KSP6KhLO99ebtX+Pytb3ObPzY22s1Y3hIkyoB0UAe/hMWlj6eEQ9pm8FjRuS5y to0jW/QnOqQaKcEM1Qd7mqeoP37N2A5/rw6EtAAjazlTv1VZ3EjxqlHog3uvNkoo sl/bWs45Hl9jeAOoqHkJkAK+eED/Lyd7mCQiAlfvlA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddviedgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 19799B6008D; Mon, 6 May 2024 05:57:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-437-gcad818a2a-fm-20240502.001-gcad818a2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: References: Date: Mon, 06 May 2024 11:57:34 +0200 From: "Arnd Bergmann" To: "Andy Shevchenko" Cc: "David Howells" , linux-kernel@vger.kernel.org Subject: Re: compiler_types.h in UAPI? Content-Type: text/plain On Mon, May 6, 2024, at 10:39, Andy Shevchenko wrote: > On Fri, May 03, 2024 at 09:34:13PM +0200, Arnd Bergmann wrote: >> On Fri, May 3, 2024, at 20:57, Andy Shevchenko wrote: > >> > Today I have stumbled over use of __force and other compiler_types.h related >> > things in UAPI headers. Can anybody explain to me how do they suppose to work >> > outside of the kernel? Or did I miss something obvious? Or it was a mistake >> > during UAPI split to move swab.h and byteorder/ (most of the users of those) >> > to UAPI in the first place? >> >> These get stripped out by scripts/headers_install.sh during >> the 'make headers_install' stage: >> >> sed -E -e ' >> s/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g >> s/__attribute_const__([[:space:]]|$)/\1/g >> s@^#include @@ >> s/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g >> s/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g >> s@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @ >> ' $INFILE > $TMPFILE || exit 1 > > Thanks, Arnd, TIL! > > But do we discourage using these in UAPI in general? I mean do we have > this somewhere being documented? I don't think they are discouraged in uapi headers, since the annotations tend to be required for clean kernel builds with sparse. I could not find any documentation about it though, so it might be good to mention them in Documentation/dev-tools/sparse.rst. Arnd