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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5069CC31E44 for ; Tue, 11 Jun 2019 20:48:42 +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 28219206E0 for ; Tue, 11 Jun 2019 20:48:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jDHh4jB1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="UgyruavC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28219206E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Message-Id:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=COkSc0zT0usCaLlhGjUk/rOE5qJuvx2ofzDo9fsaZEs=; b=jDHh4jB16EiO1V gSlXOPj3Y2cU4GTuMRukjfJwadbh6bsu7gzfMhhDVzbESRYZmljsgfc7BRlNvXNfyGGxEOcOFxHpa g6gsfl1WZcBZIRg3OYHe/OHy70yjez7EGqoMYjaF+vbDhgRM2DTxhBSGn4IkTe5VYfnKPQ5ZaSBDr 5tyDnIPMMl/pMemGxiBeismj+LO93vKlYpFFMvB0RBRkJcKz8ySFl93bfLidMb1kLJ32SAEQBoXtm PuvP50twUfirsim+MPvZt+2s2+q9sg/iiKc/OpNLnHvDlVu90/152UvCyrSjW4ade0a0V8frHGyyS ACozdCbKkYaygpfG756g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hanh6-0004Av-PI; Tue, 11 Jun 2019 20:48:36 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hanh3-0004AP-Pw for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2019 20:48:34 +0000 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7CE6320684; Tue, 11 Jun 2019 20:48:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560286113; bh=y33lrlkQja7eoIovWsePDjdEdIHZ/RJoRj29PafhqOI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UgyruavCsSZLLvbVGn/8Url9hdMFqD/vc6cS2xvCxVAaLGSpqRyO7wgSl3uYSlnrC 3+fJjYU9x+kvkKn62ONAnZk5QMPYKtIt9RU5V2bIySebdJX4pNazzbre4oO5OlK2mG 81xtH5C+HAjNqK8Itw5roVmiKtRcfGnYRZlw+kVk= Date: Tue, 11 Jun 2019 13:48:31 -0700 From: Andrew Morton To: Shyam Saini Subject: Re: [PATCH V2] include: linux: Regularise the use of FIELD_SIZEOF macro Message-Id: <20190611134831.a60c11f4b691d14d04a87e29@linux-foundation.org> In-Reply-To: <20190611193836.2772-1-shyam.saini@amarulasolutions.com> References: <20190611193836.2772-1-shyam.saini@amarulasolutions.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_134833_863994_82CAAE76 X-CRM114-Status: GOOD ( 10.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: keescook@chromium.org, kvm@vger.kernel.org, kernel-hardening@lists.openwall.com, netdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-sctp@vger.kernel.org, devel@lists.orangefs.org, bpf@vger.kernel.org, linux-ext4@vger.kernel.org, intel-gvt-dev@lists.freedesktop.org, Alexey Dobriyan , linux-arm-kernel@lists.infradead.org, mayhs11saini@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 12 Jun 2019 01:08:36 +0530 Shyam Saini wrote: > Currently, there are 3 different macros, namely sizeof_field, SIZEOF_FIELD > and FIELD_SIZEOF which are used to calculate the size of a member of > structure, so to bring uniformity in entire kernel source tree lets use > FIELD_SIZEOF and replace all occurrences of other two macros with this. > > For this purpose, redefine FIELD_SIZEOF in include/linux/stddef.h and > tools/testing/selftests/bpf/bpf_util.h and remove its defination from > include/linux/kernel.h > > In favour of FIELD_SIZEOF, this patch also deprecates other two similar > macros sizeof_field and SIZEOF_FIELD. > > For code compatibility reason, retain sizeof_field macro as a wrapper macro > to FIELD_SIZEOF As Alexey has pointed out, C structs and unions don't have fields - they have members. So this is an opportunity to switch everything to a new member_sizeof(). What do people think of that and how does this impact the patch footprint? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel