Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1652210lqp; Mon, 15 Apr 2024 12:41:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUrYb0XpWCFRpYNuQSIhD3j+FEuxl4pUUQum9zCO6LlaYo2MrgjxCU56FjXFltcwicgPEWz85rpFgaD19KeLgFPyRLHNXfbLNOHgx3hfQ== X-Google-Smtp-Source: AGHT+IHZzkabf4ZHlDLofglUWHKdjpnaaFDfNucULZFucHGM6EpPuC00+f0jS5fVROYercNnd5GM X-Received: by 2002:a17:90a:4888:b0:2a2:c40a:1a5 with SMTP id b8-20020a17090a488800b002a2c40a01a5mr38958pjh.12.1713210099169; Mon, 15 Apr 2024 12:41:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713210099; cv=pass; d=google.com; s=arc-20160816; b=ZgmmGbOnGNqOjAW5ssdKQFwPsCp8pdoTjPwoVaucIJ/nuhYO5+Oy6LImTcoxV5m14j 2xXm0IzQ8kfv/BEXk6uUSgaVohfZF38gLm8Pg4MGTqHsHKCw4+RLHtJt2duP8vc+UEUj mduJfXEsV2imU4uDsIkqiQQ9SODx4N5CEz7/6YEf/F+RN7hTmARxgn6xP5ktsr7MeNoP Dmzki0S8u21vLmPfg54JCdZnoEIfhm3FsSE98Pq0pCjrVRMKrAKNW/9huVkHICIvZjQQ PZxuSFzaKXTQOYgRcnenWmNO2ufEAV6AbK45xCrdkAfRCO/Td798T/wS5skRjUQEpfKo 2/wQ== 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=Ysx9uvN3ilBy5tFwit8pBZpHwFo890jKkO1ecScbT94=; fh=4JApZhrt/e1N1NxBQA5ADoaJZDH6seMzWS8QwH7/JzA=; b=lbv7IlvSgnyiZC3GyFEJXz38gyEQhK0JzBBozVqq9OkKoEPzWx7kXMD8KhYW5d2I58 KWJ4xshTWT59VW+c2ZqW5UBFY6XpQe+jASDzimBh7eQCxjBwuaKwOnisOBIAd3I+ttNs nYEr1tSSdomGCk5ACIQv/+B4PGIiwMuyeOPAooU2OeMyW1F4qKKFs3ulS+891S8B6uP+ i96xhXjtQK+vnmNPENFdpobQH9rbgvLpWEb+0M8/eRnKoghBggMEv7wx91T+xyL56mIK 0lsa9tbvm++O+9owPN5gp159mVsdqDB5II01od+VHprZOb2nl3tddBZm8IoE38p4FDeL jhQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VlK4eAu1; 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-145799-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q12-20020a17090a2dcc00b002a609d46f35si9135070pjm.185.2024.04.15.12.41.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:41:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145799-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VlK4eAu1; 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-145799-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145799-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D8020280C55 for ; Mon, 15 Apr 2024 19:41:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D55115FA6B; Mon, 15 Apr 2024 19:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VlK4eAu1" Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 D864615ECCC for ; Mon, 15 Apr 2024 19:34:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209692; cv=none; b=kSH8tUtmIQhvDebXKDNZImwyAaZuwSti+5BlFfVOprTAW2EWnJe223dpJbWMHJIKh/8hY2Y+y//MztwEBuJdx0QV23VkNGgmNbz0nbtMDDgLR0dt3F001jas6ykTGvRXdC7a/GpCIlyVNe5hW2+NfZ3XPtCvF5gPS6ttvonRP+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209692; c=relaxed/simple; bh=5czmFQc+cySSmdxDIBdAfSO4i/5SM7lXKFqgjNNlUHc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CV2EPyFtRF7erPjoog+brM7NsETH2Sk/zgkZ1vGOQVmXQ9PbFY+6rm8AR0HAsdPHE463bR0uOjpXa9+1qj6Ih95x5Ape5T3xeMzhUy8ryvQav+QOr9q4RJXFn2ot/WWBwfNEduowbiclN1TjURIfV/hTf6oK4xtO3mJXFQX/qa8= 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=VlK4eAu1; arc=none smtp.client-ip=209.85.222.173 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-qk1-f173.google.com with SMTP id af79cd13be357-78ec78c4fceso238123485a.0 for ; Mon, 15 Apr 2024 12:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209689; x=1713814489; 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=Ysx9uvN3ilBy5tFwit8pBZpHwFo890jKkO1ecScbT94=; b=VlK4eAu1xaAleMT9II1HWWvXSgPJzwK+IEdWiFxUSYyZ944gN+oW4nNkSIeCH9jGaK xYMfTNibu9o2aQBGrHSCEQEbkc9EOSaGPI0/fReGB5q2Om0bIN+Ij2R4TIhvmacCYU82 7ZgugIkr1CbM7m1XA+0al7/zv1TEwQakBIJQM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209689; x=1713814489; 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=Ysx9uvN3ilBy5tFwit8pBZpHwFo890jKkO1ecScbT94=; b=vYqou11drtZtENcYrrHgPuyvc19HC3DQ+1P65CwsP7oGus6gNEiCpq79hFy+Rs5+bm OzYoDthxz05BXrEKjTmDqIEiOOH/lkudRn42eLLzlgNQzjad2qRP0KuGUkY23K+Vqnm3 F5dGQCNAwpJaor43yuSqiay2QEst/ZF+Dkojhi5S4NXmetZs6cXdC0XQdyCXLt9InZ7Z 7RX303RIBnRe0Cpu5YqolNbZHCi4QiBvnJnk6GRPbvs5ypXXFrRDDQy90mG5tE3qEr/d M6RQx3kPg06ijOLrAkrEvC6NKhPmUd/NQJXM6VaTsMK0iIUrAIVPAKq5kx/U9AK8ZujQ HPSA== X-Forwarded-Encrypted: i=1; AJvYcCU+OAIBm8JYH3tfQ22moI9LotetVIQJGu7H0vYHEfbNAKgtTOhy9oOmKgRaoFVunURnE2PUgwJGKMQP57FjkrhEzWCwXtbsuNXHnOcU X-Gm-Message-State: AOJu0Yy6QKndHAl6cpVlJaVka5o6W1/4yVduar7Y9UjfF/nsBj3J/u9l ZBX3Nz6xDPrcOfl31ePggT3WMD+G/t488JprZgW4b3VhLw3Roy48y4UWV+0L0Q== X-Received: by 2002:a37:c244:0:b0:78e:f0d6:3ac0 with SMTP id j4-20020a37c244000000b0078ef0d63ac0mr1060376qkm.31.1713209688866; Mon, 15 Apr 2024 12:34:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:48 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:35 +0000 Subject: [PATCH 18/35] media: gspca: cpia1: Use min macro 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-18-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 Simplifies the code. Found by cocci: drivers/media/usb/gspca/cpia1.c:607:30-31: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/gspca/cpia1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c index 5f5fa851ca64..14aaf36cde6e 100644 --- a/drivers/media/usb/gspca/cpia1.c +++ b/drivers/media/usb/gspca/cpia1.c @@ -604,10 +604,8 @@ static int find_over_exposure(int brightness) MaxAllowableOverExposure = FLICKER_MAX_EXPOSURE - brightness - FLICKER_BRIGHTNESS_CONSTANT; - if (MaxAllowableOverExposure < FLICKER_ALLOWABLE_OVER_EXPOSURE) - OverExposure = MaxAllowableOverExposure; - else - OverExposure = FLICKER_ALLOWABLE_OVER_EXPOSURE; + OverExposure = min(MaxAllowableOverExposure, + FLICKER_ALLOWABLE_OVER_EXPOSURE); return OverExposure; } -- 2.44.0.683.g7961c838ac-goog