Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp252506pxb; Wed, 24 Feb 2021 00:45:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5E7JQ2rzJrPzwyh6wtGM4n0XpuKFaSEmZxLUbEBp2tD5+k99A+mgcnVg33ZKxrsMQqi4I X-Received: by 2002:a17:906:3e42:: with SMTP id t2mr27416153eji.554.1614156358964; Wed, 24 Feb 2021 00:45:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614156358; cv=none; d=google.com; s=arc-20160816; b=ND67daPUGdXg7/HXTitd439+FcC8u+iYJsqMkROhBPsUxWaTeZ6csvMmk9TggIwKRH 0fifAjitAmUpZvxJ8rZxbPD/ln+lDTENUoD1x1nLU0HfdoYMiQ3KcIkfsc83RsQE1J7w dMxEJV5GbIc+UTHDH9opTPzlh5BIeNuP5LeivDH6ndZMyEhS2V1dHCYj7zDHtUDP1lAZ R8JViT8HIGzNluuQwfNclu1PUPfxsVBeAhPWSTYKjdHRj+rh1KQBGJQj883T0WQXAQuE GA2GCZ613j1nZ1s0BFDBOboLGVZaM80doqaKXMg1lfGAgKhoFP1UGUZr1dNf8piz5kyV N0Uw== 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:dkim-signature; bh=mMCYIIhWPiZZKRK3J2FmcScG/U1h4r8InYzzmPoHnKI=; b=V+O2rEXLvUnaY+Xm8ljbF7KAVaa57eBgtXCUMuY9lYmPb1b6K/HfMVtmXx3C2sB7H7 t0RWBfn1Jt2pxVH7bIUPcPw5rQbmzJ1mvftsUvQIpyyC5vtYZiEbBQypctQqIoB3HMiE SqTcSbS68WyVl3yeCp+xt2eTUF6RDuQF+ijDJDqQaMDmSrhR7I8ezpgb9DRQSR6kKCZa AMe+kooMWyTzpBcG6gEHH95QXprO5t+d1Fc9d1D3XTQq+mWGQAmpvEzfoAfUH9Z3zFtU kSrtHxWGCKs/HdnZsQlU44+O6mqneUk+8qOF36BkPV765TgAL6aWZ30ZTMAjGbXA4AEv Qo/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uN0bUfFD; 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 ss15si936021ejb.481.2021.02.24.00.45.30; Wed, 24 Feb 2021 00:45:58 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=uN0bUfFD; 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 S232530AbhBXInU (ORCPT + 99 others); Wed, 24 Feb 2021 03:43:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:35936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234538AbhBXImS (ORCPT ); Wed, 24 Feb 2021 03:42:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8482964ED4; Wed, 24 Feb 2021 08:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614156097; bh=2u9wsGlo7sAstFS7alrtBLEQ7jlLQXyGrglLta9pQLs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uN0bUfFDBiLVq32hJndalsoZyspL6z2Gf7MwTCrAOCA7wCyr8uHFZYZgce7k3ENP/ 9sRx1JZxii8kHho8sz29USgl8CGuu3cv55cABgdtiuo/hoK92cp2gvcQtANYQrBgPY 4FxHhg7G9AgPECGkEXPird7yTRXP1sQZtEFiRolv06FSbkbGuq9D85oiqk1gLajm8J J+FFJgPDbA0a6P2k0AOVeO3HfEigFrJL1w22oVAEcQJAOfA4pOK30Si7QBpFaWbfp7 i2GO2XDtlsMGrvtpkEono6KCrIorE93qdcTbu35qbvrcAqKjK/GX1WqkHwHI8kRKQq QMIFJFKY6QFkw== Received: by mail-oi1-f174.google.com with SMTP id h17so1674983oih.5; Wed, 24 Feb 2021 00:41:37 -0800 (PST) X-Gm-Message-State: AOAM531L17iap+oH6YmhvtOA4MfEXjUiuapywiLhgWtm3r3mQkKHUNxR D8tI52GonID72p7PwbJYmi+8Jb4oxkZCgpmjnxk= X-Received: by 2002:aca:4a47:: with SMTP id x68mr1917194oia.67.1614156096771; Wed, 24 Feb 2021 00:41:36 -0800 (PST) MIME-Version: 1.0 References: <20210223100619.798698-1-masahiroy@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Wed, 24 Feb 2021 09:41:20 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] asm-generic/ioctl.h: use BUILD_BUG_ON_ZERO() for type check To: Masahiro Yamada Cc: Andrew Morton , Arnd Bergmann , "linux-kernel@vger.kernel.org" , linux-arch Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 24, 2021 at 2:57 AM Masahiro Yamada wrote: > > On Wed, Feb 24, 2021 at 5:04 AM Arnd Bergmann wrote: > > > > On Tue, Feb 23, 2021 at 11:06 AM Masahiro Yamada wrote: > > My intention is to improve the UAPI/KAPI decoupling > to decrease the task of scripts/headers_install.sh > > Ideally, we could export UAPI headers with > almost no modification. > > It is true that scripts/unifdef can remove #ifndef __KERNEL__ > blocks, but having the kernel-space code in UAPI headers > does not make sense. Otherwise, our initial motivation > "separate them by directory structure" would be lost. > > So, I believe redefining _IOC_TYPECHECK is the right direction. > I can add comments if this is not clear. Maybe using '#ifndef _IOC_TYPECHECK' would help here? Another alternative might be to find a way to rewrite the typecheck macro to make it safe to be used in user space as well, and not have two different versions. Arnd