archive mirror
 help / color / mirror / Atom feed
From: Shannon Nelson <>
Cc: Dan Carpenter <>
Subject: smatch/sparse complaints on static assertion
Date: Tue, 11 Feb 2020 09:41:05 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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 
$ ../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?


       reply	other threads:[~2020-02-11 17:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2020-02-11 17:41 ` Shannon Nelson [this message]
2020-02-12  0:31   ` smatch/sparse complaints on static assertion Luc Van Oostenryck
2020-02-12  1:01     ` Shannon Nelson
2020-02-12  0:36   ` Linus Torvalds
2020-02-12  1:05     ` Shannon Nelson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).