Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3461764rwb; Fri, 16 Dec 2022 15:35:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXsMDDrU5LDio99yaCeMurla6ZPT/BwrxK+NxsrGtjziQCq5lF17gO5KMDjPIrTV+TJ4yk/v X-Received: by 2002:a17:90a:f2c5:b0:223:a473:fd77 with SMTP id gt5-20020a17090af2c500b00223a473fd77mr1204547pjb.2.1671233706031; Fri, 16 Dec 2022 15:35:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671233706; cv=none; d=google.com; s=arc-20160816; b=DA89Hc1fki2oylg9xTwT7xjlm2iCBZxi8OvRHDQcamlYh7TxRnnera1QD9X2OzV4So a21S3OL17/DZqsL4BZ7ziDZm2vb/Oi/DNkJGcQuDE1+IxUlYW32Ye6ibwpdj219b74Rj Zi17vDreMZqdju4zM49vIEMfKawRlq5p7Rb6coV7a8jObRahr/oF21NNHMO5N+tgncmQ F6wNIJq6f3aGZjZU8hcmYu4t1Yj9hSiNn9a/Mf51qekDumPrRvJLccmjf/XHUnLkrWFC lH/8HwBVidS8La3fo5Rff7nyz2zeI0NpcJyIUZUEmm5t8l14bby2E3H3evpFdWbqRgjg 8CxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=8JVjqU+NFsqoOx1nzHqvzhNnXugzS2QyOypn5WZoD0A=; b=hRGDLyD++8it62MPMPXkzMm5O0fOt1rj45Th1F9CKpWzQAhDltGTEGV8SxwP9cOOwv WN+XXpurWYTyWag9Uxl3wsnRF6qQxqvoiT7wiI0IArZC1lWGIObcwk96N7HsXIrF+yL/ 2alSK4FAy2iHum1oLGW7GfyGqZqT8uHpo6b87sQws/MsCuBH+vfx+XIeSJMTXXUgmqSd Kf3eWFXAnyiMfOr57BF2F0m3lnQgUz4CObmQWorojNAzrPg8MGtw6rGR9GWilUtGvmic xPFsTZyx6/G557hZZ69fbVC0hq8crQBUMYqjuWEF31yts7Ys+/ZYPtyd72daO99tvEYu vo4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a17090a128200b00218a89aac46si3965468pja.1.2022.12.16.15.34.57; Fri, 16 Dec 2022 15:35:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229979AbiLPXJB (ORCPT + 68 others); Fri, 16 Dec 2022 18:09:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbiLPXIn (ORCPT ); Fri, 16 Dec 2022 18:08:43 -0500 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F9F873B00; Fri, 16 Dec 2022 15:08:20 -0800 (PST) Received: by mail-wm1-f41.google.com with SMTP id b24-20020a05600c4a9800b003d21efdd61dso2792302wmp.3; Fri, 16 Dec 2022 15:08:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8JVjqU+NFsqoOx1nzHqvzhNnXugzS2QyOypn5WZoD0A=; b=nCTmxAgxMQvB8XeqdKkj2z0IVx9wr1wfiCxvySdtKPZzjfhp0fc3DnASLL7IY9I1+2 ax8zifHJ6WuubbRmO/fU2jfXQugqju81grhYL19LsuuBK98CHVR3swZpGcVD+jaYGuwk 5nAIrMaRXZud0QG3oUlp1hT3JNR4w8DSC46a0vnOl52YPlA6/HuhcKDuX0473AVawafB nd+EbJxJW6/N240y1UPYGjbeEDbak1Nfwukialcb1BE5e3y/z0Qy910cSIC3PC/4ageo nSNFFzudsylDIp7JDbt2hDI7qgMgFrLYUB6Xyc0bAbTwoWX3PwGVM15VgxBM4dAGm1S6 0Oqg== X-Gm-Message-State: ANoB5plV/7txV06Zrq9SUPMum5WhLG7AxXly7E/HhOXSkvWvTb5gbosD vANSIntbHNukf7NAzXn45aMc/nWvSgw= X-Received: by 2002:a7b:c84f:0:b0:3d2:389a:50aa with SMTP id c15-20020a7bc84f000000b003d2389a50aamr10230189wml.36.1671232098546; Fri, 16 Dec 2022 15:08:18 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id p13-20020a05600c1d8d00b003d01b84e9b2sm4023385wms.27.2022.12.16.15.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 15:08:17 -0800 (PST) Date: Fri, 16 Dec 2022 23:08:16 +0000 From: Wei Liu To: Wedson Almeida Filho Cc: Wei Liu , rust-for-linux@vger.kernel.org, Linux Kernel List , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron Subject: Re: [PATCH] rust: kernel: drop repetition in offset_of macro Message-ID: References: <20221216174927.1008629-1-wei.liu@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 16, 2022 at 06:26:57PM +0000, Wedson Almeida Filho wrote: > On Fri, 16 Dec 2022 at 17:49, Wei Liu wrote: > > > > It doesn't make sense to allow multiple fields to be specified in > > offset_of. > > Why do you say it doesn't make sense? > > Here's what I had in mind: > ``` > struct Y { > z: u32 > } > struct X { > y: Y > } > offset_of!(X, y.z) > ``` > > Which is something very plausible. You're right. I didn't consider that use case. This patch can be ignored. Thanks, Wei.