From patchwork Mon Apr 15 19:34:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 789080 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 CB0561635CD for ; Mon, 15 Apr 2024 19:35:01 +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=1713209706; cv=none; b=qxuUoZEgHhUNC7V8AMXwgGjAOj7SZ6JzAEl/GAHylhcZK9hs0NEd1S2rgayigiZAttwk336qLjO6mg4u2rNgufthC8/p2oA99SHpjIBrExu7aCZaJKOiMBtV1S9NxELcD4/f2M92eImh8yHKSSus5T8s70vLsz30sM6eqeXpne0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209706; c=relaxed/simple; bh=VhbJFqc8QmLlbHWJnEENrvmuq+ozcGe5o6fFyH1YYQU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ehxGhtGfty584vzyKFylpTOxesRx7XhgPm5fsbFZAMk5xzAPT5H5b3IfD57clw4Ojq5D4xhJYxVIMBjaFNDdfHdz4M7MHHPN4o1M6o1I3oxOcVVtiqcwwu/D+2jNC+0E1fauLELad49CEdfreSS9847eotCQZGpke9T0+x1vlmc= 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=LfHIP3YS; 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="LfHIP3YS" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-78d77b309f2so322302185a.2 for ; Mon, 15 Apr 2024 12:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209700; x=1713814500; 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=OhmQYYxWMuudLBjdJjOGHKHYUzO1QQEhFUDY1X02X9Q=; b=LfHIP3YS/F+mTAzygDVHslx5fAuRJQnA2sSJ5ftryYm2qeaCsuA7qFlI+6p9qUxdkL GuJ9mP67JlIOKKIPlIcpEvUvKrahgJfXZ2/yGY/pppGNfmjI/IW5WlCChJSzsdgMAgwb oMUzsZcPcHH5obx5uHQ2Eq2tJlkHdq4Lai9No= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209700; x=1713814500; 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=OhmQYYxWMuudLBjdJjOGHKHYUzO1QQEhFUDY1X02X9Q=; b=O4pyJl96DM/GaXwOrlS4fi8JfPFoCpid4FLYpVONwoJWADxd8wERkCUz2YcoHKclEQ +9FjP8UMZpKQ2ia+6FZs9jPFOou3NKcOKqBa+9fRmIGhQnGwBfMI1aWXhClS/BSZ7jDG a0uMH+5ojT5ZIAJbjIF1GsrPmw/LlX8gGQ3Mqt7ndqvan7P/Kco0VNi19aMvxt11zQ7O oc01jdJtg+w1fyjfWFegocets/lExSFNwEvmoLga9Bjq1737QoTdNEe5MMJh0gn50wrU m2nneFd/J27lDF/K2MZBNDg9+LE9fYPB/g6p8iexS297Lsii2wXeUejoVqnUbJmRh4+J PkRA== X-Gm-Message-State: AOJu0Yx0X4kHuM7PuTUc7ug/Bch3BdYKEeLzcrh9KFsVbesKzKagxtHW 0W7qrroCseXvxK/fXiEmKblk92MWnwOokJehPN1onRsqS2qYCy3bXBndWPlKPg== X-Google-Smtp-Source: AGHT+IExc3kiGm+hEFRw+kQDfViul4woHzF6WRs96subTZ4c8qoJuWqvczLaOhJGq/Hyw06BNYyVfg== X-Received: by 2002:a05:620a:3182:b0:78e:dcc4:339e with SMTP id bi2-20020a05620a318200b0078edcc4339emr7592795qkb.11.1713209700585; Mon, 15 Apr 2024 12:35:00 -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.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:00 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:46 +0000 Subject: [PATCH 29/35] media: i2c: rdacm20: Refator return path Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-29-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/i2c/rdacm20.c:363:12-13: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/rdacm20.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c index b4647bda8c21..b40d40b0cdd4 100644 --- a/drivers/media/i2c/rdacm20.c +++ b/drivers/media/i2c/rdacm20.c @@ -360,7 +360,10 @@ static int __ov10635_write(struct rdacm20_device *dev, u16 reg, u8 val) dev_dbg(dev->dev, "%s(0x%04x, 0x%02x)\n", __func__, reg, val); ret = i2c_master_send(dev->sensor, buf, 3); - return ret < 0 ? ret : 0; + + if (ret < 0) + return ret; + return 0; } static int ov10635_write(struct rdacm20_device *dev, u16 reg, u8 val)