From patchwork Fri Apr 19 09:47:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13636063 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 E6D3DC4345F for ; Fri, 19 Apr 2024 09:51:39 +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=5QNcFU1KFPNy1+BZGmhPhjA1YqpPHwQL6m6TUaLCcYA=; b=DH0LWIYvW7TYLj xd4ifDlIq9QkLjbKP3llR4hwDv9xUizBThLLjkiSul9fu+VzSqZd/3+2hGAfuufRjJmybiY7Lisc7 pP3rbTWZPjpCy1VtL2Y4/nYHBq4Fk+ok+R+Gek+YS7+a+tCNrzas6hb2mqAsIVe91ZDlqYqxIsP+I kw4FDaRnADN0m8asjP5jRIBFE0jijROnaf0mDCV44wYyM9aFAkiiKv28+CYyXE6oAgYa+sFu8pJ8C bouG8BlNUDQ/67TwlHRWrvotxlS7yFK+AJwnrzIBmpoCaCCQLRXT43+Y6wJKcA8KNLBWGM/I7i98Y s1ZSS2Ma9khXhvaLFg7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxktv-00000005A3b-38ly; Fri, 19 Apr 2024 09:51:23 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxksC-000000058se-06GL for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2024 09:49:40 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-78f05aec21cso124222885a.0 for ; Fri, 19 Apr 2024 02:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520166; x=1714124966; 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=r6LFW19gEC+T0JWPpzdeGsrE8gqRTr2t8fOHXzLwHuc=; b=e+7PDr9S2S7tmhp4QiXhYYy3Etun+hBg8R3COzxeVc9FSwKOpsS/aOsM4UnN1Wrn5p +bWJWvLv8KuKr/k2ARkMjErumQ5XLXwmXdumqaWltmtGNxP8AQ1JiKa6N6OYJENe6SsD 5bfd0fS8yh2MzzXTETTBqv8p+5NLNyLpsDxKM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520166; x=1714124966; 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=r6LFW19gEC+T0JWPpzdeGsrE8gqRTr2t8fOHXzLwHuc=; b=PSnsM2c1AsJHs7bRRZCmMuV+ok93zx3iXeMH430PbsnCG1QNs0Jc4WEZQbNq5rX7OX 2cp8KxInw88Imz5l8M3l1XJPRrjo7Cnwnu0JvM0MZgJ6IqrCDmcSpi8TvNuSH9cpZ5MW gD+3CTSwhftkk4Uh5Xj6XufLECvWSu9xWWGmwqHP5bJ/aMUW14Ij9wnrZ4E1USqDGWnr tO9JWbIq2oe0P16aZfAaJjxJ1g773QS2K96JNUGEu+7+MsSaFT4I7/z7fuSJo0JTNN5O K5CdNnIij/6MSL3Z9aJLZ0o19jAHbtsr1gHJPopsP6qfhQIennj4S/RxuIA4yyvfwteN OCTA== X-Forwarded-Encrypted: i=1; AJvYcCUi582/Usdy8Oaxa4gF3kUv6gZ+ceYoYJZJqMLVkP0ldA+hhs5w9hZ9WhQCCGolJPbhccXwIx9sV52JuQJjn6SUu5a/QIjXFL4NpthahQ8UaI+M+6I= X-Gm-Message-State: AOJu0YxsK8n3z6qBbu6OpIiTRTlAh+kc+Z+qlXeXxm2rznJz2IppqdVn Bo3jeC28t93K80KQCRFGXrW2QK+huK1XOPS3Vt+3bqGlwEYWtogJ+gGter8M6A== X-Google-Smtp-Source: AGHT+IHUtLmGGbi8XMjkj1WeDSrpOuo1PYSYaSFswG+8Ppa9nSbCTEFJOTOGzt08rmRjKE1fcvdYDA== X-Received: by 2002:a05:620a:4586:b0:78d:70c7:af with SMTP id bp6-20020a05620a458600b0078d70c700afmr2461486qkb.13.1713520166155; Fri, 19 Apr 2024 02:49:26 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:25 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:47:51 +0000 Subject: [PATCH v2 05/26] media: go7007: Use min and max macros MIME-Version: 1.0 Message-Id: <20240419-fix-cocci-v2-5-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240419_024936_229758_58F67923 X-CRM114-Status: GOOD ( 12.76 ) 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 Reviewed-by: Bryan O'Donoghue --- 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,