Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1443102lqa; Mon, 29 Apr 2024 08:34:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVpMwc8r766YuTfuk3xMUAH9DKidpYU/6wgvh18w1Y5ze+TbQCfSJ4EDSI7T2W1liC3upp4cu+P5z0Q6ZeoCrg2IUO8g+e1WMrr74BTmw== X-Google-Smtp-Source: AGHT+IEv5DvxZWP3/ZVW5yRA9tKvOrSk9NapBKj1H8WGql1+WnYAz/LbmBCots63NsnHlvycm2I9 X-Received: by 2002:a17:903:25cd:b0:1eb:542e:dd7e with SMTP id jc13-20020a17090325cd00b001eb542edd7emr5857026plb.36.1714404871845; Mon, 29 Apr 2024 08:34:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714404871; cv=pass; d=google.com; s=arc-20160816; b=uH+X5Z6kPU/orjowwO48FUqE4UziRG3Iz8XeZnIsNks/cdnhVaOV3xhb2xng6ZOPjI 5uXw5tjkzBVZFZkajVAn0g7vw3v8g2aGM/pXVJUR6+QzmqjvQQgpYybmkI+Op0p8iRa0 afX56jpkmh0qg6dG+RJ1pktJrsHu4Fb4NpVhCfq94bgYzBL/wRDf82wlbIAMj987eFqs uGcrfgOM3DJfrHWPWURMz9MWVqU+qzMfWdIoY+L/gNyH+rAhTMQIz4fhaKP4jpKE122M JqS4am5YVVd6or30KgmRz9omBJW4/zh/Gyc2Nbr7hSIoNdYPUTp4ZG+Et3gaDEaiumuv hhqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=gMpzOFCFY/OFyCB78Iqov2ITRER3c7lueX7XaC40UJk=; fh=DF32MPY4FdnEkCO791Ds9Fg29jcWa++L/sspHa8lqko=; b=XtXWeSmhSvO/pXIWz4AzKvivIN6axSxw0ZW0ezI6uJ3F1oBUyTr8HR/hhuFD52zLzj iBkinkLEOcmxvv7YYGuhdIvSDW9uWVa6sKR4P9nkirNH93FnUQucwAAkjfzBbPTVoyTW vI5/GaBcytzaDkYKleqSYpnp7bPqtLV0X38UukJSpOyrHrDDPcSsKfepxnT4dowzoXqV bxGC7ezShgQX7EUKgdh2K6qSJIYgpiubXDslm2tH0Ucv8DBp60zUKAuW7QCFRN3jAzrL SGgwXwRjKNohbx9geAqWNAwDOb4+s5t0mBsrZStWIu4fSJuSL2kkYiAbA8x/sn0RWjrW tCCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TY6b9Pid; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-162530-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162530-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f7-20020a170902ce8700b001eb76680de2si3527051plg.42.2024.04.29.08.34.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:34:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162530-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TY6b9Pid; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-162530-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162530-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 517A6B23BAF for ; Mon, 29 Apr 2024 15:10:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F311981751; Mon, 29 Apr 2024 15:05:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TY6b9Pid" Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DF4A129A67 for ; Mon, 29 Apr 2024 15:05:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714403111; cv=none; b=WoSwFuGpm6pRzqJUKu695T39LPKk3mnKd3JlxRnunEMYCmMZDmWRp5c1ndn5sDL7vYLyEjBpVfaE6tk+9kWsb1e01eR6fJeouVNLxXhPLwecZdsDNyZ6Jdb1pnjydTgBsNQWYpXUD2LtthhwFHnQbRuWUDFUNOa+5QdirQv+eHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714403111; c=relaxed/simple; bh=m351M6HyiT8IWLkyID5itxiSqWILJmFaZ7lxVFnP6BY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WgaV41bvoI78xITxwpUZXHvHM3+ySS/OzoWaeH/qYRSImo3iWRR6KNMSJD8GFgKUrFxF3o3okkO+Heb6z8LUpTCkVRqyE54TDWzsW2a+/j1MA/Q+f1+nheHX4dFAnZTy3J8AiEn/lVylPhKTGJ8rItJ/sZW8PdI84Bybs5mKng4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=TY6b9Pid; arc=none smtp.client-ip=209.85.160.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-238fd648224so1885487fac.2 for ; Mon, 29 Apr 2024 08:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714403103; x=1715007903; darn=vger.kernel.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=gMpzOFCFY/OFyCB78Iqov2ITRER3c7lueX7XaC40UJk=; b=TY6b9Pidc+6498RPchHOExgjw+jJIHiW+kXEE3OWSAmidYED2CiJ+mFVyOC5XU0BVZ tk0bB5i82z+4+kcilO0Cwv9JCJXqmfP+6+gSDwuTXZQbnWQQbm97El5nMncGeIDZmGUu C2hHznhVZB4OeLjL/BdSDIund/YXfEKU/eeZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714403103; x=1715007903; 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=gMpzOFCFY/OFyCB78Iqov2ITRER3c7lueX7XaC40UJk=; b=QZfUAhpbpo7MJKfGuFO0WL79+1HSfWgILvatL1nRKOykbjLjIIDYtOl+t1SB4x5bU3 UqsmExjR7YMBLKgSR8fCbLo3WDNFbBZqwkN2OpYnqOTDmvfsF7C1MjctUaimB35xezG4 BKEn1/mvyhS/0K0xNx6HfNp6knc0q+S4IF4YYt1VJepFWEAJwhow/PnwTdVFoTeLZdRX jN3Jx1jkHU84LmYJmax+/+rsnusiNzoriRhr6vVky7VZ4R6O7jNbd/Cvu+iJRwtXKdHe PidrF7SXD1xs8l+BOA6kIpbM6y6KCvTetFiK3CwWrueKJyiKnO83UJa5lRQutcTPmBAj iyvQ== X-Forwarded-Encrypted: i=1; AJvYcCVWgPISrFIKWzNQg02kv4RzLkSeHpUa9kYRPsQnKLWuf+wZxbYxwyoHTmVd61dTFVc9V/thUh6M2mXT6L/0QbPnQyO5+9MONyj74oC2 X-Gm-Message-State: AOJu0Yyt4DGPK07maxk5hZW94aAHRup70kIx0dFfWLEsYXKurTkUWqrt MKciqnV4LvY6VUFQr1BiwN9VgjbuMuRoO3iMlr/ohkMRZk9uCi8UumAj9r4uEw== X-Received: by 2002:a05:6870:701f:b0:22e:d258:bc43 with SMTP id u31-20020a056870701f00b0022ed258bc43mr12416234oae.42.1714403103424; Mon, 29 Apr 2024 08:05:03 -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.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:05:02 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 29 Apr 2024 15:04:59 +0000 Subject: [PATCH v3 20/26] media: tegra-vde: Refactor timeout handling Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240429-fix-cocci-v3-20-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 Reorder the branches a bit, so cocci stops complaining about the code. drivers/media/platform/nvidia/tegra-vde/h264.c:645:20-21: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/platform/nvidia/tegra-vde/h264.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/nvidia/tegra-vde/h264.c b/drivers/media/platform/nvidia/tegra-vde/h264.c index 204e474d57f7..cfea5572a1b8 100644 --- a/drivers/media/platform/nvidia/tegra-vde/h264.c +++ b/drivers/media/platform/nvidia/tegra-vde/h264.c @@ -633,7 +633,9 @@ static int tegra_vde_decode_end(struct tegra_vde *vde) timeout = wait_for_completion_interruptible_timeout( &vde->decode_completion, msecs_to_jiffies(1000)); - if (timeout == 0) { + if (timeout < 0) { + ret = timeout; + } else if (timeout == 0) { bsev_ptr = tegra_vde_readl(vde, vde->bsev, 0x10); macroblocks_nb = tegra_vde_readl(vde, vde->sxe, 0xC8) & 0x1FFF; read_bytes = bsev_ptr ? bsev_ptr - vde->bitstream_data_addr : 0; @@ -642,8 +644,6 @@ static int tegra_vde_decode_end(struct tegra_vde *vde) read_bytes, macroblocks_nb); ret = -EIO; - } else if (timeout < 0) { - ret = timeout; } else { ret = 0; } -- 2.44.0.769.g3c40516874-goog