aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm
diff options
context:
space:
mode:
authorWambui Karuga <wambui.karugax@gmail.com>2020-01-02 12:55:15 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2020-01-08 18:35:36 +0100
commit8b185cf7ebaa1f390ba25368ce9ae387eb1a8b63 (patch)
treede59110ecb1a8e608d0cf9e754fc4e0db8455192 /drivers/gpu/drm/omapdrm
parentdrm: meson: fix address type confusion (diff)
downloadlinux-dev-8b185cf7ebaa1f390ba25368ce9ae387eb1a8b63.tar.xz
linux-dev-8b185cf7ebaa1f390ba25368ce9ae387eb1a8b63.zip
drm/omapdrm: use BUG_ON macro for error debugging.
Since the if statement only checks for the value of the `id` variable, it can be replaced by the more concise BUG_ON() macro for error reporting. Issue found using coccinelle. Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20200102095515.7106-1-wambui.karugax@gmail.com
Diffstat (limited to 'drivers/gpu/drm/omapdrm')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dispc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 413dbdd1771e..dbb90f2d2ccd 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -393,8 +393,7 @@ static void dispc_get_reg_field(struct dispc_device *dispc,
enum dispc_feat_reg_field id,
u8 *start, u8 *end)
{
- if (id >= dispc->feat->num_reg_fields)
- BUG();
+ BUG_ON(id >= dispc->feat->num_reg_fields);
*start = dispc->feat->reg_fields[id].start;
*end = dispc->feat->reg_fields[id].end;