Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp233982lqb; Tue, 28 May 2024 14:04:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8GsTZUum3MUTTDcD62qD7LU303at9hNoKXc9+9xpg52F+A7ctK+g2rTnUYWJxwOw5oilhe8bQ27Cg3fcFWz/hPBtvEXTJKx0aziXJ3Q== X-Google-Smtp-Source: AGHT+IHbDA3V05cZIr5+1f2SIDL2edIwVyhDDTrxStZZQIH0Aa9bPxJvV7DDaCFHWlkNAqjIri4z X-Received: by 2002:a92:cda4:0:b0:374:5349:8269 with SMTP id e9e14a558f8ab-37453498674mr97244635ab.9.1716930277917; Tue, 28 May 2024 14:04:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716930277; cv=pass; d=google.com; s=arc-20160816; b=xr7hwE1vQBTW7DoAjsQnuACtSNQtzW9XSQ9AKIQaOsfvc3l0yKDaV+K3os3AWXcRaL PmGVTy9riL0kvc0JvN+NY4zzUWjAlFhOe7p1VtjT9qsQcikDSuyI42l+CisJtapaAp9p e8i1xbSM9AghJE7oMYEQZBrts13qMPaL58Zpu2Vws01FzUftlRcE3YtxbZUnfc//OcyW 84umBcDV2eFDQgLbm1H4z0Z0/g6lilU4Cg01hMpPqHltGAIfqAVJgdVlzNv+EYShLcwh f0ZsPbH9IGFxgw+EvWKbrFjJ3GfBU/QOF/jqdHXaFS3i/4Q5bW7ykMpsUvLdZFX3EpkR lPuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/JocxuXXNpfnXCLrhDCmXNT9jdmnYxrX4OhMnw6PYyU=; fh=6JZRCUUYp2QyTIfQbvBG6PcVRypAD5ERflbb3+orwOw=; b=QVgo49cZhYEb3aA9qq05nDa59TIOsw4raQngHY+lbA/E3c5XSgYvBJvzyjLrnW53wG nMWBxbE+3R9ACs79QVL68Q4hFXcmWH6jH+OneXaNdBjIg05DMUqcPJFFIJX5bSsun+Pq nrUVil5Mb5eMMEEbvMaZpjT8DxFXWNE4DCgKTNjUrVtoWnR3/CzDTrCoeF0wUhuEL3R3 5yhtAB5g1KW9QsN0uypPwin2+cxq3aK9A1rJLAcp8hsXVSnHZDL7UlTJwaX+GJ+FzOG5 jFlJLfa96zHqgJsye0LmKcT17Rzh2NmDtWCDb4RHmQudr7Ee+BnJ70u8AlLzHwCRWhlm E+kQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FSagSTgc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-193034-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822779bc12si8953768a12.357.2024.05.28.14.04.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 14:04:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193034-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FSagSTgc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-193034-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 162CDB22D6C for ; Tue, 28 May 2024 20:28:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BE9A1791EB; Tue, 28 May 2024 20:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FSagSTgc" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DDFF2FB2; Tue, 28 May 2024 20:28:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716928115; cv=none; b=arhpYxAFHLPlJy1WBExr0Ac5yPa31Yy4tyiAmakShxqb9ucNH0fjRVI5PH0rhiZry9Y8/aRfJOdMyU1kfyEx/klumi26THBLL7fWYCHGsTqltLAIPJndG3Qmd6k0/LK1BfaAXV/1a1EBl3NNdrmjNFlZ+IYerSKnH90sxNEFakw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716928115; c=relaxed/simple; bh=tvqtyxszXM8jDckKY+3E2CdFN/rc+uOT4+I2rD70XSs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JQAjcy33tHDTK9Gb8PIRqGsBD+zBhvwcX//bsZDb+E072ikkG3vIBgkmYl/Nk+0DqHrcExEtJ9EkeyrYPnXonqmMZ7hFjC5YOL8Chd3YI6P0atJFgHzLqCTa0M56Twbf+L3Cl6h7QMxzY7r4k4XdYMABf8FYGN9NUowoaq2fpIA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FSagSTgc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8327C3277B; Tue, 28 May 2024 20:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716928115; bh=tvqtyxszXM8jDckKY+3E2CdFN/rc+uOT4+I2rD70XSs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FSagSTgcCe2BF3D778iaB7O6jZupz2oWfXX6aVkdKYp9UtJAfx6AS7Taq1pRR+Cna 8+7JUyyCC7PxNSP5frvuVg+/t/TGdKo8qZMDhfRm6UurFPKoXufbH8CA1MIztVhPNj d+nK0cQB6exOG37UGUijO7dekHrjsNBkjW20xxcKQ5QtCK8V3yvgWOIyf+/bnJZsGu zZ1lVewf5+OGdz1NXBt5JAKDdakbQFXBjQU/VvXkigvM4pagHmE+GDAxYKAoOA0xvF SJbda8NIulJwQUvSg36c7dLkDij8GPYTIt4dfLhH6vI3OV338Sa/EUCpCU4r3iXASv ZYe+rxcP+GAKw== Date: Tue, 28 May 2024 13:28:33 -0700 From: Nathan Chancellor To: John Hubbard Cc: Shuah Khan , Beau Belgrave , Steven Rostedt , Mark Brown , Naresh Kamboju , sunliming , Masami Hiramatsu , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev Subject: Re: [PATCH v2] selftests/user_events: silence a clang warning: address of packed member Message-ID: <20240528202833.GB2680415@thelio-3990X> References: <20240527214704.300444-1-jhubbard@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240527214704.300444-1-jhubbard@nvidia.com> Hi John, On Mon, May 27, 2024 at 02:47:04PM -0700, John Hubbard wrote: > When building with clang, via: > > make LLVM=1 -C tools/testing/selftest > > ...clang warns about "taking address of packed member 'write_index' ". > This is not particularly helpful, because the test code really wants to > write to exactly this location, and if it ends up being unaligned, then > the test won't work (and may segfault, depending on the CPU type). > > If that ever comes up, it will be obvious and can be fixed. But all it's > doing now is prevent a clean clang build, so disable the warning. > > Signed-off-by: John Hubbard > --- > > Changes since the first version: > > 1) Rebased onto Linux 6.10-rc1 > > > thanks, > John Hubbard > > > tools/testing/selftests/user_events/Makefile | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tools/testing/selftests/user_events/Makefile b/tools/testing/selftests/user_events/Makefile > index 10fcd0066203..617e94344711 100644 > --- a/tools/testing/selftests/user_events/Makefile > +++ b/tools/testing/selftests/user_events/Makefile > @@ -1,5 +1,10 @@ > # SPDX-License-Identifier: GPL-2.0 > CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) > + > +ifneq ($(LLVM),) Perhaps it would be better if this were ifeq ($(CC),clang) as that would catch both CC=clang and LLVM=1 users? I haven't tested this though. Additionally, I think it would be good to mention that -Wno-address-of-packed-member is GCC's default, whereas Clang enables -Waddress-of-packed-member by default. > + CFLAGS += -Wno-address-of-packed-member > +endif > + > LDLIBS += -lrt -lpthread -lm > > TEST_GEN_PROGS = ftrace_test dyn_test perf_test abi_test > > base-commit: 2bfcfd584ff5ccc8bb7acde19b42570414bf880b > -- > 2.45.1 > >