Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1150406ybl; Wed, 8 Jan 2020 11:55:46 -0800 (PST) X-Google-Smtp-Source: APXvYqymGh9pAfSnY+TN5js8URcy63Av/FOxUop5BKDBLikhqu3nJ+y3F1DpfM/KIRQcoDT5UUZO X-Received: by 2002:a05:6830:1385:: with SMTP id d5mr5690630otq.61.1578513346906; Wed, 08 Jan 2020 11:55:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578513346; cv=none; d=google.com; s=arc-20160816; b=O0gG4eZ09HBSyyCaSFWP6nsWKPx6xupw0LSBaIJDJA+2C+NDcRLgUqSPZUtDKOm436 OE8Uceu1yQM5iclvMplxCnhdBEfKkRb8tQJDVNFMJ+Eoay6sZq51m9oFEBcheB7r31md 0yZ5tLwCFUCB9fKyKPqxCCsCZ4Vgl3lqjMOrzdKrTNe8a1bTy9cv4AZYGZ5R63UangMB D9/N68FagVv4nVF/lG2ti9n2hdeNWOiEC+D6eu2n0tioU2ulBo0zwpBSpovyGFKW9mhJ bN3ofcukMIGxhx2VYxK1Ga5m68WLc/dMXXNuv++NxCHlcagODH6/bjrPd+9VGc/MQE0k TKMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=qwg5hibFRVywSqJ0shEP5dA8R4/hDi63ijsidIVUsnI=; b=BNsghQujKx5IZqhvmBmMkyT9sR2W6KV6rcQ6woFzhukKlhduHTOeWbwbnnVYIwHMVu Hh6R8knxaHk5VeOavisMPJ90DLMY6hSYidIUI+51nL27k5rnQKV5q0zlBQOOlrIgxPbo rHTNKmpWjTPQR/sLpQm/uj2+yxww/7Lz8hA+xR3ACiyWrk/3c1nI6V52ifTwKdbuH9BU jJFIHwyXB865eo6cE3T8wiqFtb6JxRsxCso4GtRhA5iPjHUpgPyN8qQ92MGKGZWlVzqT yDHu7slz1hB6VqsAPE6adJO8QXbS2CK9wDk54tSpOefLOSue8kgSBABicECyfeTWLBdg 87dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=QUoqhl67; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si2804797otk.2.2020.01.08.11.55.34; Wed, 08 Jan 2020 11:55:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=QUoqhl67; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728842AbgAHRff (ORCPT + 99 others); Wed, 8 Jan 2020 12:35:35 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55642 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727328AbgAHRfe (ORCPT ); Wed, 8 Jan 2020 12:35:34 -0500 Received: by mail-wm1-f68.google.com with SMTP id q9so3380758wmj.5 for ; Wed, 08 Jan 2020 09:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=qwg5hibFRVywSqJ0shEP5dA8R4/hDi63ijsidIVUsnI=; b=QUoqhl67fBgCPzU+SawnnCIxZ4VeUk3dj6RARmd4tvkb3zuVnoidILFVGwXsN5UE2I /F5RA4m/Ts5DWqtPY4fbEwVrFuGLvTj3ZvxdZY/KfsHA/92XiLTWNxlRvAT/l38OSrBg 2KSwA4YLo8d/FXx89+AyH9Iiffz0+7TqE5dms= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=qwg5hibFRVywSqJ0shEP5dA8R4/hDi63ijsidIVUsnI=; b=oP5Zv1aKM6bHJO4zT2T7lNAogu+og8/4GBU+XIQrF6TC3YqscAv0SZwi0Js1bcPCWg zvO/T+CcBUvwrx6+kaB54jC1dAogKFSenblXzLPDhx6tcqbpb4RtOWP4IJT7D4hSdAyG ijZvYCoA2qpYhR6co43K+dNBYb93K3o9kQIixSVroVxAi4JgPvxsqxHCSeL5ZHZcOgY6 4wMa4HNvYX/SwC8bdT8licY/3nrocyaAE4xmBclW1+3Bfo0Kg7iwqwLJo46pjdUA8A+n q7Y3N3SV2+T2W5p2fZ3C7+KDIeSknfq8iCLteVlMN7eXglnIENGFcIn74FfosK9Eeq2B DCYw== X-Gm-Message-State: APjAAAV7hacxu/E0rYNqD98cTsePeCNcCZ82qbk2hE1r+MhwArMUebFg 5o//E2vGnvaNRSGJjM16APV1NQ== X-Received: by 2002:a1c:a382:: with SMTP id m124mr5324133wme.90.1578504932671; Wed, 08 Jan 2020 09:35:32 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:564b:0:7567:bb67:3d7f:f863]) by smtp.gmail.com with ESMTPSA id h17sm5044566wrs.18.2020.01.08.09.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 09:35:31 -0800 (PST) Date: Wed, 8 Jan 2020 18:35:29 +0100 From: Daniel Vetter To: Wambui Karuga Cc: tomi.valkeinen@ti.com, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/omapdrm: use BUG_ON macro for error debugging. Message-ID: <20200108173529.GG43062@phenom.ffwll.local> Mail-Followup-To: Wambui Karuga , tomi.valkeinen@ti.com, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20200102095515.7106-1-wambui.karugax@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200102095515.7106-1-wambui.karugax@gmail.com> X-Operating-System: Linux phenom 5.3.0-3-amd64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 02, 2020 at 12:55:15PM +0300, Wambui Karuga wrote: > 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 Tomi said he's ok with this landing in drm-misc-next on irc, so merged. Thanks for your patch! -Daniel > --- > drivers/gpu/drm/omapdrm/dss/dispc.c | 3 +-- > 1 file changed, 1 insertion(+), 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; > -- > 2.17.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch