Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1654123lqp; Mon, 15 Apr 2024 12:45:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2KmNHxQMtTK9GuSxMPuteLhpCGGp23jsnvOAaXRq/b9K7eGvdFCQ9BOO7noL6qt9CRKgiLG1xYy8bxbjHyKEbGX0xMwgGAKRVyU1LbA== X-Google-Smtp-Source: AGHT+IFk3fv7be1sltgMwhwWXOTPBgog+XH2rCeWDF7+1JdyQX8pH4BA+ODtHhKRI0CdbVv4k782 X-Received: by 2002:ac2:523b:0:b0:518:c89c:e846 with SMTP id i27-20020ac2523b000000b00518c89ce846mr3024876lfl.56.1713210354980; Mon, 15 Apr 2024 12:45:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713210354; cv=pass; d=google.com; s=arc-20160816; b=ZUADlXVtfTAR1TaIeHAujrwalJZMB1jTRpVE7sO6EJRgF2Cj/BbgbvNDSXpGloagEo dlRx6E2qkSQCN/sKRTlpQz7sqr9kXAlJMZO17g2PS8e2G3vcyuhXnBpo9aGpqyaRG2kc krvm48QLvYqHs9w6TInTk67FD46bM1LpQX72DuTjyQtaw8639Y1vhcgwosjJ+BMv2Dzt wPgmZv8oDxIDmiX0UOwHgHp3n+VHsLk53ab6RBmSK27TKCSSbNjVYuT96uaeC+uR4HZP 7Yj/K8m5X/ANkiN6y0GSJ0Tp71FRn/WgFZYK2psuqQZim/YzjBvJZtvSqdfniCwyvZCN 3gcQ== 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=HU2Q8r5u9tJlP6QMXdfGI/fLu0DCpsTU5mW0ctKluKw=; fh=kaa/Hu03g2iwc4PHliZ8MtLHornAdjZnl09gpz8PPko=; b=js8wW4o9nGD3YEsrTZjU6dL0mEcTcn3y5pAkZEQdLr8PNSvFcu8Xahis+u18oMWSRw hLJgP2uq6Fo0eQzxIWgcgD83mxv6gdCIzv1yxwmfIYnh4aaDK7yQyfT1eAqsAqUEy6OX ht6Tl3Jop28LlW/6WvytIRFEMyxzfCfpAoZ76mV/6j7EC+Y1J+ryka2MBj++8wX7O/iH pmyt6vkiWr9CJ2HqXUw9n4EscHeBGgVd5B7ggeNVdGhkMn4DqDAKFqoifpq/Uhx7mQRY 4QM61Fsr3UCB3RiYtX2h2pHj5zqRhGo3UWRtS04bWSy8tg8XgI+g5uwFF3mFpp63qqZe FHug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=izsYgQ3C; 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-145814-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145814-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hk10-20020a170906c9ca00b00a469ae2a011si4812069ejb.761.2024.04.15.12.45.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:45:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145814-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=izsYgQ3C; 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-145814-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145814-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 758E91F2270D for ; Mon, 15 Apr 2024 19:45:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 560A416C69D; Mon, 15 Apr 2024 19:35:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="izsYgQ3C" 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 DFB2D165FAD for ; Mon, 15 Apr 2024 19:35:03 +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=1713209708; cv=none; b=oj036TlZ/vz0i7wR8rB3ddqEMYGw3zw6OvqK466YuU4NgpKJrJZ+SjqNhbbGA1vXelpxJoQY4q5gMuwpzIYVvOBu62dMnAjyWCEjBdmQ2jR5Vx6uCD2SgnIZnjSKbYIE274cN1wzEVonZh4+XBPllUr8vp7/uDUuex+uqj4S/s0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209708; c=relaxed/simple; bh=qwJnKU3Adz8cA71PPhU/Bxyy2mqr5yPU03Dfu92Wqso=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uLID1DC8ipIRebeO+UJUCN+IDTYYZ97FQPKU9WIBZPsEHcGVlsF5ddEf+sLOsTpZoIwi1hlxsuUZNWJA/vsq6ZycY+jwHnzyUsd7k9k7WZ0mFGLD/DTrbiUotYF8qdlf0h7R8E34H1uaFcJeIwSusH6GTbyFZsVJLHAwuRQnFOA= 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=izsYgQ3C; 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-6ea2436de79so2454650a34.1 for ; Mon, 15 Apr 2024 12:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209702; x=1713814502; 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=HU2Q8r5u9tJlP6QMXdfGI/fLu0DCpsTU5mW0ctKluKw=; b=izsYgQ3CFljk3LL8vR/moStVqPeTNK3vXgul6siNJHAZlZ+rXZt/pWby8RR93x25UA Us0H0crIu2ZmJ9COJR12a6L+1bvwLMj8shIm6f7cx8iTP+p6XzeXjobfYBLJ5Hh3NEZy V2pIqr8Bm6I7642EH7W9GlUUctvow0XE8Yn/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209702; x=1713814502; 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=HU2Q8r5u9tJlP6QMXdfGI/fLu0DCpsTU5mW0ctKluKw=; b=Y2+jBrpjzPU36U4qjpFa0WJw/I6nJnMaYYEcxbAY19J0v9qWz2ZcGEl/3gJJa1V/EP W+YFtD0zlkpr/KzhCogy5qu8buNWgGK0arQuG+oQCUvC4EbiyIbmUKZNMTB9G53CXHCb omKOmfAl/iRh7JoWQ47wUxOjxEW1osE/iGKTdNQ8Gs7w08YzXluLzfSJfB9JEX1873D2 2k+iullblmRQfq07q5yukhE8KArT6FbyFiEDrTH3KXM9gvpK/Sl7Z+0kGyyLM61lSiiw +jIR7f46Eo4VWyAYHThCELVGPiEgtU0rIYaz5va+kbOcpy2BMmvPJI6RRfjQl3sL0dc0 X2Pw== X-Forwarded-Encrypted: i=1; AJvYcCU7A67Q4iTWmJwI933GD9FKg5xtRQLquKWw/TfAFMcMI8txi7N3+ILt1JM1Mfytpj/Ji3S90YfvnSZ3lJQ3m1uHgdQmShlUFCwCvYGg X-Gm-Message-State: AOJu0YyhSqbyx3xlQk4RQYam2vPJXb4fwrRxch3p0OU+K2E36JNgyzkv 1OdQeyN7KIaPD4AO/Djr7dTTRf7C0TBzdHXUazHlV1HoJymhWiALVtgA4BrW+w== X-Received: by 2002:a9d:6a15:0:b0:6eb:7c52:ed04 with SMTP id g21-20020a9d6a15000000b006eb7c52ed04mr5573331otn.5.1713209702690; Mon, 15 Apr 2024 12:35:02 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:02 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:48 +0000 Subject: [PATCH 31/35] media: cx231xx: Refator return path 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-31-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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/usb/cx231xx/cx231xx-i2c.c:353:15-16: WARNING opportunity for min() drivers/media/usb/cx231xx/cx231xx-i2c.c:262:15-16: WARNING opportunity for min() drivers/media/usb/cx231xx/cx231xx-i2c.c:326:15-16: WARNING opportunity for min() drivers/media/usb/cx231xx/cx231xx-i2c.c:176:15-16: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/cx231xx/cx231xx-i2c.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c index c6659253c6fb..28de72856c90 100644 --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c @@ -173,7 +173,9 @@ static int cx231xx_i2c_send_bytes(struct i2c_adapter *i2c_adap, status = dev->cx231xx_send_usb_command(bus, &req_data); } - return status < 0 ? status : 0; + if (status < 0) + return status; + return 0; } /* @@ -259,7 +261,9 @@ static int cx231xx_i2c_recv_bytes(struct i2c_adapter *i2c_adap, status = dev->cx231xx_send_usb_command(bus, &req_data); } - return status < 0 ? status : 0; + if (status < 0) + return status; + return 0; } /* @@ -323,7 +327,9 @@ static int cx231xx_i2c_recv_bytes_with_saddr(struct i2c_adapter *i2c_adap, /* usb send command */ status = dev->cx231xx_send_usb_command(bus, &req_data); - return status < 0 ? status : 0; + if (status < 0) + return status; + return 0; } /* @@ -350,7 +356,9 @@ static int cx231xx_i2c_check_for_device(struct i2c_adapter *i2c_adap, /* usb send command */ status = dev->cx231xx_send_usb_command(bus, &req_data); - return status < 0 ? status : 0; + if (status < 0) + return status; + return 0; } /* -- 2.44.0.683.g7961c838ac-goog