mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
drm: WARN when trying add enum values to non-enum/bitmask properties
Trying to add enum values to non-enum/bitmask properties is a programmer mistake. WARN to make sure the developers notice their mistake. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180306164849.2862-2-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
6f881d04f3
commit
1371f2604d
1 changed files with 2 additions and 2 deletions
|
@ -378,8 +378,8 @@ int drm_property_add_enum(struct drm_property *property, int index,
|
|||
if (WARN_ON(strlen(name) >= DRM_PROP_NAME_LEN))
|
||||
return -EINVAL;
|
||||
|
||||
if (!(drm_property_type_is(property, DRM_MODE_PROP_ENUM) ||
|
||||
drm_property_type_is(property, DRM_MODE_PROP_BITMASK)))
|
||||
if (WARN_ON(!drm_property_type_is(property, DRM_MODE_PROP_ENUM) &&
|
||||
!drm_property_type_is(property, DRM_MODE_PROP_BITMASK)))
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue