Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2051038pxa; Fri, 7 Aug 2020 01:37:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx32JWmdwWkPjw3TPW1b913uFlRulbpVje/jYqEDBxdxos4tcFbI22YKJYpVax+tgnx4BDj X-Received: by 2002:a05:6402:8cb:: with SMTP id d11mr8102314edz.100.1596789473302; Fri, 07 Aug 2020 01:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596789473; cv=none; d=google.com; s=arc-20160816; b=Kg1ZF6zFLf7scEZUlI/gX3z/dRqTG/FklfzrggSNNEr3XaeX19F3PEL7slVNjARkMF X8zBwjt/9+OzAFASV2cakFR+5s0wgHn9Q6NGwUAuoGDoWtV1b/Kc0sOJwHmwipC8yyld 8801dep6XqEfkt2w3i+VFNRpoPKkOcXkxx6C6qI9OS2ETh48m7ksQvaTynNsLRsEDvT2 zZrNhB6zc8H48gIcla73tFpTc6B34aMpaMHjPAS9rUnPCCB2VX6NGsXOebC3ShpOmT54 wIf0tkZiC0kfzna1G2fBMBXRQfVrkufwi/7vkSFf5QoAguOEabjBxSF5GSm9tw7gup6D hKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HM+pB+gegJETUTC8BtYwm1pgwV6KHTLqQbgt5bu8Qq8=; b=typfSGwrf4j+3zj1+AY2vF7ZE90LGx93OwzSx/6oNZT8UDt+xd34MXvgs1eZYmofM9 gZMCPc6fnn18PDeaZtFPMbZPn38EE2BWcNtZ6of3BYiMNnjDlMcMIvPMBlZSe/BIxYin oA5mJAgtWtq1V8dSXSbGXI6smTU76ngsNpddPICNDlF/N6pl86+4XZkAJvOW5wRw1osh CjZ86T8rHxn9WqWLvpmFRBsP6cvb1vK2TtPi9u9JP0dlL/sChPohJuBkfB6+C871NXNn ANfPZrfk4HCsiRNw3Wwn6lSHoc1/B15zzWKZQACN9H9kuz4TMFoTxB+1z2oXN3nONXIF 6ajw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bZdXLbTY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk16si4795360ejb.532.2020.08.07.01.37.30; Fri, 07 Aug 2020 01:37:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bZdXLbTY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727885AbgHGIgk (ORCPT + 99 others); Fri, 7 Aug 2020 04:36:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727870AbgHGIgg (ORCPT ); Fri, 7 Aug 2020 04:36:36 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A447AC061574; Fri, 7 Aug 2020 01:36:36 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id e5so733758qth.5; Fri, 07 Aug 2020 01:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HM+pB+gegJETUTC8BtYwm1pgwV6KHTLqQbgt5bu8Qq8=; b=bZdXLbTYVurwEC6xi+YPZ4+960RF0X6/+S2xTN/Tf0zaHBVW17eWe5ecjpaP16lWsN xvded1AZrbUdEJ3hHs0s3kubWc/ImbJpNTNz4bUoWoXmepblKlM/STHcNn77pmKKBZh0 vpWQALpZIxUjSOmm988R599fx0pEK/xQDupMf4razT4VZHc3pO3sbGCsKQ87HZmn9JjO IJ4pmFS8NXU/EoV1YJhL/8BhJ7tJvvfEOvpy1WxfyG5xC2so4YfJVc0eUKGSl/VrsnSp q7IYaIVNy6krnJd73mbXGlSJ5Rw0obOILdqr3EaauWUO3CnT5CivHVxNUEbBkHiy0nij /ung== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HM+pB+gegJETUTC8BtYwm1pgwV6KHTLqQbgt5bu8Qq8=; b=BmDL1sxFAVrMAX3mPeZrAlwsS8lEbXqp1teFxx6SWoiwHlYP2Hg91g6ozeuCKZuQu4 pzTK6uArjw2XDr/eqRQectaxN0EZZyh+Eis72D1oxlcH2ZhqGELd/06zR+EHsApitJOq F8S08wYvO+pmHI3h8oVxsTT9TBW8XP4t4M/y6dQb7IPEiAkWzwDs1VsYaJ2qCZEwWIq/ wSib13edYwhjhSZEdoKiMJbA6TbPcP5T5XR+KVYzoMoCVOtgDurDmUPSmZdF5KpaNS4e AevNo71BrqpVWOD9+wyJ9DYRG++etKUberrEr6tdMkvKXxZLPRyFaBVC9yppBE8UaKPH EYuQ== X-Gm-Message-State: AOAM532uLS2Cwwj0X2vZvtuaWBO4O0cs55751wAdlOi+foggjmWBPUGE CyS37hF//j1lCtz21FVMM3RuynIkPzy7+w== X-Received: by 2002:ac8:7188:: with SMTP id w8mr12952874qto.223.1596789395676; Fri, 07 Aug 2020 01:36:35 -0700 (PDT) Received: from localhost.localdomain ([2804:14d:72b1:8920:da15:c0bd:33c1:e2ad]) by smtp.gmail.com with ESMTPSA id c42sm7846728qte.5.2020.08.07.01.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2020 01:36:35 -0700 (PDT) From: "Daniel W. S. Almeida" X-Google-Original-From: Daniel W. S. Almeida To: linux-kernel@vger.kernel.org Cc: skhan@linuxfoundation.org, "Daniel W. S. Almeida" , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH 08/20] media: pci: saa7164.c: Replace if(cond) BUG with BUG_ON Date: Fri, 7 Aug 2020 05:35:35 -0300 Message-Id: <20200807083548.204360-8-dwlsalmeida@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Daniel W. S. Almeida" Fix the following coccinelle reports: drivers/media/pci/saa7164/saa7164-buffer.c:254:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG. drivers/media/pci/saa7164/saa7164-buffer.c:261:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG. Found using - Coccinelle (http://coccinelle.lip6.fr) Signed-off-by: Daniel W. S. Almeida --- drivers/media/pci/saa7164/saa7164-buffer.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/media/pci/saa7164/saa7164-buffer.c b/drivers/media/pci/saa7164/saa7164-buffer.c index 289cb901985b..245d9db280aa 100644 --- a/drivers/media/pci/saa7164/saa7164-buffer.c +++ b/drivers/media/pci/saa7164/saa7164-buffer.c @@ -250,15 +250,14 @@ int saa7164_buffer_cfg_port(struct saa7164_port *port) list_for_each_safe(c, n, &port->dmaqueue.list) { buf = list_entry(c, struct saa7164_buffer, list); - if (buf->flags != SAA7164_BUFFER_FREE) - BUG(); + BUG_ON(buf->flags != SAA7164_BUFFER_FREE); /* Place the buffer in the h/w queue */ saa7164_buffer_activate(buf, i); /* Don't exceed the device maximum # bufs */ - if (i++ > port->hwcfg.buffercount) - BUG(); + BUG_ON(i > port->hwcfg.buffercount); + i++; } mutex_unlock(&port->dmaqueue_lock); @@ -302,4 +301,3 @@ void saa7164_buffer_dealloc_user(struct saa7164_user_buffer *buf) kfree(buf); } - -- 2.28.0