From patchwork Mon Apr 15 19:34:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F114C4345F for ; Mon, 15 Apr 2024 19:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6vToNhB+BqMhMGqLzBZOxrdVoOavY3DQnWM/yqkjnsM=; b=XqcrNm7FiSrfHr Wj6qqQu+Pqk4CPwR7NlG2/aKpymZDcchYPf/H2KLJvbRzOE1qCeTrFLqsHnVYlHyc5RNOzOvrLRP3 +GAlNGRZN+Pm+1iYKMOZxdGHPHQmYyc5pFpD7wSP9GNA457mAQk/tDAGdusUojOhWBf7ntm9JB/ig EHVmRGkLVNhX3Qg6dyLaHor+5zXChCI/KobuCBktDFDKiggFcS+QJI/aBpjCX36XPKex8wAbx/gY7 exTuiREfS4eeajxyGDDDpURXt0URHYw1uP/U66asUD0qEkYN/4KHizrW1m4kJoXlL/cu82pl0eub7 ig9yB4ukJ/suKwIopYBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS7Q-00000009cq8-3OAS; Mon, 15 Apr 2024 19:35:56 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6E-00000009byu-3F8Y for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=30a1609TFHVDYvbsiCwVx5jyS7S7qnpRfAGqZPi3zic=; b=BvB1KLSEPP3HD0hAGF1hlODJ2q gIVXK7cyalUDbY0NwsiY7c0Yb/DvZKiU6j5OU/6Lxf5Z/iAFh8wlyPzQKP6QVR8crJc5Uj9+8Rqlx +SNxG0WMbFZ9s4KW20EF3zUI66LaECXkJdLLPmil/y3s07lHDUjGY3esn7b9IM6RWTtUDA+T15qeC faEXG35crlACLfmkuPvNHbKFU6s6WbRrKOHLZ3WMWFM6T6ElYwJ6i4CwLkAGZQzAQSOrkEeeeyncb C0rjIMuUt89uKfIH2kAuabv2opQCe2FRR29Cbe9tpa4BT5yCQlzx1zqqDNWAls++60lS8TZZtUDKd 54phgm/Q==; Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS67-0000000AieV-0hLw for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:37 +0000 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6eb797e10ceso1201261a34.1 for ; Mon, 15 Apr 2024 12:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209672; x=1713814472; darn=lists.infradead.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=ikth4y38JiQWoY5y/3HuiOVTJOt466W4Ns+6/KC9aWf+jtNhY2RhFrMJ0X2R287d9N nn6PNc7wMa1T35NvydIRUlv3wnuz4R3Sn8JTMhpeP4yc4teFB802m3i3HfUJK89CoOvY rHYVDwJFWWIk2Sf6j+38mlPnRIx4swiUk14Yo= 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=pWCeZwVGBDh7DHlVFUN+95ceB099N/rtWBp1Ybe7n3W6oH/cXsi0MoASRxxXJX+ek1 l7hsEfVXXm03qHlQEviJB1i8V/SpQSsQkgPnQCpFZkgO/JvzZipI9HhWMIyk8ea1hz4o YknbmqLJYa7XO0Lq2KON8BQUfOgLAP/FDtTCcObrJDZ2CdouOyHDeJK4NpNa4CYVqMbk 5xbGMQsJnlUida5cLrP0DrB9UemP7Uv/dNJIorwd5MLirJWzkaopJGtMEyUeHT59ebwv IcAnIuy3k0LT+yeL3ZtDxxPXReUrSk+HAO6wqHoLKX6GI+KDfq6s2IVI0OOYHv7Y1Fkg mpJw== X-Forwarded-Encrypted: i=1; AJvYcCX/mlPYBvJ8yzIaVPrtUlaP7wsSZkzJsVuNuS7PfSWFlr+K3OOHvFYIgAAKxGKThR3yn46Kn+N/C8q792p3mboQ06YS2R34uNYl2SD8PvBEQ7Qzq6o= X-Gm-Message-State: AOJu0Yz4UI+srQhDkh5fu5c+tKsGIc3DLKx3C8QuPMJxLhiUlb+rhndf 5KDPis6ksrQucXWt+PNtl4NsVa/H23T2XXb5+axdy9LYMs8eNyBEL0MpsazGNQ== X-Google-Smtp-Source: AGHT+IFajy4caV38o9egD00xBm8+r7fFdvax0FnbVE1biamOQ+jag9WqCsqV4RWMv5Us6Un2NRlLiw== 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 MIME-Version: 1.0 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?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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203435_948576_502B905D X-CRM114-Status: GOOD ( 12.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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,