Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp522467lqt; Fri, 19 Apr 2024 02:57:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYRzub83KLuh8zSFkXbPAGGjsmCsWgzN3tE7waMaDOkwS2BxdLS4MT9ozOaQ97hro9j14Sa20Cc17eHly2ip00/RaD181zfRyhTWbiWw== X-Google-Smtp-Source: AGHT+IF08fVRda/t2lkIP84P/rZ3ddIsuPubyHi/868BR2DUA3bhrJ3C+dG3eC47MxlYSYSjd6TX X-Received: by 2002:a05:6a21:3510:b0:1a7:23ae:4421 with SMTP id zc16-20020a056a21351000b001a723ae4421mr7346940pzb.24.1713520626739; Fri, 19 Apr 2024 02:57:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713520626; cv=pass; d=google.com; s=arc-20160816; b=PaBQjLrKAwCYk/M3oo/GXI8+etgJ4J4jfqP/ThBQeYpZ4wfQVWhZBCZyGCjjo3/jG6 Rp4q05TErcu5Xxv3iKDzVWMccd2ftH56Y6/H8id+uesNEKaPdxEaArqje05CMqz4ltWe OXlghyaJHj+K8eUcJ9so5tcI9H4l/lrS4rNK81Ap7JWsjWaKLn/K61eARVn+7Nd8tLCw poD3NFmLO9DJpyFioxwWFeXpxyjYhU2lSgQ6kQ4NTlAlDMh3BhkOm9N3drkVRm9fb51H gqWxL521HZZ+6kHX3TinuK5qkMErhcctpOP4YK23CtGEZfVKb+Zd+RpSnt7hMZt9gpoC D32w== 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=WiPvOycWZkzvDDpSXCv09GT2V+pCtbgLSOTOGWZLdng=; b=q/7UGlXmHDfF/orr4ygH0C5W1KEHXeCwplW0Cnxji0Lvrh7kJFp+gH6UfdituXBmO8 OfqOledrxupZ/0lSLZymdEXT5BqGxcLmkIdqtoXlHDLZ4M4K1pT3LsW7J8L/m7oC9jCf roTltZqH1WTKA0cpDrymzRpcj6DdKnyCLRVB096W0sU5rsgT5wRUGPRwyWJHGxwvrmq+ lu8T9dKSdO02J3zLfxWm9Led0N2/LDG4j7FJYYi7QpoYgV5wurgjIIL2CFGZda8zs317 NhuQ4i25uYSi39E0Mn8glJjQjcVhzIdg2h3EJqAxNtsSwutb54wdGT/sHfubwTXwu0oj GfiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KS1N1qjZ; 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-151267-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151267-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 d124-20020a633682000000b005f7fd9b273bsi2897pga.420.2024.04.19.02.57.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:57:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151267-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=KS1N1qjZ; 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-151267-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151267-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 E23D4B22F05 for ; Fri, 19 Apr 2024 09:55:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 254F2130A75; Fri, 19 Apr 2024 09:49:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KS1N1qjZ" Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 2C79C12F394 for ; Fri, 19 Apr 2024 09:49:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520185; cv=none; b=sROp+4fUKIFeNioHca0Pv0694iirEHGEw5VU/tmPqXKgR8HFx5lW+RYhL7Ht0TSRNYg7bvv+Y/SjPw8Z3UKc9blOHzpG4bBnAp4vZz81wyFxSsPeGoX9lX9bhtrnO3LDYihVHgMmUpQ21mU3m4rVnyZX9e01WvwHNZ1q1nl+jrA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520185; c=relaxed/simple; bh=m351M6HyiT8IWLkyID5itxiSqWILJmFaZ7lxVFnP6BY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZtExC/fAU3g/Z/spA7YuRRFACUdPW2hEsdkTBC3lDd48lBzosqqEeyYKs3qPI0wzHN/hGJgrIDndfifD3vVubSHycxUJrTUSvr7n+RFLVn4SGrAFpqBHDnMNIh21vrSPwdoOiTSeuf+eYAh86uZReMFjd3dT0YQ9YWOZBf9pRTI= 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=KS1N1qjZ; arc=none smtp.client-ip=209.85.222.179 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-qk1-f179.google.com with SMTP id af79cd13be357-78f02298dc6so151341985a.1 for ; Fri, 19 Apr 2024 02:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520182; x=1714124982; 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=KS1N1qjZK4OzIiQOBGYVGIGO5tLwBdsFre+btJV+UyPpHLTvqDZc3zkz547hbkRU5b beg6iw5r1aaQyFnlmFRoXhfS2s+g7xR05mgjtfvcmF/Im2eoTK4iyhNNR9HbcWULeme/ m53QBrR0k8wwU9+UVsTdBJX0SlxL2xYP1NR3M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520182; x=1714124982; 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=EABbzRn/8NhELDArb0EbEgEKg38nDuoxls6UyaFbLVyMdJcAKSeYL6e/a6b0snV7rK lsT1adRk6KOfVzovV0jYzdKbd0mm37muB2GUL/Rl+E9zRErROfYvYIUN23nJV88cgq0q BNwH9Zu8M3fRliDyAaxdDNlP3wFi1Cp+P7LtH+pfqjw5rwN0oWzzLj2lZU9ipsHL7aa/ bgfkINO4pzW0JqBPe70H0PNH86jO8lHyByT7wAo0cLkYcsfwI/8RmUuEGtGKiZhobXCm GS9vG9nkwMNagt75NR2NBMA7omZCkKabBjQ3Ss0W/BkbhRTOXWiFK27RwVKGc2188D77 GgeA== X-Forwarded-Encrypted: i=1; AJvYcCXmF0pemTOVuTbSrDXQ07hiXU90bgx46oupse8R4E6UaQI/w9KHgoP9caOoU5hkpOhHcOe39RBtmD9PGHpq0ikNXwx4twXpxID3SuDc X-Gm-Message-State: AOJu0Yzxvvv7bqdT8qhkgvlWpwYIbYvIkQucTWrQeHlGWcTg66MFXC5H aH/znaqhvtN3VRCoD8YVeX1/9Nlrwo+4uzxGhJAhb8VO9F+kViC4T/IW5qq1cg== X-Received: by 2002:a05:620a:956:b0:78e:bd2f:1088 with SMTP id w22-20020a05620a095600b0078ebd2f1088mr2994401qkw.4.1713520182200; Fri, 19 Apr 2024 02:49:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:41 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:48:06 +0000 Subject: [PATCH v2 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: <20240419-fix-cocci-v2-20-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 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