From patchwork Fri Apr 19 09:48:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13636100 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 05CC1C4345F for ; Fri, 19 Apr 2024 09:52:45 +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=G6Q1POLVy87He2CPgSEeLkbvJVlk2je2iObmBrYLylk=; b=mmV+Y1QGOGE28g nnOSjXfbZp4bKjh5QTwa6A2KL0TwGkKoIg3dXsoZEHXHpwmHXVHiy31IB5Sp2FamhoooFL+iQxpq4 hkXnmUgwcz3O+TMnyf5bw/26iKXcF7onDnoOVhyQEqpVN4QoOrOpDqnCFxsmQo2CneBdZRGBghLt5 1nVeD7SnUdU54DKU3YwEag01BJjM4N0lH++BKIo0lOfAv1tLmTdD9QujSByzsCtVClsfznyMH5tX6 2xBft+trrqcFJ/haiXCPmeAqpDJNSKrBjJNVd8v0sHOvHt49IXhufqo4IEDInD+nT+T9kY8KjA01C siqlVCZz5YrurC8ljlcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxkv3-00000005Al0-10Km; Fri, 19 Apr 2024 09:52:33 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxksJ-0000000595r-2pya for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2024 09:49:51 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-78f02298dc6so151341185a.1 for ; Fri, 19 Apr 2024 02:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520182; x=1714124982; 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=gMpzOFCFY/OFyCB78Iqov2ITRER3c7lueX7XaC40UJk=; b=QKkjF/3ZrmyMjLI6PZxoR71eYFuXqsl1p6Fuz8KRX9DkFrcMN2d6dwujihI52umbvI lUhB4xQAyDW/dE76sa+lWCYRyjthZD88GDfvdsWZ0aW/9++SSDWiKe2oVNLBkjaRDRaX x7m+9nv8oPgF+4j9uy/gzICZcD2E0fIFj3ZKA= 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=sYkmGJeDYnWEUiy/Nm8HLVMkuHoJX/vvhzXRhJFuHenb8UH9EvTHzUqUZvmQl6fc5X 1DVcpYsxj6YoDZi6hQLrKBa8zkRxWfIBK6JGkY2zgqJjUtREeRN71kj7VA5iWz9hiO72 PQnGUrc+63AtjBSvGhvgB03Idd1wGIYjopdtsDr7CAHGS99sVqQoqQuQjgk72USTKK3b BXnzXi3SlJiMq9wj00tg1YmmCQJ4hMosTMuTC6YP1Jbl2nF0uE0+Lkt73CVy9Wjf5Rkf LDu2L7Zy8NnWs+WCn2GS7EcbF0CcApedLa4+nhkstfIOiVGocdCP+e62V/q1oGGfplis cX6w== X-Forwarded-Encrypted: i=1; AJvYcCX7OMoiV3HlH0BzJpAMGgFJLdJ0OXBCO+NRsxFXoc22+dcmVfeCaL2xV7YCc0K0gGWOepi72VBLe6DdV1Yy1wpJy6fe3fizSXOYjDiYKc5sJ3g/HvY= X-Gm-Message-State: AOJu0YwYh7s5VyY9gpWYKERTTIslqg23p9bw6VoZnWLhu0yoe+71tmUY nM+iB9tnLibTen/24eRvfsHWHP8Uelim2Ggv1MA/kdZqmYecWYGoqzlJTnh7OA== X-Google-Smtp-Source: AGHT+IEXhcUKUor0dxuV3thvzJo2y+QPxtJebfEt+tWOQcWOyhTJf9Fve6oWEuZlRhBFIInhoP8+Wg== 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 MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240419_024944_281254_2E5B8E5C X-CRM114-Status: GOOD ( 14.52 ) 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 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; }