Skip to content
Snippets Groups Projects
Commit 65afcf30 authored by Federico Vaga's avatar Federico Vaga
Browse files

core.c: last attribute's enumerator cannot be greater than MAX_STD_ATTR


Raise a build error if the last attribute's enumarator (e.g.
_ZIO_BUF_ATTR_STD_NUM) is greater than the maximum numer of standard
attributes ZIO_MAX_STD_ATTR

Signed-off-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: default avatarAlessandro Rubini <rubini@gnudd.com>
parent 5e7263d3
No related merge requests found
......@@ -83,6 +83,11 @@ static int __init zio_init(void)
{
int err;
/* The standard attributes must be less than ZIO_MAX_STD_ATTR */
BUILD_BUG_ON(_ZIO_DEV_ATTR_STD_NUM > ZIO_MAX_STD_ATTR);
BUILD_BUG_ON(_ZIO_TRG_ATTR_STD_NUM > ZIO_MAX_STD_ATTR);
BUILD_BUG_ON(_ZIO_BUF_ATTR_STD_NUM > ZIO_MAX_STD_ATTR);
/* The attribute 'version' must be the last attributes */
BUILD_BUG_ON(_ZIO_DEV_ATTR_STD_NUM != ZIO_ATTR_VERSION + 1);
BUILD_BUG_ON(_ZIO_TRG_ATTR_STD_NUM != ZIO_ATTR_VERSION + 1);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment