From patchwork Mon Apr 15 19:34:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630651 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 067FCC4345F for ; Mon, 15 Apr 2024 19:40:36 +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=IRpOmmzt6R4RvEFzlNJnTbrXWMBrtij6I9y6l/H4SA4=; b=rQpviwAeALHpjE TQ4fvu3ycAca/zQtZe2p5AZVMRprvFTM2bvv8iQA+3WHolqdHWote27ph8hypyiDbMO0tz1LnQc98 rRLeYh4e7Eh66Su797CVMX4SPEZshiE6UKSg42ZwuOsPqw0s2J5NgpuBU0/TFT+5O9MVnPQkL+CiM TGllsJmcfbdse+eN5EJlQr/1nHYlEeVSLqa2+QwnROjMoQlzmOciaMRXD97k/8JWZb/IBJ8D0L4yy sEjZTSBXJr7yLBWGg0lbGHvGB2KKIZlFzi6yMUEbW/T1/Kev2SWfNr6EC66EWP0HY4K2ivqYapZV2 Vu6Y2BY2ogTNaH16QBgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBi-00000009fTb-3DRG; Mon, 15 Apr 2024 19:40:22 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6e-00000009cNU-0LRJ for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:12 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-78a26aaefc8so206592585a.1 for ; Mon, 15 Apr 2024 12:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209707; x=1713814507; 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=+lJf0+XIBDdSVuJAMeJcbyaAa+r8UncIi6K0ZFQWngw=; b=eOtpnsN1BmS0ptye7ZrzGFp1mY1gnkV7ucOrhv8mMrMv8MwvZMa0dHHg1FERLYCyaU MOuWJ9yS0pcHz0B+jhxZAbBWvOmdRmXXYyYpfpm5PKXAjSKhqVop7/oNQDOKSeh68q9R HQY7dQ2TsRpOB/RRGTXW2sejn7l6wEnO7b2mA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209707; x=1713814507; 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=+lJf0+XIBDdSVuJAMeJcbyaAa+r8UncIi6K0ZFQWngw=; b=MZA5As9uLKbaKyy4Fzx3fLVp9bIuyXAPkCY9iauqhvOzJAfLrF3w6qrWAkMSGNWPPX hS+i4S6Yu82buThYVQHFeo4TWjczDLlLrfNdfY+Re50MPaC2pQLStvNNQoEGo5S9CPCy WpGY8kFs+ySy3lXZjSFqMRQg98tEU4RuqDZFaSwE+pGtGL1l39mEkXN5I/mx/Y1JSO0k BZa+UTewIQ5bVYyzPqP2qNG6BosEN4GjkNGadMW2ct/wVe4ixg8UmFLeoNkDMWTkciRx zjY8WY1g0kIu6xcWeVl8kX7SMbaVX90ae1JVAL6ubjjTWX8s9UgXQcQAcG3EdPE980cj hI+w== X-Forwarded-Encrypted: i=1; AJvYcCUPTjJshtFnxaWxPGKId7WTV7r1hXrgccZl+XlnrEs6ZI2oYYCBkG7aATq/67bjH9uY1SXAniSymvwoA0iott9kc9MBqGJdw+LPNaVa5MT2hH1sp9k= X-Gm-Message-State: AOJu0YzhICNZAWBIxgy3qPWqyCLsitbIXyEofgFM9fqpu1FoIo7PuGtW hfVoGNUciTJXLLKPcZfe3WJ5/Jwu99g1H4kkn5Ih1L2NHl8pJwWkEIvRdJhmIw== X-Google-Smtp-Source: AGHT+IHZ1e+rN5kElZ/+CBGmltPllmsoOBrN7bu5f4/61aiFTpQ8yq022XA0QecM/v+OB1heBU4SXQ== X-Received: by 2002:a05:620a:400a:b0:78e:ca18:4093 with SMTP id h10-20020a05620a400a00b0078eca184093mr13235627qko.60.1713209707046; Mon, 15 Apr 2024 12:35:07 -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.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:06 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:52 +0000 Subject: [PATCH 35/35] media: venus: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-35-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123508_357453_6F64C90C X-CRM114-Status: GOOD ( 14.01 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/platform/qcom/venus/venc.c:611:12-13: WARNING opportunity for min() drivers/media/platform/qcom/venus/venc.c:651:12-13: WARNING opportunity for min() drivers/media/platform/qcom/venus/venc.c:629:12-13: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/venc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index de06e1712d09..285bc1b4d888 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -608,7 +608,9 @@ static int venc_pm_get(struct venus_inst *inst) ret = pm_runtime_resume_and_get(dev); mutex_unlock(&core->pm_lock); - return ret < 0 ? ret : 0; + if (ret < 0) + return ret; + return 0; } static int venc_pm_put(struct venus_inst *inst, bool autosuspend) @@ -626,7 +628,9 @@ static int venc_pm_put(struct venus_inst *inst, bool autosuspend) mutex_unlock(&core->pm_lock); - return ret < 0 ? ret : 0; + if (ret < 0) + return ret; + return 0; } static int venc_pm_get_put(struct venus_inst *inst) @@ -648,7 +652,9 @@ static int venc_pm_get_put(struct venus_inst *inst) error: mutex_unlock(&core->pm_lock); - return ret < 0 ? ret : 0; + if (ret < 0) + return ret; + return 0; } static void venc_pm_touch(struct venus_inst *inst)