From patchwork Mon Apr 29 15:04:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13647160 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7752EC04FFE for ; Mon, 29 Apr 2024 15:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=La16rb8Xsw17w93p59QmXX9L8mPNU1DwO29FShZXixA=; b=IwCEiCi8C3XPaf JGzjQvCzsxjD5hYoQKLdwHsp8/SMMirhz2wT/AItepp6rb/mlx7Id1B3cs9DF8Go63k+x/JZvz5aI Jwat5Vxq7X0K8QpnPVIoSCgKlSbazQ6NDiK5E68aeorj8+8zSbYq+9bxc9X+o2+4fFFTkcllKhJ1k dMIeYi5w1xU9CSeRicd7nGiFPW8l8uCS7c+nrfaTL23tKhWMCEQBOwtTRtiFxlpfHn2pthgVwN0vK SJQ8UZZ4XxoGE/7RUQwqxF7pVujvBsU0PQx2+Nvsj4h/3YbhLKPsYTqGFHBG8gP/bdtzFENf1Vp5e t0aAQGFBrkHJgdQACVOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Sb0-00000003Gjx-2ves; Mon, 29 Apr 2024 15:07:10 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1SYg-00000003FGg-2Ncz for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 15:04:48 +0000 Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-78efd533a00so336950285a.0 for ; Mon, 29 Apr 2024 08:04:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714403085; x=1715007885; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TBoYdFZFpJunUvgv52P8o/805oLnG0rRdaJVdgyqfIE=; b=apj6f4HkyXAe/Luid6AcPeHWc0tcedOq0qVH6fEg1uGZBeOL+Zdv4CSBtm7rbyZYS2 A4hta82IL3vvS99Uq1d3EYzVcPCqt40CA13Ix1syJowdiXBRC48gJMcNrBKL9cINtOD/ vEA00d8nz04oFAhK40zG/5m6pzKM5YYQk/EPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714403085; x=1715007885; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TBoYdFZFpJunUvgv52P8o/805oLnG0rRdaJVdgyqfIE=; b=DVRt0rlkMlksZ/mWYZq9vMvazrD9/CxdVAjRk9CmHHtBz+E+yGe7OPM+SAtIP4gXwE pcFg9N6l5CQMIGLyIfQSYyPgf2CoadJYzOizLE/l+NVCqQkfmn3d/zYgj9bgWbbePN9w 7Y4b5xX8qIgo3dCv4Lp/nFCSO8/eDFsRuLzWXWbQkrtnjoWCQaEPpBDnzbmBk0vdy8Bf wD2Pp5r33nZxDoqATchQzz530HMxKXlYV3ZNL40LpSY6zI65grauftzELkwQv5sZX0L4 0P2B98E50wRyLej6pm/gSC/xYJ3NnV+WcWkxk/eeY1dmFgsHEfyt4/aMMX+LYgULiIy3 SJwA== X-Forwarded-Encrypted: i=1; AJvYcCXIYpzNsw3aEAl/Awye5nueXWOXNwd9lJpOVQm6McL6c0agptb/9oEcQtwCu4FFRDG3MS7AZi8NNjwkQMLa3O9VXKQ/SvjXVBM0z4Tjbq3hGoR6cOY= X-Gm-Message-State: AOJu0YxRqdTJry5LXTw2WEHATNfV+TRglEvfDRvsu6qZVQ1HR2ac3GJY wOOOlgs4QUAzNu4mecOm2TX3dcWhydmy6CIuCnaU+rfm43/MwnK+2kgRtxwEkg== X-Google-Smtp-Source: AGHT+IF+chYPShGmmjcrkgz/giMi8LlMh1kKDt+AWNRJgL6Fjthaoaa54O+J4vw4mx2W4IdeglySVQ== X-Received: by 2002:a05:620a:39d:b0:790:944d:65b3 with SMTP id q29-20020a05620a039d00b00790944d65b3mr8124237qkm.62.1714403084821; Mon, 29 Apr 2024 08:04:44 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id p7-20020a05620a056700b0078d3b9139edsm10568591qkp.97.2024.04.29.08.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:04:44 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 29 Apr 2024 15:04:41 +0000 Subject: [PATCH v3 02/26] media: stb0899: Simplify check MIME-Version: 1.0 Message-Id: <20240429-fix-cocci-v3-2-3c4865f5a4b0@chromium.org> References: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> In-Reply-To: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , Hugues Fruchet , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Paul Kocialkowski , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Sakari Ailus , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , Matthias Brugger , AngeloGioacchino Del Regno , Hans Verkuil , Sergey Kozlov , Abylay Ospan , Ezequiel Garcia , Dmitry Osipenko , Benjamin Mugnier , Sylvain Petinot , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_080446_708164_CE297746 X-CRM114-Status: GOOD ( 13.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org chip_id is an unsigned number, it can never be < 0 Fixes cocci check: drivers/media/dvb-frontends/stb0899_drv.c:1280:8-15: WARNING: Unsigned expression compared with zero: chip_id > 0 Reviewed-by: Bryan O'Donoghue Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/stb0899_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/stb0899_drv.c b/drivers/media/dvb-frontends/stb0899_drv.c index 2f4d8fb400cd..35634f9a8ab5 100644 --- a/drivers/media/dvb-frontends/stb0899_drv.c +++ b/drivers/media/dvb-frontends/stb0899_drv.c @@ -1277,7 +1277,7 @@ static int stb0899_get_dev_id(struct stb0899_state *state) dprintk(state->verbose, FE_ERROR, 1, "Demodulator Core ID=[%s], Version=[%d]", (char *) &demod_str, demod_ver); CONVERT32(STB0899_READ_S2REG(STB0899_S2FEC, FEC_CORE_ID_REG), (char *)&fec_str); fec_ver = STB0899_READ_S2REG(STB0899_S2FEC, FEC_VER_ID_REG); - if (! (chip_id > 0)) { + if (!chip_id) { dprintk(state->verbose, FE_ERROR, 1, "couldn't find a STB 0899"); return -ENODEV;