smatch/sparse complaints on static assertion

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

 



Hi All,

I'm getting complaints from smatch on the ionic network driver's static assertions and am not sure why it was complaining.  Dan Carpenter suggested this might be an issue in sparse with how it is calculating the sizes of the unions.

I ran this at the top of a pretty recent net-next tree (v5.5-rc7-1839-g8192c36)
$ ../smatch/smatch_scripts/kchecker drivers/net/ethernet/pensando/ionic/

And got several copies of this:

drivers/net/ethernet/pensando/ionic/ionic_dev.h:38:1: error: static assertion failed: "sizeof(union ionic_dev_regs) == 4096" drivers/net/ethernet/pensando/ionic/ionic_dev.h:40:1: error: static assertion failed: "sizeof(union ionic_dev_cmd_regs) == 2048" drivers/net/ethernet/pensando/ionic/ionic_dev.h:56:1: error: static assertion failed: "sizeof(struct ionic_dev_getattr_comp) == 16" drivers/net/ethernet/pensando/ionic/ionic_dev.h:57:1: error: static assertion failed: "sizeof(struct ionic_dev_setattr_cmd) == 64" drivers/net/ethernet/pensando/ionic/ionic_dev.h:58:1: error: static assertion failed: "sizeof(struct ionic_dev_setattr_comp) == 16" drivers/net/ethernet/pensando/ionic/ionic_dev.h:68:1: error: static assertion failed: "sizeof(struct ionic_port_getattr_comp) == 16" drivers/net/ethernet/pensando/ionic/ionic_dev.h:78:1: error: static assertion failed: "sizeof(struct ionic_lif_getattr_comp) == 16" drivers/net/ethernet/pensando/ionic/ionic_dev.h:79:1: error: static assertion failed: "sizeof(struct ionic_lif_setattr_cmd) == 64" drivers/net/ethernet/pensando/ionic/ionic_dev.h:80:1: error: static assertion failed: "sizeof(struct ionic_lif_setattr_comp) == 16" drivers/net/ethernet/pensando/ionic/ionic_dev.h:82:1: error: static assertion failed: "sizeof(struct ionic_q_init_cmd) == 64" drivers/net/ethernet/pensando/ionic/ionic_dev.h:117:1: error: static assertion failed: "sizeof(struct ionic_vf_setattr_cmd) == 64" drivers/net/ethernet/pensando/ionic/ionic_dev.h:120:1: error: static assertion failed: "sizeof(struct ionic_vf_getattr_comp) == 16"

These static assertion lines have been fine up until now and I'm pretty sure they are correct.

Has this issue been seen elsewhere?  Or is there something I can do in our code to get rid of the complaints?

Thanks,
sln






[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux