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: 13630548 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 38364168B15 for ; Mon, 15 Apr 2024 19:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209711; cv=none; b=MHFQ1tknc1R4CPKHH9U5ZkOs1G5tcF3iQXhedn6gs52wMM8+Znb/jltX/3BhBdqQHViwA+Pianic37UP91ZeSquoZzDN7AiawBxv+PS7Fg2sh6QKJ2hoW8AlEcyZrSWRYG8TLeuE0yxxt+sHbCAq2rWz3PWIls/rZFOKSCOqCXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209711; c=relaxed/simple; bh=YppEHZnTLQzLGD2f5s7SR2AaXE+KWzBq1dtSVEVCatk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OiyN/aNUzVE8twyU9mhaSbKJ9hhWYQq3x3OZUWCJgE5ukqygWCrs3PUJ3lF5jAchaky2DrpqCt1g4Ckqco+wTu0qFaOW0pdtHN9HoSh6pDjgWLWvtTE0EFvhAcqeDJGRPXj8+XG6fLtp4BaqEbLzKJGVmDPK0MDeVIrLVx5IwcU= 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=IYQi8Syt; arc=none smtp.client-ip=209.85.222.174 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="IYQi8Syt" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-78edc49861aso135695285a.3 for ; Mon, 15 Apr 2024 12:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209707; x=1713814507; 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=+lJf0+XIBDdSVuJAMeJcbyaAa+r8UncIi6K0ZFQWngw=; b=IYQi8SytxW2a4klOXWOqdV9eUoK+fnBZcgD9f7unUBZ9UoHKuM1/P7QJKHAbu/hNvv shmSqKH7rHmDkRHDobZYKhw9h0+mEpNEK8thHsD50vD+6XrN0IgWTcS3myEza7tWDrYB Uh4wzrnkOHi45phaxT6ahtPdBTIWX+QLtIlkE= 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=n/osmQlbOIDlc6OrxsBp6Q2EtAB9PNXGtFVVc88VmORRyO4ZNrMr3kw1tM+q6lDNRP QSYyChERH1P07tIda8lJQeAT7wbSc3bE3WmSuNVabOYJmNlTtq2eAsBDtp/henGhAlmR JdBuZTnbmJEn8m3HhexJ9Nv7nTDXsYQYyb4alMTwkwPiQ0MrHsV4roC/fU1tuQ5eBa/n e0GQeF8zHp2LKhso+DZuDWaOlhLZDh9+9+TZGOf/qvRH5PiCtIymOafxoTG5jfAabpd3 LOAWbOCWJDbqaSxmKb/qeouQnFMZrEeoQCLMKndHem7FUCzv9arDe3PN21fQ1MUJ1xIp xgCw== X-Forwarded-Encrypted: i=1; AJvYcCWzFI5uC0pTApCXbE7n+6Pa/osz7t7F4M1b9ihIwd+NJAtMhwsxxuNKjqqliitB5zccRrsKxi0G/SX9yGpHco7M9oPNPcRrUrGeFkPIVw== X-Gm-Message-State: AOJu0YySJ4Xt6E6VpiIVukznLyn1zSQbdtXrOceWwPmEOPluT0K9dU4I CjhPe9CvZNjEbr2CpBQi8KFY2dehxbZotGSE4Axm9mSWpctma/jZeTH/4PJpzA== 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 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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)