Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp518404rdb; Thu, 5 Oct 2023 12:38:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6lKoVWGxKr5hwmJi6lmnjlA2f0/Gq876Z3O7KJ9dyXqfqxouMZbsoHIE0RHBz/pLZl9mA X-Received: by 2002:a05:6a21:3290:b0:15d:ec88:356e with SMTP id yt16-20020a056a21329000b0015dec88356emr7501487pzb.41.1696534706874; Thu, 05 Oct 2023 12:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696534706; cv=none; d=google.com; s=arc-20160816; b=oRtrwDRNEJ82xW7/5ksOB6xtBO75dZSpsEdeiGQdG/aJmdo38qpW9DJLEfhdO12xZB LzGmKJM51dau4Pndk2wuqdHHYyHUPZmcf+cfzR0WqHueH4j9UzwS7i8xSr+oIQ6QV4s2 Ibwvg5oKwtSX8dDBc8AmsHpn+1l4rQId/EMzMCq7/Zg+Xh9g6+m80BVi/b/im8X7vX33 LQ5sgCnU9/anm483jWMuO8k2CDLW22MTJXOsFObmdRPUbgbRtRNG6Z0DyjTUzLBW2sPI Hz/zLh9iGR1uHy+RlPoFUyqGUcP/tSAUcfO0LzQTfh+a3PkQct7HVACMl+KaXfn1Genh lKAw== 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:dkim-signature; bh=rfQQ0VduvkqTmGQ+eirzgdYsgonzQDckoyk+JD2mwHE=; fh=mr2WuYtHk+WtgJB1ag9nVfzNESHp7feBi31VimfP4XA=; b=CTmlA0VqerY+YRtA7qZu2w6OS8zw1AybbTKXParRTEdb/dyvNzS1C9IcgBcvKpPji8 zBcA3/MC9v8n/gVkF8gY96cNjJ8yh0xJOU1hULOGJpUDZSoaM45qfwEGhkUdlb/ov+GN OtvpXIR4S0V5iIv/EYT5RNncWDx9dlmsF2zPWkkqLtiYzqFoaYhZ6QgA09YGmLmMUf5c lQtubgvYSG7zl75CGPB5AiBuXAvg3h965mKqRyf8PpIh7Y3oKmOVR46DIJADdIc5uvxO 7Kcm277L2ili6mBbY+dScaRDCYk0ja0e02Imm/dtdKic7tagyYo+PejWSn17gc2/C83T giyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xt6O4S8w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id ck14-20020a056a00328e00b0069024c6a9acsi1959102pfb.314.2023.10.05.12.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 12:38:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xt6O4S8w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 636EA84049C5; Thu, 5 Oct 2023 12:38:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjJETiM (ORCPT + 99 others); Thu, 5 Oct 2023 15:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbjJETiL (ORCPT ); Thu, 5 Oct 2023 15:38:11 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B0E1CE for ; Thu, 5 Oct 2023 12:38:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05119C433C7; Thu, 5 Oct 2023 19:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696534689; bh=wCkgJNiv1NgzfO5wNG4eTiNqnwm45TDHUoeqPO7QiYo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xt6O4S8w1dZ4xED9rkInAY2s9ejjZxpg0oYRNu1dK7EWsU7ElKUSLDoWND3et/XEB JKo3wv8KTYeOVJtFRfu3QBxrLJ5eA9Zykez/iOS2+Uyv6Y9eLYo8Q1E09vRhcKYlPh OryVQntHhR1ejpZNTKjryNW5N+X+DwX/oufBOotYwZJzLiIAVCCivynIuSZl7rzQCC RKrvIBiOq+9KzwJI54WSVZ0qeMRWBGWV3/1n1U3nnd0NM4CshMiDwP047/gE28zkWW EysLq3LzyKAl3kkMjQ9KZn8qKPmv+DPhqgyYM0yL8KEnhqZ3HtEkB2yfY0Kdxmv7cK rcP8JpiPmKWpg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 0EAA340508; Thu, 5 Oct 2023 16:38:06 -0300 (-03) Date: Thu, 5 Oct 2023 16:38:05 -0300 From: Arnaldo Carvalho de Melo To: Adrian Hunter Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH 1/5] perf tools: Add get_unaligned_leNN() Message-ID: References: <20231005190451.175568-1-adrian.hunter@intel.com> <20231005190451.175568-2-adrian.hunter@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231005190451.175568-2-adrian.hunter@intel.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 05 Oct 2023 12:38:22 -0700 (PDT) Em Thu, Oct 05, 2023 at 10:04:47PM +0300, Adrian Hunter escreveu: > Add get_unaligned_le16(), get_unaligned_le32 and get_unaligned_le64, same > as include/asm-generic/unaligned.h. > > Use diagnostic pragmas to ignore -Wpacked used by perf build. Can we get the tools copy of include/asm-generic/unaligned.h closer and have it in check-headers.sh? - Arnaldo > Signed-off-by: Adrian Hunter > --- > tools/include/asm-generic/unaligned.h | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/tools/include/asm-generic/unaligned.h b/tools/include/asm-generic/unaligned.h > index 47387c607035..9140bb4e16c6 100644 > --- a/tools/include/asm-generic/unaligned.h > +++ b/tools/include/asm-generic/unaligned.h > @@ -6,6 +6,9 @@ > #ifndef __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H > #define __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H > > +#pragma GCC diagnostic push > +#pragma GCC diagnostic ignored "-Wpacked" > + > #define __get_unaligned_t(type, ptr) ({ \ > const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \ > __pptr->x; \ > @@ -19,5 +22,22 @@ > #define get_unaligned(ptr) __get_unaligned_t(typeof(*(ptr)), (ptr)) > #define put_unaligned(val, ptr) __put_unaligned_t(typeof(*(ptr)), (val), (ptr)) > > +static inline u16 get_unaligned_le16(const void *p) > +{ > + return le16_to_cpu(__get_unaligned_t(__le16, p)); > +} > + > +static inline u32 get_unaligned_le32(const void *p) > +{ > + return le32_to_cpu(__get_unaligned_t(__le32, p)); > +} > + > +static inline u64 get_unaligned_le64(const void *p) > +{ > + return le64_to_cpu(__get_unaligned_t(__le64, p)); > +} > + > +#pragma GCC diagnostic pop > + > #endif /* __TOOLS_LINUX_ASM_GENERIC_UNALIGNED_H */ > > -- > 2.34.1 > -- - Arnaldo