From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F09FC433EF for ; Fri, 19 Nov 2021 13:16:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3178761B42 for ; Fri, 19 Nov 2021 13:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233565AbhKSNTM (ORCPT ); Fri, 19 Nov 2021 08:19:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbhKSNTL (ORCPT ); Fri, 19 Nov 2021 08:19:11 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4463C061574; Fri, 19 Nov 2021 05:16:09 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id c4so18093635wrd.9; Fri, 19 Nov 2021 05:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=/pL+Oyiy0IE/VSN3VcOMQBkBUj2zcO4M5BEO9TZep1A=; b=fYTnnvM8ksusjPkK4Sby+CQscGGjmFeWWkZjInk/876Zd4Z/LprwRSUWcHweTrZLPP vmB1nYM0TvqZDPEA3v2PisH3FUjA01QMt5bKVp2vWUTwq8PTA3BIzg0tCJ/MMpSi6TBv jSxjdZYdFg91rc0E1I/Bh/9JzZFtrInvmTgnA4y1Ds1GJmp/BArK87zZo1SPIljhT0eb 4Knk0PNuEc9rw/snjcQOOHEzi4saW4nLM72WbAWa2XDKfExpNgFLnd0H9W6/X3o45Y8e MykoGPmPXOpQ6fIcPHs5e2kkN95orSNsKwz9WEwU60w0rGkrFsbASEWV2ZIRaKUDswIj caeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=/pL+Oyiy0IE/VSN3VcOMQBkBUj2zcO4M5BEO9TZep1A=; b=0/acUsipQyYTVzPHej9+h2X9dHSVzBRQD876L9mBN9Hh5+sMTiS6h5JVNVzLItg3sT LTS/U/Lj4yOVyPKmwRUAzGr59+R0xb5n142MMrID0e7qx6TYJidnq6sCtuZu5skiUNXq lgQw7cx2PNdiQizrn3g0nSRM6njghS/3gsXO33fvpTSZH4fJPUBO5iGpX6S8czmnyk7W j5bGzq+lYtio/wbkqz/+/aILQJLCFpVyTS/F/3VblwYw5YW5namzknuWTEfD9KYmoQHo gO5q2X/dX+EEjd0Bci30fwu33L5tiyRGHwQbBDMgPYCiHjIV9bBVW36mfi4bXdFMJYrN 9hPA== X-Gm-Message-State: AOAM531TeNB1IRPCUHLrfKxSrhay/U0zLqxbGEwHKT7Vu7VjHhvFOnKI 7vAgStqlToEHIXyvex4E700= X-Google-Smtp-Source: ABdhPJwMk3Sh4eyDIhTFLQU+Br82TWmaoMdoXdpg3wMxizhZnQz7Gu4prOucaSRKiPWIfb1fa4zi1g== X-Received: by 2002:a05:6000:1681:: with SMTP id y1mr7257994wrd.52.1637327767994; Fri, 19 Nov 2021 05:16:07 -0800 (PST) Received: from [10.168.10.170] ([170.253.36.171]) by smtp.gmail.com with ESMTPSA id q26sm3003188wrc.39.2021.11.19.05.16.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Nov 2021 05:16:07 -0800 (PST) Message-ID: Date: Fri, 19 Nov 2021 14:16:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH 00/17] Add memberof(), split some headers, and slightly simplify code Content-Language: en-US To: Jani Nikula , LKML Cc: Ajit Khaparde , Andrew Morton , Andy Shevchenko , Arnd Bergmann , Bjorn Andersson , Borislav Petkov , Corey Minyard , Chris Mason , Christian Brauner , David Sterba , Jason Wang , Jitendra Bhivare , John Hubbard , "John S . Gruber" , Jonathan Cameron , Joonas Lahtinen , Josef Bacik , Kees Cook , Ketan Mukadam , Len Brown , "Michael S. Tsirkin" , Miguel Ojeda , Mike Rapoport , Nick Desaulniers , "Rafael J. Wysocki" , Rasmus Villemoes , Rodrigo Vivi , Russell King , Somnath Kotur , Sriharsha Basavapatna , Subbu Seetharaman , intel-gfx@lists.freedesktop.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org References: <20211119113644.1600-1-alx.manpages@gmail.com> <87mtm0jos3.fsf@intel.com> From: "Alejandro Colomar (man-pages)" In-Reply-To: <87mtm0jos3.fsf@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Hi Jani, On 11/19/21 13:47, Jani Nikula wrote: > On Fri, 19 Nov 2021, Alejandro Colomar wrote: >> In the first and second commits >> I changed a lot of stuff in many parts, >> and that's why I CCd so many people (also in this cover letter). >> However, to avoid spamming, >> and since it would be a nightmare to >> find all the relevant people affected in so many different areas, >> I only CCd in 01, 02 and in the cover letter. >> If anyone is interested in reading the full patch set, >> I sent it to the LKML. > > I think with the patch split you have this would be a nightmare to get > merged. Please consider refactoring the headers first, and once those > are reviewed and merged, you can proceed with using them elsewhere. For > example, we'd want the drm/i915 changes in patches separate from changes > to other drivers or the core headers. So, would it be preferable something like this?: Patch set 1: - Add with memberof() - Split offsetof() to - Split offsetofend() to - Split typeof_member() to - Split sizeof_field() to - Split NULL to - Split ARRAY_SIZE() to - Implement offsetof() in terms of memberof() - Implement typeof_member() in terms of memberof() - Implement sizeof_field() in terms of memberof() - Implement container_of_safe() in terms of container_of() - Remove unnecessary cast from container_of[_safe]() - Cosmetic changes Patch set 2: - And in a different patch set, fix all other files that make use of these macros. Patch 1 without editing any other files except for the basic ones, and adding includes where the definition had been previously, to not break stuff. And then, start patching individual subsystems and send tiny patch sets to each of them? For the first part, I agree it is better. I'll change it to do that. I'll send an v2 with less changes and more organized. For the second part, I'll see what I can do after the first one has been reviewed. I'll do tiny patches with a few changes to one or few files, so that I can reorganize them easily with a rebase -i afterwards, and then decide. Thanks, Alex > >> >> >> Alejandro Colomar (17): >> linux/container_of.h: Add memberof(T, m) >> Use memberof(T, m) instead of explicit NULL dereference >> Replace some uses of memberof() by its wrappers >> linux/memberof.h: Move memberof() to separate header >> linux/typeof_member.h: Move typeof_member() to a separate header >> Simplify sizeof(typeof_member()) to sizeof_field() >> linux/NULL.h: Move NULL to a separate header >> linux/offsetof.h: Move offsetof(T, m) to a separate header >> linux/offsetof.h: Implement offsetof() in terms of memberof() >> linux/container_of.h: Implement container_of_safe() in terms of >> container_of() >> linux/container_of.h: Cosmetic >> linux/container_of.h: Remove unnecessary cast to (void *) >> linux/sizeof_field.h: Move sizeof_field(T, m) to a separate header >> include/linux/: Include a smaller header if just for NULL >> linux/offsetofend.h: Move offsetofend(T, m) to a separate header >> linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header >> include/: Include for ARRAY_SIZE() >> >> arch/x86/include/asm/bootparam_utils.h | 3 +- >> arch/x86/kernel/signal_compat.c | 5 ++-- >> drivers/gpu/drm/i915/i915_sw_fence.c | 1 + >> drivers/gpu/drm/i915/i915_utils.h | 5 ++-- >> drivers/gpu/drm/i915/intel_runtime_pm.h | 3 +- >> drivers/net/ethernet/emulex/benet/be.h | 10 +++---- >> drivers/net/ethernet/i825xx/ether1.c | 7 +++-- >> drivers/platform/x86/wmi.c | 3 +- >> drivers/scsi/be2iscsi/be.h | 12 ++++---- >> drivers/scsi/be2iscsi/be_cmds.h | 5 +++- >> fs/btrfs/ctree.h | 5 ++-- >> fs/proc/inode.c | 1 + >> include/acpi/actypes.h | 4 ++- >> include/crypto/internal/blake2b.h | 1 + >> include/crypto/internal/blake2s.h | 1 + >> include/crypto/internal/chacha.h | 1 + >> include/drm/drm_mipi_dbi.h | 1 + >> include/drm/drm_mode_object.h | 1 + >> include/kunit/test.h | 1 + >> include/linux/NULL.h | 10 +++++++ >> include/linux/arm_ffa.h | 1 + >> include/linux/array_size.h | 15 ++++++++++ >> include/linux/blk_types.h | 1 + >> include/linux/can/core.h | 1 + >> include/linux/clk-provider.h | 1 + >> include/linux/container_of.h | 28 ++++++++++------- >> include/linux/counter.h | 1 + >> include/linux/crash_core.h | 1 + >> include/linux/efi.h | 1 + >> include/linux/extable.h | 2 +- >> include/linux/f2fs_fs.h | 1 + >> include/linux/filter.h | 3 ++ >> include/linux/fs.h | 1 + >> include/linux/genl_magic_func.h | 1 + >> include/linux/hashtable.h | 1 + >> include/linux/ieee80211.h | 1 + >> include/linux/kbuild.h | 3 ++ >> include/linux/kernel.h | 7 +---- >> include/linux/kfifo.h | 1 + >> include/linux/kvm_host.h | 3 ++ >> include/linux/libata.h | 1 + >> include/linux/llist.h | 1 + >> include/linux/memberof.h | 11 +++++++ >> include/linux/mlx5/device.h | 1 + >> include/linux/mlx5/driver.h | 1 + >> include/linux/mm_types.h | 1 + >> include/linux/moduleparam.h | 3 ++ >> include/linux/mtd/rawnand.h | 1 + >> include/linux/netdevice.h | 1 + >> include/linux/netfilter.h | 1 + >> include/linux/nvme-fc.h | 2 ++ >> include/linux/offsetof.h | 17 +++++++++++ >> include/linux/offsetofend.h | 19 ++++++++++++ >> include/linux/pagemap.h | 1 + >> include/linux/phy.h | 1 + >> include/linux/phy_led_triggers.h | 1 + >> include/linux/pinctrl/machine.h | 1 + >> include/linux/property.h | 1 + >> include/linux/rcupdate.h | 1 + >> include/linux/rcupdate_wait.h | 1 + >> include/linux/regmap.h | 1 + >> include/linux/sched/task.h | 1 + >> include/linux/sizeof_field.h | 14 +++++++++ >> include/linux/skb_array.h | 1 + >> include/linux/skbuff.h | 1 + >> include/linux/skmsg.h | 3 ++ >> include/linux/slab.h | 2 ++ >> include/linux/spinlock_types.h | 1 + >> include/linux/stddef.h | 30 +++---------------- >> include/linux/string.h | 5 +++- >> include/linux/surface_aggregator/controller.h | 1 + >> include/linux/surface_aggregator/serial_hub.h | 1 + >> include/linux/swap.h | 1 + >> include/linux/ti-emif-sram.h | 1 + >> include/linux/typeof_member.h | 11 +++++++ >> include/linux/ucs2_string.h | 2 +- >> include/linux/vdpa.h | 1 + >> include/linux/virtio_config.h | 17 ++++++----- >> include/linux/wireless.h | 2 ++ >> include/net/bond_3ad.h | 1 + >> include/net/dsa.h | 1 + >> include/net/ip_vs.h | 1 + >> include/net/netfilter/nf_conntrack_tuple.h | 1 + >> include/net/netfilter/nf_tables.h | 1 + >> include/net/netlink.h | 1 + >> include/rdma/uverbs_ioctl.h | 1 + >> include/rdma/uverbs_named_ioctl.h | 1 + >> include/scsi/scsi_host.h | 1 + >> include/sound/soc-dapm.h | 1 + >> include/sound/soc.h | 1 + >> include/trace/events/wbt.h | 1 + >> include/uapi/linux/netfilter/xt_sctp.h | 1 + >> include/xen/hvm.h | 1 + >> kernel/kallsyms.c | 3 +- >> 94 files changed, 255 insertions(+), 79 deletions(-) >> create mode 100644 include/linux/NULL.h >> create mode 100644 include/linux/array_size.h >> create mode 100644 include/linux/memberof.h >> create mode 100644 include/linux/offsetof.h >> create mode 100644 include/linux/offsetofend.h >> create mode 100644 include/linux/sizeof_field.h >> create mode 100644 include/linux/typeof_member.h > -- Alejandro Colomar Linux man-pages comaintainer; http://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/ From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4D76C433EF for ; Fri, 19 Nov 2021 13:17:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60FD061544 for ; Fri, 19 Nov 2021 13:17:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 60FD061544 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8qL0PFpGNnETPYZJRSZZHUZPrgUIfEraVu2Ef5026U0=; b=P29j1vLPmr0QMK 0ur4LXxbiiXlouh7BquOpYSmVDYcuBWaeYE9MFojv/h8ThnCoDw3QKitbVvEelJgThflgdfU7ep8F W15/eNKl9yd/4wprh7gWvgxuZzB5aWnTXVYXACjY9Xk9EXwpKP0yD2ovmzb0o0I5/SsRuKTBJRj+/ Hm6LM4aWpudRJr8Nze0Hh8NuKUk5J/Ll1nx7x0dsvHHlEz4xgT+0poX0YB1FYFFAi8lkBWjmau9zu 3bE9BR4/yS/Hkd5ag/y3fD9J+IgV3iJoyNNV6WOSHWZE3FejkKrmTa+QkyX4ixllynzZzkiV8wOTv Dol71TVTQchXWN4wbeaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo3kW-00ASP3-1F; Fri, 19 Nov 2021 13:16:16 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo3kR-00ASNH-E4 for linux-arm-kernel@lists.infradead.org; Fri, 19 Nov 2021 13:16:13 +0000 Received: by mail-wr1-x432.google.com with SMTP id t30so18063541wra.10 for ; Fri, 19 Nov 2021 05:16:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=/pL+Oyiy0IE/VSN3VcOMQBkBUj2zcO4M5BEO9TZep1A=; b=fYTnnvM8ksusjPkK4Sby+CQscGGjmFeWWkZjInk/876Zd4Z/LprwRSUWcHweTrZLPP vmB1nYM0TvqZDPEA3v2PisH3FUjA01QMt5bKVp2vWUTwq8PTA3BIzg0tCJ/MMpSi6TBv jSxjdZYdFg91rc0E1I/Bh/9JzZFtrInvmTgnA4y1Ds1GJmp/BArK87zZo1SPIljhT0eb 4Knk0PNuEc9rw/snjcQOOHEzi4saW4nLM72WbAWa2XDKfExpNgFLnd0H9W6/X3o45Y8e MykoGPmPXOpQ6fIcPHs5e2kkN95orSNsKwz9WEwU60w0rGkrFsbASEWV2ZIRaKUDswIj caeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=/pL+Oyiy0IE/VSN3VcOMQBkBUj2zcO4M5BEO9TZep1A=; b=Ltkx7aSUiEJCK7XE/7VyJk9453o3HZstXesfqvE3KrzAz2eJ7EYvL1wsjAwxiQIuc4 4t7c9xzajyKCuGfALdQqLeaVKp6yMCYGXU70e0mBrWYXmvLYJo/gtz9LBGc5CFE3yyoj U3nom01jAOjW53b/V0aWs2sa4+oBT97Oi9ptN8c4oc+E2ZypqE45lCz+pmhIVfxYj6hI b4Jt0oizXGWyZ0C4MeShOOPSCYE6F2OYXsjnlhaq4vRApYEAardqz44Iz7b+KKI4XkUo rOaMRftE8Jgk4WUeKIULTbPluplMNKZ1zbNoeDe2CVBr9ZdlarvMqiJIVxoOl/N1SG5f jQNw== X-Gm-Message-State: AOAM530U61wkofFzwERMiAZN7OurF7ehgw4De+5PsI/3pBCKS76HIMU1 gqoqaAGpqYAqhZ8ZsdFMK4RGni0BM5r2IA== X-Google-Smtp-Source: ABdhPJwMk3Sh4eyDIhTFLQU+Br82TWmaoMdoXdpg3wMxizhZnQz7Gu4prOucaSRKiPWIfb1fa4zi1g== X-Received: by 2002:a05:6000:1681:: with SMTP id y1mr7257994wrd.52.1637327767994; Fri, 19 Nov 2021 05:16:07 -0800 (PST) Received: from [10.168.10.170] ([170.253.36.171]) by smtp.gmail.com with ESMTPSA id q26sm3003188wrc.39.2021.11.19.05.16.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Nov 2021 05:16:07 -0800 (PST) Message-ID: Date: Fri, 19 Nov 2021 14:16:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH 00/17] Add memberof(), split some headers, and slightly simplify code Content-Language: en-US To: Jani Nikula , LKML Cc: Ajit Khaparde , Andrew Morton , Andy Shevchenko , Arnd Bergmann , Bjorn Andersson , Borislav Petkov , Corey Minyard , Chris Mason , Christian Brauner , David Sterba , Jason Wang , Jitendra Bhivare , John Hubbard , "John S . Gruber" , Jonathan Cameron , Joonas Lahtinen , Josef Bacik , Kees Cook , Ketan Mukadam , Len Brown , "Michael S. Tsirkin" , Miguel Ojeda , Mike Rapoport , Nick Desaulniers , "Rafael J. Wysocki" , Rasmus Villemoes , Rodrigo Vivi , Russell King , Somnath Kotur , Sriharsha Basavapatna , Subbu Seetharaman , intel-gfx@lists.freedesktop.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org References: <20211119113644.1600-1-alx.manpages@gmail.com> <87mtm0jos3.fsf@intel.com> From: "Alejandro Colomar (man-pages)" In-Reply-To: <87mtm0jos3.fsf@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211119_051611_519472_ECDACEA0 X-CRM114-Status: GOOD ( 26.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jani, On 11/19/21 13:47, Jani Nikula wrote: > On Fri, 19 Nov 2021, Alejandro Colomar wrote: >> In the first and second commits >> I changed a lot of stuff in many parts, >> and that's why I CCd so many people (also in this cover letter). >> However, to avoid spamming, >> and since it would be a nightmare to >> find all the relevant people affected in so many different areas, >> I only CCd in 01, 02 and in the cover letter. >> If anyone is interested in reading the full patch set, >> I sent it to the LKML. > > I think with the patch split you have this would be a nightmare to get > merged. Please consider refactoring the headers first, and once those > are reviewed and merged, you can proceed with using them elsewhere. For > example, we'd want the drm/i915 changes in patches separate from changes > to other drivers or the core headers. So, would it be preferable something like this?: Patch set 1: - Add with memberof() - Split offsetof() to - Split offsetofend() to - Split typeof_member() to - Split sizeof_field() to - Split NULL to - Split ARRAY_SIZE() to - Implement offsetof() in terms of memberof() - Implement typeof_member() in terms of memberof() - Implement sizeof_field() in terms of memberof() - Implement container_of_safe() in terms of container_of() - Remove unnecessary cast from container_of[_safe]() - Cosmetic changes Patch set 2: - And in a different patch set, fix all other files that make use of these macros. Patch 1 without editing any other files except for the basic ones, and adding includes where the definition had been previously, to not break stuff. And then, start patching individual subsystems and send tiny patch sets to each of them? For the first part, I agree it is better. I'll change it to do that. I'll send an v2 with less changes and more organized. For the second part, I'll see what I can do after the first one has been reviewed. I'll do tiny patches with a few changes to one or few files, so that I can reorganize them easily with a rebase -i afterwards, and then decide. Thanks, Alex > >> >> >> Alejandro Colomar (17): >> linux/container_of.h: Add memberof(T, m) >> Use memberof(T, m) instead of explicit NULL dereference >> Replace some uses of memberof() by its wrappers >> linux/memberof.h: Move memberof() to separate header >> linux/typeof_member.h: Move typeof_member() to a separate header >> Simplify sizeof(typeof_member()) to sizeof_field() >> linux/NULL.h: Move NULL to a separate header >> linux/offsetof.h: Move offsetof(T, m) to a separate header >> linux/offsetof.h: Implement offsetof() in terms of memberof() >> linux/container_of.h: Implement container_of_safe() in terms of >> container_of() >> linux/container_of.h: Cosmetic >> linux/container_of.h: Remove unnecessary cast to (void *) >> linux/sizeof_field.h: Move sizeof_field(T, m) to a separate header >> include/linux/: Include a smaller header if just for NULL >> linux/offsetofend.h: Move offsetofend(T, m) to a separate header >> linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header >> include/: Include for ARRAY_SIZE() >> >> arch/x86/include/asm/bootparam_utils.h | 3 +- >> arch/x86/kernel/signal_compat.c | 5 ++-- >> drivers/gpu/drm/i915/i915_sw_fence.c | 1 + >> drivers/gpu/drm/i915/i915_utils.h | 5 ++-- >> drivers/gpu/drm/i915/intel_runtime_pm.h | 3 +- >> drivers/net/ethernet/emulex/benet/be.h | 10 +++---- >> drivers/net/ethernet/i825xx/ether1.c | 7 +++-- >> drivers/platform/x86/wmi.c | 3 +- >> drivers/scsi/be2iscsi/be.h | 12 ++++---- >> drivers/scsi/be2iscsi/be_cmds.h | 5 +++- >> fs/btrfs/ctree.h | 5 ++-- >> fs/proc/inode.c | 1 + >> include/acpi/actypes.h | 4 ++- >> include/crypto/internal/blake2b.h | 1 + >> include/crypto/internal/blake2s.h | 1 + >> include/crypto/internal/chacha.h | 1 + >> include/drm/drm_mipi_dbi.h | 1 + >> include/drm/drm_mode_object.h | 1 + >> include/kunit/test.h | 1 + >> include/linux/NULL.h | 10 +++++++ >> include/linux/arm_ffa.h | 1 + >> include/linux/array_size.h | 15 ++++++++++ >> include/linux/blk_types.h | 1 + >> include/linux/can/core.h | 1 + >> include/linux/clk-provider.h | 1 + >> include/linux/container_of.h | 28 ++++++++++------- >> include/linux/counter.h | 1 + >> include/linux/crash_core.h | 1 + >> include/linux/efi.h | 1 + >> include/linux/extable.h | 2 +- >> include/linux/f2fs_fs.h | 1 + >> include/linux/filter.h | 3 ++ >> include/linux/fs.h | 1 + >> include/linux/genl_magic_func.h | 1 + >> include/linux/hashtable.h | 1 + >> include/linux/ieee80211.h | 1 + >> include/linux/kbuild.h | 3 ++ >> include/linux/kernel.h | 7 +---- >> include/linux/kfifo.h | 1 + >> include/linux/kvm_host.h | 3 ++ >> include/linux/libata.h | 1 + >> include/linux/llist.h | 1 + >> include/linux/memberof.h | 11 +++++++ >> include/linux/mlx5/device.h | 1 + >> include/linux/mlx5/driver.h | 1 + >> include/linux/mm_types.h | 1 + >> include/linux/moduleparam.h | 3 ++ >> include/linux/mtd/rawnand.h | 1 + >> include/linux/netdevice.h | 1 + >> include/linux/netfilter.h | 1 + >> include/linux/nvme-fc.h | 2 ++ >> include/linux/offsetof.h | 17 +++++++++++ >> include/linux/offsetofend.h | 19 ++++++++++++ >> include/linux/pagemap.h | 1 + >> include/linux/phy.h | 1 + >> include/linux/phy_led_triggers.h | 1 + >> include/linux/pinctrl/machine.h | 1 + >> include/linux/property.h | 1 + >> include/linux/rcupdate.h | 1 + >> include/linux/rcupdate_wait.h | 1 + >> include/linux/regmap.h | 1 + >> include/linux/sched/task.h | 1 + >> include/linux/sizeof_field.h | 14 +++++++++ >> include/linux/skb_array.h | 1 + >> include/linux/skbuff.h | 1 + >> include/linux/skmsg.h | 3 ++ >> include/linux/slab.h | 2 ++ >> include/linux/spinlock_types.h | 1 + >> include/linux/stddef.h | 30 +++---------------- >> include/linux/string.h | 5 +++- >> include/linux/surface_aggregator/controller.h | 1 + >> include/linux/surface_aggregator/serial_hub.h | 1 + >> include/linux/swap.h | 1 + >> include/linux/ti-emif-sram.h | 1 + >> include/linux/typeof_member.h | 11 +++++++ >> include/linux/ucs2_string.h | 2 +- >> include/linux/vdpa.h | 1 + >> include/linux/virtio_config.h | 17 ++++++----- >> include/linux/wireless.h | 2 ++ >> include/net/bond_3ad.h | 1 + >> include/net/dsa.h | 1 + >> include/net/ip_vs.h | 1 + >> include/net/netfilter/nf_conntrack_tuple.h | 1 + >> include/net/netfilter/nf_tables.h | 1 + >> include/net/netlink.h | 1 + >> include/rdma/uverbs_ioctl.h | 1 + >> include/rdma/uverbs_named_ioctl.h | 1 + >> include/scsi/scsi_host.h | 1 + >> include/sound/soc-dapm.h | 1 + >> include/sound/soc.h | 1 + >> include/trace/events/wbt.h | 1 + >> include/uapi/linux/netfilter/xt_sctp.h | 1 + >> include/xen/hvm.h | 1 + >> kernel/kallsyms.c | 3 +- >> 94 files changed, 255 insertions(+), 79 deletions(-) >> create mode 100644 include/linux/NULL.h >> create mode 100644 include/linux/array_size.h >> create mode 100644 include/linux/memberof.h >> create mode 100644 include/linux/offsetof.h >> create mode 100644 include/linux/offsetofend.h >> create mode 100644 include/linux/sizeof_field.h >> create mode 100644 include/linux/typeof_member.h > -- Alejandro Colomar Linux man-pages comaintainer; http://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACE2CC433F5 for ; Fri, 19 Nov 2021 15:17:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E47A619BB for ; Fri, 19 Nov 2021 15:17:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7E47A619BB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB4066EB27; Fri, 19 Nov 2021 15:16:49 +0000 (UTC) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B47F6EAC3 for ; Fri, 19 Nov 2021 13:16:09 +0000 (UTC) Received: by mail-wr1-x430.google.com with SMTP id r8so18078449wra.7 for ; Fri, 19 Nov 2021 05:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=/pL+Oyiy0IE/VSN3VcOMQBkBUj2zcO4M5BEO9TZep1A=; b=fYTnnvM8ksusjPkK4Sby+CQscGGjmFeWWkZjInk/876Zd4Z/LprwRSUWcHweTrZLPP vmB1nYM0TvqZDPEA3v2PisH3FUjA01QMt5bKVp2vWUTwq8PTA3BIzg0tCJ/MMpSi6TBv jSxjdZYdFg91rc0E1I/Bh/9JzZFtrInvmTgnA4y1Ds1GJmp/BArK87zZo1SPIljhT0eb 4Knk0PNuEc9rw/snjcQOOHEzi4saW4nLM72WbAWa2XDKfExpNgFLnd0H9W6/X3o45Y8e MykoGPmPXOpQ6fIcPHs5e2kkN95orSNsKwz9WEwU60w0rGkrFsbASEWV2ZIRaKUDswIj caeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=/pL+Oyiy0IE/VSN3VcOMQBkBUj2zcO4M5BEO9TZep1A=; b=poRF7fR72kbWBMNQlpBKk+yvc9B1IYhHjJYB+IwkDRyB7mVi/TXz707xIqwCz9OLHO +479nR/vTejCjeMVASP+wiZKLZdz3NI+Nlz0sMvpzLsr1NZRqyFaX+bxuzynN81KA+cb +NE5xBBqxykFwGnpd0HUPHAhEzyFKut+AX6xg/5ZXlJceiqtuoYXL24sCr9Tc3G/arVJ hCtQXPgrEYHDSVgzJwgexw/EmUs8355qIbKFFSpIn8U7WZ96oNH4sBMqFCuR/16j5rC1 AiXIOlWC6Ds8SWV5Ik3FVweUsS/+dHNVqXE+NMHnQvGDif8sba2i2AujNFm7HlxHgIeB Oi9A== X-Gm-Message-State: AOAM5308hu+ibOm6oQAbQVWzwSgXz+y4cDRu9aG194wCYEu4IV4SIM58 TFEOltvDAYqiUcRm5zrRFyU= X-Google-Smtp-Source: ABdhPJwMk3Sh4eyDIhTFLQU+Br82TWmaoMdoXdpg3wMxizhZnQz7Gu4prOucaSRKiPWIfb1fa4zi1g== X-Received: by 2002:a05:6000:1681:: with SMTP id y1mr7257994wrd.52.1637327767994; Fri, 19 Nov 2021 05:16:07 -0800 (PST) Received: from [10.168.10.170] ([170.253.36.171]) by smtp.gmail.com with ESMTPSA id q26sm3003188wrc.39.2021.11.19.05.16.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Nov 2021 05:16:07 -0800 (PST) Message-ID: Date: Fri, 19 Nov 2021 14:16:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Content-Language: en-US To: Jani Nikula , LKML References: <20211119113644.1600-1-alx.manpages@gmail.com> <87mtm0jos3.fsf@intel.com> From: "Alejandro Colomar (man-pages)" In-Reply-To: <87mtm0jos3.fsf@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 19 Nov 2021 15:16:46 +0000 Subject: Re: [Intel-gfx] [PATCH 00/17] Add memberof(), split some headers, and slightly simplify code X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , Ajit Khaparde , "Michael S. Tsirkin" , Jason Wang , Rasmus Villemoes , Bjorn Andersson , Chris Mason , Christian Brauner , Ketan Mukadam , Somnath Kotur , linux-scsi@vger.kernel.org, Subbu Seetharaman , "Rafael J. Wysocki" , Russell King , Mike Rapoport , linux-acpi@vger.kernel.org, Miguel Ojeda , Borislav Petkov , virtualization@lists.linux-foundation.org, Len Brown , Kees Cook , Arnd Bergmann , John Hubbard , intel-gfx@lists.freedesktop.org, Josef Bacik , Jitendra Bhivare , Jonathan Cameron , David Sterba , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, Sriharsha Basavapatna , netdev@vger.kernel.org, Nick Desaulniers , "John S . Gruber" , Andrew Morton , linux-btrfs@vger.kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hi Jani, On 11/19/21 13:47, Jani Nikula wrote: > On Fri, 19 Nov 2021, Alejandro Colomar wrote: >> In the first and second commits >> I changed a lot of stuff in many parts, >> and that's why I CCd so many people (also in this cover letter). >> However, to avoid spamming, >> and since it would be a nightmare to >> find all the relevant people affected in so many different areas, >> I only CCd in 01, 02 and in the cover letter. >> If anyone is interested in reading the full patch set, >> I sent it to the LKML. > > I think with the patch split you have this would be a nightmare to get > merged. Please consider refactoring the headers first, and once those > are reviewed and merged, you can proceed with using them elsewhere. For > example, we'd want the drm/i915 changes in patches separate from changes > to other drivers or the core headers. So, would it be preferable something like this?: Patch set 1: - Add with memberof() - Split offsetof() to - Split offsetofend() to - Split typeof_member() to - Split sizeof_field() to - Split NULL to - Split ARRAY_SIZE() to - Implement offsetof() in terms of memberof() - Implement typeof_member() in terms of memberof() - Implement sizeof_field() in terms of memberof() - Implement container_of_safe() in terms of container_of() - Remove unnecessary cast from container_of[_safe]() - Cosmetic changes Patch set 2: - And in a different patch set, fix all other files that make use of these macros. Patch 1 without editing any other files except for the basic ones, and adding includes where the definition had been previously, to not break stuff. And then, start patching individual subsystems and send tiny patch sets to each of them? For the first part, I agree it is better. I'll change it to do that. I'll send an v2 with less changes and more organized. For the second part, I'll see what I can do after the first one has been reviewed. I'll do tiny patches with a few changes to one or few files, so that I can reorganize them easily with a rebase -i afterwards, and then decide. Thanks, Alex > >> >> >> Alejandro Colomar (17): >> linux/container_of.h: Add memberof(T, m) >> Use memberof(T, m) instead of explicit NULL dereference >> Replace some uses of memberof() by its wrappers >> linux/memberof.h: Move memberof() to separate header >> linux/typeof_member.h: Move typeof_member() to a separate header >> Simplify sizeof(typeof_member()) to sizeof_field() >> linux/NULL.h: Move NULL to a separate header >> linux/offsetof.h: Move offsetof(T, m) to a separate header >> linux/offsetof.h: Implement offsetof() in terms of memberof() >> linux/container_of.h: Implement container_of_safe() in terms of >> container_of() >> linux/container_of.h: Cosmetic >> linux/container_of.h: Remove unnecessary cast to (void *) >> linux/sizeof_field.h: Move sizeof_field(T, m) to a separate header >> include/linux/: Include a smaller header if just for NULL >> linux/offsetofend.h: Move offsetofend(T, m) to a separate header >> linux/array_size.h: Move ARRAY_SIZE(arr) to a separate header >> include/: Include for ARRAY_SIZE() >> >> arch/x86/include/asm/bootparam_utils.h | 3 +- >> arch/x86/kernel/signal_compat.c | 5 ++-- >> drivers/gpu/drm/i915/i915_sw_fence.c | 1 + >> drivers/gpu/drm/i915/i915_utils.h | 5 ++-- >> drivers/gpu/drm/i915/intel_runtime_pm.h | 3 +- >> drivers/net/ethernet/emulex/benet/be.h | 10 +++---- >> drivers/net/ethernet/i825xx/ether1.c | 7 +++-- >> drivers/platform/x86/wmi.c | 3 +- >> drivers/scsi/be2iscsi/be.h | 12 ++++---- >> drivers/scsi/be2iscsi/be_cmds.h | 5 +++- >> fs/btrfs/ctree.h | 5 ++-- >> fs/proc/inode.c | 1 + >> include/acpi/actypes.h | 4 ++- >> include/crypto/internal/blake2b.h | 1 + >> include/crypto/internal/blake2s.h | 1 + >> include/crypto/internal/chacha.h | 1 + >> include/drm/drm_mipi_dbi.h | 1 + >> include/drm/drm_mode_object.h | 1 + >> include/kunit/test.h | 1 + >> include/linux/NULL.h | 10 +++++++ >> include/linux/arm_ffa.h | 1 + >> include/linux/array_size.h | 15 ++++++++++ >> include/linux/blk_types.h | 1 + >> include/linux/can/core.h | 1 + >> include/linux/clk-provider.h | 1 + >> include/linux/container_of.h | 28 ++++++++++------- >> include/linux/counter.h | 1 + >> include/linux/crash_core.h | 1 + >> include/linux/efi.h | 1 + >> include/linux/extable.h | 2 +- >> include/linux/f2fs_fs.h | 1 + >> include/linux/filter.h | 3 ++ >> include/linux/fs.h | 1 + >> include/linux/genl_magic_func.h | 1 + >> include/linux/hashtable.h | 1 + >> include/linux/ieee80211.h | 1 + >> include/linux/kbuild.h | 3 ++ >> include/linux/kernel.h | 7 +---- >> include/linux/kfifo.h | 1 + >> include/linux/kvm_host.h | 3 ++ >> include/linux/libata.h | 1 + >> include/linux/llist.h | 1 + >> include/linux/memberof.h | 11 +++++++ >> include/linux/mlx5/device.h | 1 + >> include/linux/mlx5/driver.h | 1 + >> include/linux/mm_types.h | 1 + >> include/linux/moduleparam.h | 3 ++ >> include/linux/mtd/rawnand.h | 1 + >> include/linux/netdevice.h | 1 + >> include/linux/netfilter.h | 1 + >> include/linux/nvme-fc.h | 2 ++ >> include/linux/offsetof.h | 17 +++++++++++ >> include/linux/offsetofend.h | 19 ++++++++++++ >> include/linux/pagemap.h | 1 + >> include/linux/phy.h | 1 + >> include/linux/phy_led_triggers.h | 1 + >> include/linux/pinctrl/machine.h | 1 + >> include/linux/property.h | 1 + >> include/linux/rcupdate.h | 1 + >> include/linux/rcupdate_wait.h | 1 + >> include/linux/regmap.h | 1 + >> include/linux/sched/task.h | 1 + >> include/linux/sizeof_field.h | 14 +++++++++ >> include/linux/skb_array.h | 1 + >> include/linux/skbuff.h | 1 + >> include/linux/skmsg.h | 3 ++ >> include/linux/slab.h | 2 ++ >> include/linux/spinlock_types.h | 1 + >> include/linux/stddef.h | 30 +++---------------- >> include/linux/string.h | 5 +++- >> include/linux/surface_aggregator/controller.h | 1 + >> include/linux/surface_aggregator/serial_hub.h | 1 + >> include/linux/swap.h | 1 + >> include/linux/ti-emif-sram.h | 1 + >> include/linux/typeof_member.h | 11 +++++++ >> include/linux/ucs2_string.h | 2 +- >> include/linux/vdpa.h | 1 + >> include/linux/virtio_config.h | 17 ++++++----- >> include/linux/wireless.h | 2 ++ >> include/net/bond_3ad.h | 1 + >> include/net/dsa.h | 1 + >> include/net/ip_vs.h | 1 + >> include/net/netfilter/nf_conntrack_tuple.h | 1 + >> include/net/netfilter/nf_tables.h | 1 + >> include/net/netlink.h | 1 + >> include/rdma/uverbs_ioctl.h | 1 + >> include/rdma/uverbs_named_ioctl.h | 1 + >> include/scsi/scsi_host.h | 1 + >> include/sound/soc-dapm.h | 1 + >> include/sound/soc.h | 1 + >> include/trace/events/wbt.h | 1 + >> include/uapi/linux/netfilter/xt_sctp.h | 1 + >> include/xen/hvm.h | 1 + >> kernel/kallsyms.c | 3 +- >> 94 files changed, 255 insertions(+), 79 deletions(-) >> create mode 100644 include/linux/NULL.h >> create mode 100644 include/linux/array_size.h >> create mode 100644 include/linux/memberof.h >> create mode 100644 include/linux/offsetof.h >> create mode 100644 include/linux/offsetofend.h >> create mode 100644 include/linux/sizeof_field.h >> create mode 100644 include/linux/typeof_member.h > -- Alejandro Colomar Linux man-pages comaintainer; http://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/