virtchnl: Add compile time static asserts to validate structure sizes
authorSridhar Samudrala <sridhar.samudrala@intel.com>
Thu, 11 May 2017 18:23:19 +0000 (11:23 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 1 Jun 2017 21:26:23 +0000 (14:26 -0700)
commit73556269aab30c39cba9cf8efafc402d0deb87b2
tree60000d69a9c9971eb5861b53d860ec781e70cf70
parenta33c83c4353b2efc4d883bad06a86a9ba2dde4fc
virtchnl: Add compile time static asserts to validate structure sizes

This uses preprocessor tricks to make sure that a divide by zero
occurs if a struct changes size outside the expected number of
bytes.

Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
include/linux/avf/virtchnl.h