Skip to content
Commit 7cb1c5c2 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman
Browse files

staging: comedi: jr3_pci: check sizes at compile time



The driver currently checks the size of `struct jr3_sensor` is correct
when a device is attached, returning an error if it is wrong.  Replace
that with a compile-time check.  We don't care too much about the size
of `struct jr3_sensor` as it is embedded in the larger `struct
jr3_block` and is followed by a lot of padding.  We should care more
that the size of `struct jr3_block` is correct, as it describes the
overall register layout of a block, and there is an array of such blocks
(one per subdevice).  Check its size at compile-time using the
`BUILD_BUG_ON()` macro.

Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6fbd1330
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment