Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp521611lqt; Fri, 19 Apr 2024 02:54:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVt/tfSCGyriIWJCqcFaQUeIQav9YJFnTI21feViRlbl17Pr+rO3mpphgv3yGKa0BR3L1FmLpdQZWeqg52TvuDPtfJ7j3NFemK5vYVWiA== X-Google-Smtp-Source: AGHT+IFzDyNMnlzFqRQhqn3Uqcj33jgFgFTnUomN9H6qV9PYq/yHV+j3SWlTS/Y1NzPNjr2TF7t5 X-Received: by 2002:a05:6870:658f:b0:21f:9c60:dba8 with SMTP id fp15-20020a056870658f00b0021f9c60dba8mr1794911oab.4.1713520488632; Fri, 19 Apr 2024 02:54:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713520488; cv=pass; d=google.com; s=arc-20160816; b=zScPNAJcTJf8Iil+o4Pi9tJ7Usts7hLb1NU7E6Pf2gSLXN/nQdon3iOf1YDCU0o7NK qJNoIBsTghyZMyrf6ZDiDKwflYfOalJ4IH1+WH/jsEz3SyoN7fzwTfM9FmueJbJrIwRc +SG1jU88Xu8NHIXSeEfvD6YRkBBDhgulrMZ5IS74uyvjaOe2/D82AuuFywlH8+Cu5wdl UeGkeyqDK1/YvFHoEnd/O1EFMJT1gSVliGndgNtV9j6Y/DgS08OvWl0+dw8b2+/9k0gp 1byWzbeLI0RJJkyt/vRhYp2VBlst1cDKgdaX15Xf+OiEh63PKt/kTkvaUWZcs1WAiGEI F+GQ== 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=kyue/FRqn/p1WnqrFE53P+Zy+G2t8IVLierFxkwHoc8=; fh=azLZ/A6yxdFuN1naLK4mWZ4b7v7o6I2Ern/t4aRjt24=; b=rpkJZ2c3G4oG8LzXYR7gnGYWqTd08cYFk8+Ob/J6t6IB1Lobl563kGIqO7xxRj9U2D 7MrZuCN/qsuL/Sdlyf5EsIO6h8pyWlqJiGUwPz3tUBTfh2vLsZbn5hTkl0zXsX1TVyug PWGg2MqqXdwp93653ofnGFXmqZ/AbPx7YMJiKWdLHvHGbnS6WoofGGll2su1KzGnQR7B szQa3U8fFHeHEC6TaHzIn3a6CjxrKqFskBX2BXOI2Iwd6rTxaSjdYD3vp224VB+ClNXb 2Myl1Dx3OwYODAOpAC6+BBvzOEA9yPDB8chau/CH/kfyoJDTFY74Ebm/CIDdb3jBHCFB Mtyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WNLJHerg; 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-151264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151264-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 186-20020a6301c3000000b005d81875c4cfsi3000872pgb.882.2024.04.19.02.54.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WNLJHerg; 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-151264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151264-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 42A222833C3 for ; Fri, 19 Apr 2024 09:54:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9882A12EBD9; Fri, 19 Apr 2024 09:49:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WNLJHerg" Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (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 214F912E1D0 for ; Fri, 19 Apr 2024 09:49:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520183; cv=none; b=f95VMJCPWzTFVb+RCMED0l9FF5gP7vcB65hvsq0JOiVGdzqPCUyEglmAIbyd8/dD161iktsxEtmX7c+asj3jxatxUENSdXp9Kzw5iT/TrhbvMCOjk3TmpGRZ+co9FPhgHNmDujO6T6Q+U5yI/M/cAgsvEZ/QRSdc09+LehjnIj0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520183; c=relaxed/simple; bh=NKspkx+WjefJTC0T9GdQgMYdznykMk+osWwLYrp0b/0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aPTESX/wm82+DDM2pMm8aGF1A8nZTnwgBA/Sr0OkxPeT2M7WrEXsthyZcsYbq9QTbaWUq89xmVj3a7GwePhTVAxLgqCUeIXbBpgbX4PMGlUeLghCp6aV2D8PE+CMjjCK2tvAys36edwQMIpCWucq05/04BzW42d2FJ8NnabqRTs= 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=WNLJHerg; arc=none smtp.client-ip=209.85.167.179 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-oi1-f179.google.com with SMTP id 5614622812f47-3c7498041cfso214521b6e.2 for ; Fri, 19 Apr 2024 02:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520180; x=1714124980; 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=kyue/FRqn/p1WnqrFE53P+Zy+G2t8IVLierFxkwHoc8=; b=WNLJHergG4jf5eqFh2rWx6jI+rOt1DtUSc/ISRveU90rSBnKD7jyuXakScfJtX+TDZ Mo0BmIlt7llvLo2v77rfTRutXwzfd4/O4qx0XnBGG/R5KwUaRUVCJxKdPrMo+exznR09 6uVJOW1XejP2LW+oj7or293teBXtnRU0XUypo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520180; x=1714124980; 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=kyue/FRqn/p1WnqrFE53P+Zy+G2t8IVLierFxkwHoc8=; b=BYcYaUSup/xstQpT+LRBZGajnGIebL7ClT529lH549ZlVZ+xq3WgEWwdNWcc/V3y52 RC0lIxw0uKfMjJpq5nFa02V+v0aDa5w+vTsVriRe2g+eZTTdQA3NQu9mE3ABZohxyrIx GbqRjpEvt9jouoqmTKiAmc9dh1BoyyMSfa1+AlnpCuKOSAtXPLkmuhvqykH+/CT3k6pq NsJSF+Wr0rP7maysX0pKn7JzvVzacNWQiUP8ZfeLMBRl0sZ0R/mWYk3DKqt8IZl4B24J 7gzBzEC79mNdP9zhwQ2CgdvCk+8L0qkmuVGxY1l6RMmByvUyz22/28hyUHU62U/H8jJs VJVg== X-Forwarded-Encrypted: i=1; AJvYcCXPdvOAkOOy8Kl7hhZqw1jMnks5yuJaJobKVnFWU8wjXtg8X/VyG+cTs64ictRb1AnHPogV0g3sDoz6DdITexwditedA//YI7ivsyPv X-Gm-Message-State: AOJu0YxgE1n/5SEkKJqwF32zOTKMcdgvla8oTg7QtFmvYa0j1QAkUhYP ER8ioXhF2JpRCgPZig+2W5SavAIAR9OUDcb5x5jSAxomqfFG4lifU2NqN/Q8bg== X-Received: by 2002:a05:6808:60c:b0:3c6:f6c9:6bb6 with SMTP id y12-20020a056808060c00b003c6f6c96bb6mr1556563oih.41.1713520180310; Fri, 19 Apr 2024 02:49:40 -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 dt14-20020a05620a478e00b0078d735ca917sm1434532qkb.123.2024.04.19.02.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:39 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:48:04 +0000 Subject: [PATCH v2 18/26] 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: <20240419-fix-cocci-v2-18-2119e692309c@chromium.org> References: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> In-Reply-To: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , 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 , Benjamin Mugnier , Sylvain Petinot , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio 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.769.g3c40516874-goog