Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1650083lqp; Mon, 15 Apr 2024 12:37:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUeh8KVYN9nc5obn6E26p4Y55XGo8wl1+P8gB3BgkUCNavSlyDMGf423c9v863w/le9oo4ITfp8oVUZjg5IBHBCwNLV0Wg8pBGnWPldPg== X-Google-Smtp-Source: AGHT+IHXvSLAMeeIpoVHtvwJCuy9x2Gjkc2ZdENDRtiEih15QECPSfxdt424nrWubFeY6ygjfdjw X-Received: by 2002:a5b:78a:0:b0:dd0:39a0:a998 with SMTP id b10-20020a5b078a000000b00dd039a0a998mr9620195ybq.6.1713209844515; Mon, 15 Apr 2024 12:37:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713209843; cv=pass; d=google.com; s=arc-20160816; b=txKvak3WIBz3JTUgqeQaVUZhfCeOWkBTxLqjtClg1PMNvjzjS7RixoOcFF+A0ktnxf zbqKAlGeD433vWbu2vhZUUYHguQVhR4Fv+pBrAM/eF8yjsSI76WiSrPsszHs4apoPUkT zqBALFBCA0PPRaLU/gK52AIjkS4IJWAGDPwluU3IsXrwftQOeBSRYmclmO5Kk08jdXwz QK3n6VpxcPed/Rr0a8DmO+q+XR8UnJphkbJaWfdGIILy2RsDI+pIMnjTo2ehRTBCuB3q WMmxbShfKo2t8eM6y/U5Wpcj8z+ioE8VP6N0Y+Qh4bFWqrafS75NHmS8qyFoFOEhWkr5 V5gw== 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=30a1609TFHVDYvbsiCwVx5jyS7S7qnpRfAGqZPi3zic=; fh=rTFunIxj/Vk+SbMA+J82l3r2e+Prj7tQS2u1BuGze0A=; b=PweFOCYU9DYKtuqO+3qpEtPRIV0/EE0BscFKiSCy8Z1nNWMH3DPxmLSVDrI9BLyPkh 8s9DC+hxcQfWGH6ycPe2ecSH7TBJ2belpe1luzLGilTZxn2d0D3Gwy0thFlyg012sZGr 9Fj1J14sHfMCMIVlH2HUvPK3Yv4yMk+4n2HYz1QDayj2cWJY3upQGX/cPi1cQzde2UCv n91OE6lsGOTXXLnnIISkHmzIMHdw9RatiNtGpwUlUtgYjRD4/D1tbNq4yZ5u+YfcSyYz FOX6p8w3o6fQ3WdwCp7LQme6OisqsOoeMRvPAGu5U6SM2rYiLkrAgVCJT5a9VgoIc0Cf hk7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KAGuS3tW; 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-145785-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145785-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z16-20020a0cd790000000b0069b51b28a8esi9337961qvi.149.2024.04.15.12.37.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:37:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145785-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KAGuS3tW; 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-145785-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145785-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7C55E1C232FD for ; Mon, 15 Apr 2024 19:37:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E09F215A489; Mon, 15 Apr 2024 19:34:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KAGuS3tW" Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 26A0C1598F5 for ; Mon, 15 Apr 2024 19:34:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209675; cv=none; b=UWt7m7S50+R0OcKbeEO8b3WRrA/wi6OaWizJLXMZKIU5hhWt52wl2oHwNh39fJXIzZDnQDFGOZvj+wiChMhqAEgVwvp9bKuZOIJSRlxkBe0wX5rlyiNYKxnf/jRH3jIR6phglX8nYk8Zw29cNc99wk2/fTiqZ59W61x2h9aWC2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209675; c=relaxed/simple; bh=MbsdVQbCUWEGseggQJElQClzRok+A7X+zU8VpB5HgWY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UZJGZuYwjjLmq9alUPrmWAfg578kSWRZbTdhH/oGrtoNo9iv9730LPNalQ/P97SvaWYPsfHeSo/1zr3isxBOyViiTjtjSRiq0FlLG7yVQ48E4Okelb5vhus7qjoZsAyGqBACqc69bKpMFllaqReGfZihkvohhRe3AI+fvd7w8qs= 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=KAGuS3tW; arc=none smtp.client-ip=209.85.210.44 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-f44.google.com with SMTP id 46e09a7af769-6eb848b5a2eso564665a34.3 for ; Mon, 15 Apr 2024 12:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209672; x=1713814472; 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=30a1609TFHVDYvbsiCwVx5jyS7S7qnpRfAGqZPi3zic=; b=KAGuS3tWCioKwaL4Veddi+f+nmt9O+ydZxCzOVHCtWE680n4ncHcBVba6K2jJWC+8i c420YEitDUOvtoJyOfc+PMWsYShnlihUavtt020b8oZeST+9yHpPnKQqCORD44KhhaG8 QOlB/BvNEV82iE7HgvghN8LqjQtVnipAwmIlg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209672; x=1713814472; 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=30a1609TFHVDYvbsiCwVx5jyS7S7qnpRfAGqZPi3zic=; b=PhB97rswjNp/ITcquZGSaEASC5lP7fVcdTBwWi2lxlNXjdvTA5snkLEHYx8WKhMCS/ M3MpzynlnmsZxumEexzVQzB4V52fWhhM5bj8+E+uneujoxxEoNtJYM83UHkrTjsFHwIo Qp2BvsrkvSSOmhTeP4eK4GHXIAgAP4fsQnpGJelQey82PcmYdwN1d72SgmoUDUVrAs2m EyzHInCovGpQnuTSmDrDKLzClekeRO61VahjDANA3mc/38XpWhAzQ0sSizmKMg7+lCWy IBK1nG0Md2WUCbzV7zERkbIOT429nikisodJsdHN2LmGI0cpQsBIfVLUavJu9ESFYjwH kJpA== X-Forwarded-Encrypted: i=1; AJvYcCX4BLV+1JKM6NvZo79rnWjH2xC4CYQycJCYPfo6yDr3vve4q8JG2tHMIBxx46gc03q7QJsUDqbO/6qBw5JTpPJcnilZoQ+YE+SqfvOX X-Gm-Message-State: AOJu0Yz4ALQdQMnf9DjuNy0hivn+BpROGQp4FH7PNt2Lc2dswjSfyj7g wWuadol4LzcbVy8/hUiiaezfDfW1o5LaTtVplLxCKk5R0xm0ZiYQb+JcwjPMJw== X-Received: by 2002:a05:6830:14cf:b0:6eb:7a07:8746 with SMTP id t15-20020a05683014cf00b006eb7a078746mr5458830otq.31.1713209672276; Mon, 15 Apr 2024 12:34:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:31 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:22 +0000 Subject: [PATCH 05/35] media: go7007: Use min and max macros 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-5-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 It makes the code simpler and cocci happier: drivers/media/usb/go7007/go7007-fw.c:1292:14-15: WARNING opportunity for max() drivers/media/usb/go7007/go7007-fw.c:1293:14-15: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/go7007/go7007-fw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/go7007/go7007-fw.c b/drivers/media/usb/go7007/go7007-fw.c index 018019ba47d4..86ce593e0c54 100644 --- a/drivers/media/usb/go7007/go7007-fw.c +++ b/drivers/media/usb/go7007/go7007-fw.c @@ -1289,8 +1289,8 @@ static int avsync_to_package(struct go7007 *go, __le16 *code, int space) 0xbf99, (u16)((-adjratio) >> 16), 0xbf92, 0, 0xbf93, 0, - 0xbff4, f1 > f2 ? f1 : f2, - 0xbff5, f1 < f2 ? f1 : f2, + 0xbff4, max(f1, f2), + 0xbff5, min(f1, f2), 0xbff6, f1 < f2 ? ratio : ratio + 1, 0xbff7, f1 > f2 ? ratio : ratio + 1, 0xbff8, 0, -- 2.44.0.683.g7961c838ac-goog