Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp374061imn; Wed, 3 Aug 2022 07:33:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR4jk1M+uhzMwGE75w/hpLXYT/A1t1e5a8TJRKwReOiw4HZCP/BfoiBDJpy5NJAJGihAl0pI X-Received: by 2002:a17:90b:1110:b0:1f4:fc9a:be2d with SMTP id gi16-20020a17090b111000b001f4fc9abe2dmr5166382pjb.41.1659537195638; Wed, 03 Aug 2022 07:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659537195; cv=none; d=google.com; s=arc-20160816; b=byY+VEy1DaLAIhOMxs+Yb6eP1MLqUA5unJbSvk26ngO+Q3wbXfjb0hNUCV7scNOwvu qbJxUUkq0GWdJ7K+RKUWuhR9Zi/doSYCSF1A79OWLyrTg2KJdEVP0g2bIBpO79NE9qJh XuXxu6mFCYUkvkMTVITng7MIPNuqrOSYhzdwY1Q2cuS28DNbYgG3o0JV1Bb8MeU/Eknd JjcsRMTj8t8vm9GQLxXY7K0EqjE4/bg98e/MoI45mx8/RSlF1OR/DJ8lWHBbQmNz8FYP PUbpfjvOynuk4gjMGMapigGAcs6/RwDsVhMawtagItv4yqsgEoT40z54zVlDqXuEhwba CkVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=epRVf5UXf29q3Cv/niziaIvmDmEKI/GF6dRUOH7FDK4=; b=lncUURxF1w/qsURgPlqIxyEivLmlxSW1/YWA8YxFy0bPcfrNSshnvVHcHAZUiigwqZ VKfEKxysIiWRTCSIuQO4h1r6ygccUiqFphWNpc7AyACAtP9P00g+i985Kr/BzuZucvXF 7rP0S20kdmqbJg/J5NukRsEuWzNwR1YvXzjGGdxk5nF5u7LdXz+GT5FlqLjXrzIM+fis D+GkjuxfsEZOOMDlLeax8hq4qgPlv0ZLmZRbWXQaZIq+YJ4IhipOfIIpMXhzpZkHpveL uNPRPrggExLeHvPRDehqM0sF23zEKpWZKDgjpGKcFqgcjIniBlATd5nl+7VcvL+kzgDz Ef5Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o9-20020a170902778900b0016ef089881bsi2265262pll.252.2022.08.03.07.32.58; Wed, 03 Aug 2022 07:33:15 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238254AbiHCN4s (ORCPT + 99 others); Wed, 3 Aug 2022 09:56:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238755AbiHCNzw (ORCPT ); Wed, 3 Aug 2022 09:55:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E4E410542 for ; Wed, 3 Aug 2022 06:55:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 01BE86158F for ; Wed, 3 Aug 2022 13:55:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FF78C43141; Wed, 3 Aug 2022 13:55:39 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oJEqY-007kSH-1W; Wed, 03 Aug 2022 09:55:38 -0400 Message-ID: <20220803135538.312181330@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 03 Aug 2022 09:55:13 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , David Laight Subject: [for-next][PATCH 5/5] tracing: Use alignof__(struct {type b;}) instead of offsetof() References: <20220803135508.240797292@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 From: "Steven Rostedt (Google)" Simplify: #define ALIGN_STRUCTFIELD(type) ((int)(offsetof(struct {char a; type b;}, b))) with #define ALIGN_STRUCTFIELD(type) __alignof__(struct {type b;}) Which works just the same. Link: https://lore.kernel.org/all/a7d202457150472588df0bd3b7334b3f@AcuMS.aculab.com/ Link: https://lkml.kernel.org/r/20220802154412.513c50e3@gandalf.local.home Suggested-by: David Laight Signed-off-by: Steven Rostedt (Google) --- include/trace/stages/stage4_event_fields.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/trace/stages/stage4_event_fields.h b/include/trace/stages/stage4_event_fields.h index 80d34f396555..a8fb25f39a99 100644 --- a/include/trace/stages/stage4_event_fields.h +++ b/include/trace/stages/stage4_event_fields.h @@ -2,7 +2,7 @@ /* Stage 4 definitions for creating trace events */ -#define ALIGN_STRUCTFIELD(type) ((int)(offsetof(struct {char a; type b;}, b))) +#define ALIGN_STRUCTFIELD(type) ((int)(__alignof__(struct {type b;}))) #undef __field_ext #define __field_ext(_type, _item, _filter_type) { \ -- 2.35.1