From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729608AbhASUwl (ORCPT ); Tue, 19 Jan 2021 15:52:41 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9944C0613C1 for ; Tue, 19 Jan 2021 12:51:59 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id v3so12491859qtw.4 for ; Tue, 19 Jan 2021 12:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joyent.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=bN2B25rbmBnTA1NIjf6zoF7+LEQsChxO5LiOuV8wnOQ=; b=d00OHK1k5q/pqXI0RONayWUljgagNx9xci92qj88ilKWzrD9Tg0YIEn33gfumMI9N/ UgdDDL/UlPbXRVi4lsmy7bzzCIctrOSmixtfLr9JpOH9aTuIgy4G/GZiZimabW0R3vjC B6ZseylmOEMC6QTCWzwmGwm/JT6ZISzJV1ZrI= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: Intel i40e code finds smatch bug From: Dan McDonald In-Reply-To: <20210119185547.GN2696@kadam> Date: Tue, 19 Jan 2021 15:51:57 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <47367857-0F08-459A-84FE-4FD35B009AB3@joyent.com> References: <38E556EE-C173-4935-80DF-51DC4FE8C90E@joyent.com> <20210119185547.GN2696@kadam> List-ID: To: Dan Carpenter Cc: smatch@vger.kernel.org, Dan McDonald On Jan 19, 2021, at 1:55 PM, Dan Carpenter = wrote: >=20 > Luk recently was working on better support of packed structs (which = have > been a known issue for a while) but I doubt that will help here. I tried using packed struct attributes instead of the pragma and no luck = there either: centos(~)[0]% diff -u pack.c pack2.c --- pack.c 2021-01-19 17:16:13.258512270 +0000 +++ pack2.c 2021-01-19 20:49:45.886696658 +0000 @@ -6,9 +6,8 @@ #define __le16 uint16_t #define __le32 uint32_t =20 -#pragma pack(1) /* Run PHY Activity (0x0626) */ -struct i40e_aqc_run_phy_activity { +struct __attribute__((packed)) i40e_aqc_run_phy_activity { u8 cmd_flags; __le16 activity_id; #define I40E_AQ_RUN_PHY_ACT_ID_USR_DFND 0x10 @@ -31,7 +30,6 @@ } resp; } params; }; -#pragma pack() =20 #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \ { i40e_static_assert_##X =3D (n)/((sizeof(struct X) =3D=3D (n)) = ? 1 : 0) } centos(~)[1]%=20 Dan