Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp521618lqt; Fri, 19 Apr 2024 02:54:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1d1RDm5b1ml5UPiKwBHklu6EXtia3TRQg7k+1PhcdayF/r69R8Z8zhuqwFsBWQZ3lq6enYiFATmU5rLwQXUbu6QYydFNnXNBGYPJysg== X-Google-Smtp-Source: AGHT+IHcMoXpzup5V+vC42YWCjuM9pl1dKAqps05FVwZp353/DctSzw5rfgTXMrzOrvlKbLMCBQR X-Received: by 2002:a17:906:855:b0:a52:5a6c:a359 with SMTP id f21-20020a170906085500b00a525a6ca359mr1089959ejd.63.1713520489421; Fri, 19 Apr 2024 02:54:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713520489; cv=pass; d=google.com; s=arc-20160816; b=VYd7dB9Gv5wjiwn560p00mP7Qpxh22ScftHttsNjdd29kdlup0ekLsVdSS8dhIf9Eo 8no2NymtSijVjK9aRyPD830E7moHgDFdG96SeqBxuyrjB+Nh9e7QiMXXaCz+2wOuHt59 vzMbCwDrcRPjeSMWmlJu9QV8KBto1EJdOpzdyNRR/aiYFEKta4saDaeAqUrlMljciRCr FSLBHrKWmyue9cl9KEniFaK4gzCRJNFZNu6L6e+r/pEW3nRJOK4wCDBjG4L126XvUrbV PbHKycfrcMPieNDxqJzNaYZ4ESC2cxo+gqhuKh8CL2E3DoreSP/ggbAtiG831VLs3k4P IBaQ== 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=ejR4SFor1DGbZO07N+L+RxXvAXTkN+sOOOYtcWWVXb0=; fh=AxpbDCnW/AvGjJ8YUPqEImdZkp42Xn48rsQ4QjkLt5c=; b=jf0C30yUWZNptaqJl7hKF6ueK64bBfYZpWFYJliF4jqTL0O1Vz/OM4YUTQ2vhZEHlR YFGvRF7JO8H2XySlRgNWtcqdNGWJZ2O5On0Om0aQ84Bx4XZovWbyL6Nm8TpLpn45O7KW SfQX1IhQlohOqB+dL07tsaolVNbfhU/BdOfCQyMA2JEzMTvGXkbZL7hoXV+apA4H3qNv 5JX0ldk9OJ0wYQ95aO74aivNPJjySlLohXSj4gFiqWKqcuGn9gRjdWcmaJemougmxgUv RVOfytCdLlCwqTFMHR5B4sSCnjin3lLVvRdP5XSbuwC1jGS1gW0kdYUrbSdZvuW14/UD MbBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j+kwBRlZ; 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-151265-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151265-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id br18-20020a170906d15200b00a51e060818asi1999041ejb.595.2024.04.19.02.54.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:54:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151265-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j+kwBRlZ; 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-151265-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151265-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 am.mirrors.kernel.org (Postfix) with ESMTPS id F2CFC1F2145B 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 9BD4F12FB18; 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="j+kwBRlZ" Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 1EE5612D76F for ; Fri, 19 Apr 2024 09:49:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520183; cv=none; b=mH4GqYtKAx7ldoEwtMdsM5lJO7rMeNbWhY+oWmg7PB2rPJTfE176CAtaa4h6VXywSB/zE2NGT2qTMucCQ2uAFRX4+4OI0KMd8hETZEYOJcDypmzXaveqLYz65zEhtlnpnOTej80CvIwhbl5ie6FausaZJoPjq9XMP9M6CycK150= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520183; c=relaxed/simple; bh=eTdkYl0bkVdX9TmC/TdAsDLTwgelc7ol4/8WiAm6VoE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eKOu1EkCOkssJfiwKCzPbrxzV0aN+WxYNVuN9DNNnah32yjdQiwO/KQL5oqp0uYEvdBrBf/PqSrUmdazmcpU7zzac+7b6edvOU6JdLBqzgFxH/XiSQ2BzM2Z+KRX8K+naxAjZBFiQBr1rXytL07vRHVPGfR0iwY2m+fEOXCea60= 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=j+kwBRlZ; arc=none smtp.client-ip=209.85.222.170 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-f170.google.com with SMTP id af79cd13be357-78f11d7f64aso66341685a.2 for ; Fri, 19 Apr 2024 02:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520179; x=1714124979; 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=ejR4SFor1DGbZO07N+L+RxXvAXTkN+sOOOYtcWWVXb0=; b=j+kwBRlZb+eJY/EuKZi2TV8X/8NGiGj4nfykSzjOe9h5gS903Rg6RzlVJ/h8esAs2P Aja9shrY2os1M3dHCea/LBVl8ClpvLtetwc4eRhIyDspod6RhaI+hs0Xv8qoCWXCaUWJ 7uJGIvzlHY5pWmfYpgClWYom9+uMZcg5+r/0s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520179; x=1714124979; 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=ejR4SFor1DGbZO07N+L+RxXvAXTkN+sOOOYtcWWVXb0=; b=TjiGltgrx4/P/iPPY8KF92HR+dYiFNDvkpwUbFMWGv8sUuqqjo3PGXL6vk+0DnkbbL 33uW57EX1wM4tUajyWu0cq7i51Vu4uHirVN1sb+22YZxgc19Y1j0drOzIj0DbcbR+lFz orrBDIHPkok4mSER26XLfqS93kyi2oQbMTlwgruv9s361XPmE0vbCvzT71Rprw4GptZj DH3WKBdAdBD3MnJsQAoYU3Q5Rj8FQ8Inmc7ybKk1QRW4TG0GfcKEZTe6Nop+twHGiyMZ D8Qm4oK2Y9/vtVb33+0zLG4LFDinGROYvuiNxhDlrkU/0Fx2GOzUgrEOl72W9nYbVTQS VDDg== X-Forwarded-Encrypted: i=1; AJvYcCUqVHZ6HgyT9DT6FgGaC4IMKfZF66k2yqzZ+Ag3mTaMCaGb8wWmmiWBMQWYqt5tglcOz4O3iXccMDkiWhBfpUYCQJudUbIuPFzQJTXJ X-Gm-Message-State: AOJu0YxjwaQZIFVFYh6W/q4mqjO4MnjyTQKJmGBggYH9Lca7q00EaWY4 By4Wz8YdCEnNWXM3wVz7UyLkF6SdXQZqOBW/LALpKAZg97leHiyw2+FGz/VF3w== X-Received: by 2002:a05:620a:d94:b0:78e:fe1b:a601 with SMTP id q20-20020a05620a0d9400b0078efe1ba601mr2205140qkl.0.1713520179012; Fri, 19 Apr 2024 02:49:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:38 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:48:03 +0000 Subject: [PATCH v2 17/26] media: flexcop-usb: 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-17-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/b2c2/flexcop-usb.c:201:8-9: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/b2c2/flexcop-usb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c index 790787f0eba8..3ba6a5ed7167 100644 --- a/drivers/media/usb/b2c2/flexcop-usb.c +++ b/drivers/media/usb/b2c2/flexcop-usb.c @@ -197,10 +197,7 @@ static int flexcop_usb_memory_req(struct flexcop_usb *fc_usb, return -EINVAL; } for (i = 0; i < len;) { - pagechunk = - wMax < bytes_left_to_read_on_page(addr, len) ? - wMax : - bytes_left_to_read_on_page(addr, len); + pagechunk = min(wMax, bytes_left_to_read_on_page(addr, len)); deb_info("%x\n", (addr & V8_MEMORY_PAGE_MASK) | (V8_MEMORY_EXTENDED*extended)); -- 2.44.0.769.g3c40516874-goog