Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1655270lqp; Mon, 15 Apr 2024 12:48:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNERzKd59DIrTqLWIr3tkW2xcDLKEI8CVXnkLClarNRAmofNqC5p6z2R8gSpR64/E46W3QIPvLD9+59Kml+yHkL2WNba0PO8hERCBMUg== X-Google-Smtp-Source: AGHT+IHuEYRbNQD78qm+/B9WWSQE1GARJzKfrqYs0YdVy5qkzPTQwmF7wSuZ3kMoa+n4pagY7kA/ X-Received: by 2002:a17:903:2292:b0:1e5:c06b:3330 with SMTP id b18-20020a170903229200b001e5c06b3330mr10969660plh.24.1713210512012; Mon, 15 Apr 2024 12:48:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713210511; cv=pass; d=google.com; s=arc-20160816; b=bjz+ozqoldXqP54v4OupL+Nxh4HDsd+3TZbXqfb6A3IM+yVH8hyaFboTZx5PwsV62y nF7sDo1HvKEwLZUw1kvmBAk2ZarLie2/F1bvvs7lE+x3G1+Pu7uCqy2eFsa6JOLzL8UZ JneZYmopZUfizLob971Vfd4RkpO+462daiGCPSo2dDKF4PCfowEwMg246n4iHQBaEgZ2 +nk4QCD3nxbWtdxCKzGy+FAbtPHI35InCWYH3xUplnOfZRhwjaD0sTHGKae95eYnFuTM 9gE86SDStRYkzuGHzPUauZGAf4zTgIeIuiNO4I8JNDc4N3vtcRHpoejoMGyljTgUmAk+ jrQA== 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=9xYCSct9boZ0BOkqN2tXVepjBV7/8cHg/+IKo1joAc4=; fh=QXpayE8J3TZ746UfMcvnCs2WV7cBOu0iVQKQs2WL9OU=; b=uTtJ72kHursiDab541TWkBVduEs/daWp25SYd3qEbHwiBqfwCBGTiL/IY2MqGgFWOY WaPHVTxdF++YVJis5H+PaKq4vUVQeKwSWJfZZLTcI8Kp/PWVx2jey7bopducUn84Fm53 sKAgsrMMAbSqMUijXNrl/GTfbKFfjo88IAwHD9inURHizx0XJWrimPY5nSplVXioWZnF tnfcVk8+yTIIJl8sSD2XUII7URrrV7yGU27RsRXAYhL2/7jajqIfbe7p+YtGFfksjK8u DbYORbxJFxeknVdcK9rPczBoIZnMEmEqd/9BKw7IgBH6FKyM0EJoFCmKocnULzun/zNj NIqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MJiBhinO; 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-145802-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145802-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k11-20020a170902c40b00b001e47fa9ae58si8555338plk.651.2024.04.15.12.48.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:48:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145802-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MJiBhinO; 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-145802-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145802-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 3296EB2351D for ; Mon, 15 Apr 2024 19:42:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0B25160793; Mon, 15 Apr 2024 19:34:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MJiBhinO" Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (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 27A5015F40B for ; Mon, 15 Apr 2024 19:34:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209694; cv=none; b=BePB/1ax3v9KZAvotOuqNVsvBJaXfB+oi5Bv8tDdUXMXzKlVW2LvX80i1QQ/KhCAS8Ol9wW9ZSrUNwYBVOMr5DPzVlY4TqUbc0LgZaZngYq6m/Ux1gENrIKFbLvGgHLfd2BezdnWn3L4uSTSJA0RyKQGX+uwtXGrVMKJCrC9L24= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209694; c=relaxed/simple; bh=YPNZ8kVmJqYj3aJ9reXbJjAI4Lm1Fxh7hl3qKl9KMYI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EONq/TxwdSv6MwMyj1E/MYoxE2AozKN4I2Lbo1+A2hobHkM4PD4BbGpJdHHYSYLAWkLSnq39nbh4d5x7vytsdHgGHVXmMTcqVI58+4HpDwuzk6j9smbiYE7at5nsnz+Y8i62cJTxWC8soP5NcU8bNDFZybaPNRJ0P/ugYViiyP0= 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=MJiBhinO; arc=none smtp.client-ip=209.85.210.48 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-ot1-f48.google.com with SMTP id 46e09a7af769-6ea2ac4607aso1923397a34.3 for ; Mon, 15 Apr 2024 12:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209691; x=1713814491; 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=9xYCSct9boZ0BOkqN2tXVepjBV7/8cHg/+IKo1joAc4=; b=MJiBhinOMK2NZCgzlz6n0eNszbWFRpS03Z6pXSqvk7JjSeYnh1YimSwJGxNaXUX+yz yx2Id+jmGGymvL86cZy5tgxObAQ3+SIR6hOa7p1wBzpLlJGsP5lUtT1l0gNUGp7p60ti PXoM25H2GTZY2jUFVE6RGlJ9QbmnE8Xi+hrUM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209691; x=1713814491; 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=9xYCSct9boZ0BOkqN2tXVepjBV7/8cHg/+IKo1joAc4=; b=WAbxvSFcIA/9qnAIOQ87ohFmH7u5/L7F/FJ58xVKk0xLDHAjiEa2AvaWZ3KxU8wh/y gcM88TgaBgilWby/5N7Oa09wMVcxH1DR1Yf6AGB/lbbR+2I6QRmIWe32KRXNkYOeF9wI RCNf3SkUa1Vxq6jHnwQcqXo4+P3/jH/o0Uqyq6sZ+MQ6mkCeUJAO/YxlwjlFpTkkFKEP DK/HQYLZEi8bAid4Z7uIzTfsBl+rLYP1ol5NTYTy1luSNa0tS3kccpOZOMl62aUuJea8 xp5KwqKVRmi0gNcgWiJJzAtukTDsGqfTtGUtcTVaOMSa8xb9i9C3OML/6ozhh0L8qBtC K4UA== X-Forwarded-Encrypted: i=1; AJvYcCXCx0IrIk0gm6Xk9+sYBb399ZI2r29hblCYDSvE8zyIXAUDszoNVmn5Wx3IQeIIzx+yOR0oiR89j34zyNit4Q/ynkgMeq/YiI8+kOkg X-Gm-Message-State: AOJu0YzydR32zxoIa0Up2EICEF4TX4jD8umU6EtcCcbBeJe5Z80F+HJN fXUlru03MiiFhKjXjS60T5WtXHVkD71TZYu7625mynF5RYYt2eMTii76oRoabA== X-Received: by 2002:a9d:6ac8:0:b0:6eb:75b6:4245 with SMTP id m8-20020a9d6ac8000000b006eb75b64245mr6116943otq.15.1713209691286; Mon, 15 Apr 2024 12:34:51 -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 s26-20020ae9f71a000000b0078d3b54eb76sm6718055qkg.78.2024.04.15.12.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:50 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:37 +0000 Subject: [PATCH 20/35] 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: <20240415-fix-cocci-v1-20-477afb23728b@chromium.org> References: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> In-Reply-To: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , Hans Verkuil , 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 , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , Benjamin Mugnier , Sylvain Petinot , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Niklas_S=C3=B6derlund?= , Pavel Machek 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.683.g7961c838ac-goog