From patchwork Fri Apr 19 09:47:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13636222 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 10CD3C4345F for ; Fri, 19 Apr 2024 11:01:41 +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=4a9Ir8a9Relbtn7LFw38dpx9FNqVYGwjT/E4EDwF+2o=; b=EVGRksufzZyBZR Qq7JTRVhooroB34r+ttwwUNi2NFc5azKlsfwIvA44Epl93XPb9QySqSbEVnoXSwNtCs0H6PPWIrDr 6IfVXWq+c1+2JNhwC8hbi0LjAVeTUm5Dn8xp6RIKNLkXy+PY49FCspE/0dHPfm+MNX1vOl5WhjDo3 Bm8MpIcQR5kBnaDWmioADYeYmrEgpPa8d3gA+xEOh6OBRZpJPDFNLv9/z6xGbkrFiurQLCFKqX9MG 9J2r8Wkv2WtGk/HJWI4eSi/SE0+qmSbWlOeqA49HuTqUkBAwrhh17I8gKeiq/BzXI81Zn7XfhAwL8 MuYgBzQTNXvLrotDuaoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxlzk-00000005Nls-3qVs; Fri, 19 Apr 2024 11:01:28 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxkrz-000000058qD-2kPT for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2024 09:49:27 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-78efd533a00so105605985a.0 for ; Fri, 19 Apr 2024 02:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520160; x=1714124960; 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=xe5eM9+2rh+qYMrEZDkgx2/xN2LnDn/yiZVZC6+s6fs=; b=L9wgI1EGmQucC8S/gJ4dhAw3YRw+mu1YsHSx/d2rLcqGzoVkXrQ2wRJVt6in34o/Sm r2hzbbEA2ox+ylKyMdbUz+kDOHkFz9vCUa31YXWvRR0/mmo/3FW4F6v2HW72jygtG2pf d2Z/n9H1X6TNy7mmhiuAMB61Muh3oxZe8EF20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520160; x=1714124960; 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=xe5eM9+2rh+qYMrEZDkgx2/xN2LnDn/yiZVZC6+s6fs=; b=dZfPKOezGHPhqewf0cIK5V6BQr15YTmBWTg8EhH7bWc9X08ne1f1SnNTvrOh6gKhud loTQUMLtAS/Vj1qqjmzPl1pTjGbrjzarqTMUe/JY0+i+pmvVdSGvWJfwwdMT+82YgbYo zW+xOKdcRyJD2eoc1eka5r0i/Y69Ocb9PI7lVaXCvyx2oifb1V14VoKg5gzJoUJ+q8CJ cEyGHjFG3+OUek2CMGkeaX8CXIQfkw1JH7vZ7lKAmRRAuBzkkuyYHnayfi0g6aFEVhU6 hE4Ai0vAcgULEY4+MuFedgynAW/aqKfW9IPK6KtAGDGoupMU5EV8pkPVF736lMLpUJgr OHDA== X-Forwarded-Encrypted: i=1; AJvYcCUQ7n3pOUGwl9GVSof4WcYEdZyKWMMNLwRbV0C/5L+IBEXGp3ccRaM3E/RevfQ9LGgFEuzqctvTsq5qN9MfGoFznAYwAzJNgZhjx/36CgpHTJLvmi8= X-Gm-Message-State: AOJu0YyCFje4dCTWni6WTfK9rDP2w5+PUCT4fvw2jrPdhLE33NbZsXv0 9BO5u6AvuV5wHr6zoQI1DtPhaNkXMcTV5lsRTaCx6coqsHn0U8YzHBoYBQcGmA== X-Google-Smtp-Source: AGHT+IHKE5I6bNN/ygxYDQdIMuWr0dmGCsznmTcTgLl7Ioa5cL0u9qYtPjL85KqnZCORUNl4F1qURw== X-Received: by 2002:ae9:c119:0:b0:78e:ca95:81c5 with SMTP id z25-20020ae9c119000000b0078eca9581c5mr1646405qki.77.1713520160591; Fri, 19 Apr 2024 02:49:20 -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 dt14-20020a05620a478e00b0078d735ca917sm1434532qkb.123.2024.04.19.02.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:19 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:47:48 +0000 Subject: [PATCH v2 02/26] media: stb0899: Simplify check MIME-Version: 1.0 Message-Id: <20240419-fix-cocci-v2-2-2119e692309c@chromium.org> References: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> In-Reply-To: <20240419-fix-cocci-v2-0-2119e692309c@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-20240419_024924_047084_5D78B305 X-CRM114-Status: GOOD ( 13.83 ) 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 Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- 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;