Powered by Linux
Re: Intel i40e code finds smatch bug — Semantic Matching Tool

Re: Intel i40e code finds smatch bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 19, 2021, at 1:55 PM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> 
> 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
 
-#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()
 
 #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \
         { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
centos(~)[1]% 


Dan





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux