Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp4871lqo; Wed, 15 May 2024 18:25:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJNydutupAYDykmqDtuAXaYE4G7x1zMO8+bXYLCM5chZlB5ZuWICsM8uNv2IriQEe3sr9xcJiGxJ3Q73biQ0oZFiUSsI0xEQpAGPn8Eg== X-Google-Smtp-Source: AGHT+IHevQkGUmkTBS65J32a9isGu6zgA5mzOqPFB7JOchsqaUcQBGlRxOoGX830ywBACqbnUX6l X-Received: by 2002:a05:6358:c005:b0:18a:78c2:7ccf with SMTP id e5c5f4694b2df-193bb628645mr1992816155d.13.1715822715856; Wed, 15 May 2024 18:25:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715822715; cv=pass; d=google.com; s=arc-20160816; b=LbxJ9VDRYDNZZCKFuANN9cfL2Hckkqxb0On8ZT+YRWYM7Qh6f9mkGN5xltBmZTFkWa 3Uwm3f5L9pj/0N1lWV/bm4yDDafOyKhBl2CxNMvXQhoi1jvrfb0+kqHya5Jy3s16FpJL v/wx1eFK4lLAXUfUzyaCxDOLzcGP6HkiB1AhCzZEGloK0ffXXPzjJPY0A/++QBzkE+6L HJjjt+Pa6Ye+iP9X8bFK69IvCKm5kQYOwZo8GefBAogLVpc3F5j9lNxRkNDKdgeIsQ/b 2N5y/Lr+BEqVsh8etogoj6u8YkAdykuLbTOajTj3sDkQn7ObisxliurVH5tnY30No/4C t1lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=5fmWXC4STobP3Pb92e4kqt4VpFGocCfhWdVYzSq5P7k=; fh=q4PFAN0Ovk5iaarZo6SV261UvTLkUakzl84vwlOG2Xk=; b=qM7OBoRuvKk70ksQaSm6JQK/tJb9nq5z7anmqNSrVnSQ/FcjlIMcvZRg9LbIX5DxgN Q1Fw993m3haGfzdpQIvch/ztk+8gcj3EMmhYu3TYlOGnBPs6X0NGIHM2PtGaeeJJexcl D75Fa4O8yJjNk9ELurQSPVl50zmiXoOr/PZ9SoGw433yrrRl+z++LvA5JIAiBn4XBIja l6bBfGTlBRRo8WQOwupiNN/vxFdEmMnA/AKlKLniqziBxCAZot5p19duL0W32fsHiM4P /n3ZjJ8G/gBFOU9Fyd70oSU31eSv8Y2Ia2y3LVZGNjUnyljvNprEMFKkS2QjVDbypKSp ImAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GjEIwh6A; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-180544-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340b3951ebsi14211944a12.238.2024.05.15.18.25.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 18:25:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180544-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GjEIwh6A; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-180544-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 74CB52813E0 for ; Thu, 16 May 2024 01:25:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FCEC10FA; Thu, 16 May 2024 01:25:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GjEIwh6A" Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D417FA47 for ; Thu, 16 May 2024 01:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715822709; cv=none; b=KX8rSoljiWr1tD8gIeWOhFsblV/a6hcfUvj1VJ/yu59UFj/I4kiJzU52d2CVZUgI8eGJhwo7cFvNcsH8Z0Ka/2hIls601KRwt6wFyo4n7ZF4DMF7XrHXzIYbCOJB7FBeglrwC2EFronP3QepVTEyuQR+kb7WHJqifPtvR5a774A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715822709; c=relaxed/simple; bh=ch0ISu0sLepp5E8LsMxeWAFsQS70H1fESbPnJVdppvc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Gh59LgT8lwa/3rfWqEMoWwdAaPlSK3Z7vMdrkTdY5tbFDqGMpy0EIZinf7ULxjnM7TIyKsKX2W6Q05TX9bws0Cl7K8U1jTaGSpqjpGxzQbXWEd881sx30s8BPagbAu3tNQoHJaehRCAGp9W8y45YPIvt9Iku6nshanGjizWzVvg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GjEIwh6A; arc=none smtp.client-ip=209.85.215.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-5e42b4bbfa4so4246300a12.1 for ; Wed, 15 May 2024 18:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715822707; x=1716427507; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5fmWXC4STobP3Pb92e4kqt4VpFGocCfhWdVYzSq5P7k=; b=GjEIwh6APoOkzJoEZcGFMk6ndGsgw5u9oBV+e55WxW7p6B0s+MzCXZIigVhvSd+TPX xbm23OW9TvxZpRfkxP4cZmR2Aackqw/i4T8HiIMIZeX18Ykto7QpZ+MIEiOhANbPEr7s rMt31rYIgQh7CG880TvNkQo+uBtY8msqsI7uPvfH2Onh9KZXeKGhBIONSSjzAJUaJ1FK STPsmAJSjKnQv0oO9bg3mtjtzw/hVUgaNrqr7Bqy48Y7R8mNZawET6/Q31HDVtq78t55 m7EJjYkzia4nUYcCsDzC90umF9Or2PC2lkD/gDJCVvjZs/QQ78WrXHbAV3nfMDUxK/TG K+ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715822707; x=1716427507; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5fmWXC4STobP3Pb92e4kqt4VpFGocCfhWdVYzSq5P7k=; b=jTQv3spVKlfAuzHbl5BG0L08v9n2A4C2jXY+l9Y1IYZNUsGIoLXBRBZLZ4xb0d3V+I 4fxL0R04xXRd5iP6HgRgci8gfOK2TUDhhhQwbOKCaV4s0Q6lgqFomEx3qcUq4xcc0dKm o5fC/OUWNfAILnY97gyLsxUdD5N0PDdEsQkTH6ZNM3jwQazKM7T4B5nMXdoP7CHo7HKV 5DmIiPDFaxCISx94pq0k8wfwSC88KQmbWJHaOIEHJKDPTXIXAJabf6+VK/ZVIGtCdbxz WiVMc8FjuBsDmw6LADkFBxZ41BL6C7VLzeXuXJhX2/VkjbaxPDf4FjkV6Kgo4jBVO4HW ECpg== X-Forwarded-Encrypted: i=1; AJvYcCVRUaAaCuX4zurnBvaKqbubY/cF319pOVpDbDvyCyJVVwLuZ2a6id0Yyg45EQH2X3JiZHuqh/GMtSReHNMFqag8pN7XjiMtxQddAjVi X-Gm-Message-State: AOJu0Ywnl51BFbQV4PIeTEzJqjPDhJm3S132U5v4b8b+ot/aq8ITWwhs zUHLMaYvtSetibDw4p0C0u3GWA0NiN8zOnBDlVzWvAA/s5+fPVBj6JV7KzHjy/QoQ6O+fkT7ZE0 IcvqwZOrbKyEDjutE9wjK1kosrpA= X-Received: by 2002:a05:6a21:c98:b0:1a7:5e8f:8707 with SMTP id adf61e73a8af0-1afde10af9emr18413459637.26.1715822707151; Wed, 15 May 2024 18:25:07 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240513212836.292589-3-thorsten.blum@toblux.com> <60613D48-7C93-4B9F-894C-CE70E5F8D123@toblux.com> <227C6981-AFFC-4E0E-A95F-BF8979D5AD2A@toblux.com> In-Reply-To: <227C6981-AFFC-4E0E-A95F-BF8979D5AD2A@toblux.com> From: Luc Ma Date: Thu, 16 May 2024 09:24:55 +0800 Message-ID: Subject: Re: [PATCH] drm: Combine identical if/elif code blocks To: Thorsten Blum Cc: David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Hi, On Wed, 15 May 2024 at 17:31, Thorsten Blum wrote: > > On 15. May 2024, at 11:22, Thorsten Blum wrote: > > On 15. May 2024, at 09:43, Luc Ma wrote: > >> On Tue, 14 May 2024 at 19:37, Thorsten Blum wrote: > >>> > >>> Merge the identical if/elif code blocks and remove the following two > >>> warnings reported by make includecheck: > >>> > >>> asm/ioctl.h is included more than once > >>> linux/types.h is included more than once > >>> > >>> Signed-off-by: Thorsten Blum > >>> --- > >>> include/uapi/drm/drm.h | 8 +------- > >>> 1 file changed, 1 insertion(+), 7 deletions(-) > >>> > >>> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h > >>> index 16122819edfe..315af7b19c97 100644 > >>> --- a/include/uapi/drm/drm.h > >>> +++ b/include/uapi/drm/drm.h > >>> @@ -35,13 +35,7 @@ > >>> #ifndef _DRM_H_ > >>> #define _DRM_H_ > >>> > >>> -#if defined(__KERNEL__) > >>> - > >>> -#include > >>> -#include > >>> -typedef unsigned int drm_handle_t; > >>> - > >>> -#elif defined(__linux__) > >> > >> I think it is intentionally like that. Please see > >> https://patchwork.freedesktop.org/patch/78747/ > > > > Thank you for the link. > > > > Does anyone know if the reason for the change from 2016 ("make > > headers_install can't handle fancy conditions, ...") is still valid? I guess it is. If you can try ./scripts/unifdef as below[1], you might find out the thing. [1]https://elixir.bootlin.com/linux/v6.9/source/scripts/headers_install.sh#L41 > > > > Other headers use the same #if directive: > > > > fs/ext4/ext4.h:948:#if defined(__KERNEL__) || defined(__linux__) > > include/uapi/sound/asound.h:11:#if defined(__KERNEL__) || defined(__linux__) > > > > And there are many others using similar conditions: > > > > arch/arm/include/uapi/asm/swab.h:27:#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6 > > arch/sparc/include/uapi/asm/signal.h:92:#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__) > > arch/sparc/include/uapi/asm/termios.h:8:#if defined(__KERNEL__) || defined(__DEFINE_BSD_TERMIOS) > > include/uapi/linux/soundcard.h:1040:#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS) > > include/uapi/linux/stat.h:7:#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) > > include/uapi/sound/asound.h:11:#if defined(__KERNEL__) || defined(__linux__) > > ... > > > > Thanks, > > Thorsten > > Re-sending this to linux-kernel@vger.kernel.org because the mailing list > somehow got lost in Luc's reply. Sorry about that. Regards, Luc