Message ID | 20240429-fix-cocci-v3-17-3c4865f5a4b0@chromium.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 D12B0C4345F for <linux-arm-kernel@archiver.kernel.org>; Mon, 29 Apr 2024 15:11:00 +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=vG41rBZZsIFkdSUB79oMdfVs3cT0pumyJSVFXwHoZfI=; b=sNwPuL4cYNiW9u wH3oBp1AOOf5wrWCbxUIEEPT5fvj0XnfKa35InFpInBpOr1KSUYSXE+VrCxeZf25EXXla8X1OZaKs xdoKVPKVQmu94qlQYsF/5OPICTjPqlDnTUk/TWx0fQUUHVtoXiXQeXyU0zXWVT0wZ4ms3eSbLVCdq n10tfg/NaAhWTuV3FbEaXDWdgIp4muN29BtEIpEHdw6Daas7rPKWLDVD9j2lvA1Kj1dztha5Mkx4C sGfvmO4y7sX+QsCl1ZizrCWZWSr272kapaQYphuTbfOn85N5cm00F2lZpCLxCpcF4iVrcT2VsYAe0 Fpmmo/ijz5F4gITpPpvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1SeT-00000003JJR-2e87; Mon, 29 Apr 2024 15:10:45 +0000 Received: from mail-qk1-f179.google.com ([209.85.222.179]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1SYz-00000003FVT-2hmE for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 15:05:07 +0000 Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-790605809cbso420848685a.3 for <linux-arm-kernel@lists.infradead.org>; Mon, 29 Apr 2024 08:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714403101; x=1715007901; 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=7GlL3qsiOGQC7mYG6gX2GhOJ6HGHUo3zfWR8UxyLbWA=; b=VME8VIoSoiLpw6IhEMqkpbFxoiEftCP2EuQRw22vQF3KA8Tg5/dMyxqOknyncOVukB n8oDpSEYPAJS24Bl/AaJyu/k06pQk6Is4zb1M4aRgwbZh5zz7zryU17CruZxP0kamokZ dVER+RWTJY1mWFJsft8DRuHMVKU3aBfFU7IVM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714403101; x=1715007901; 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=7GlL3qsiOGQC7mYG6gX2GhOJ6HGHUo3zfWR8UxyLbWA=; b=EQhGrkUry0J9ItVB8lVZDUy0e4XOGFRc4aYa3btmcYf6rKCVoH3rCO99pGBVNWm8ra V0d0Iy4qmlL+uty2MwtLnSdpfh9S8wVCEOb2Eap6cv7wkfBjmTKws+nzfP4WNcmKcyaN 0QPPkX9PpM+dCKZu/1HmolSgreUx/DiwulCBuOWa7PVYasXGVS3PtDHg8My9Nw98gYRA 0yYGCp0EZvINJtFC46Lw41B2yP3qT9O2wg0xe/twtGuMLSFN3Us8/hXZel+52gRHzqup HD/b8EsoSE3DBu/uLbLFK6HIRmX4e9bea+GPwz/qqw3Xd5Y21A+k3G3J1PbuPUOoQnly WVyw== X-Forwarded-Encrypted: i=1; AJvYcCVGLftQ6BZIKfj7UKN8MByB5KHC+eQhxyM5uk1PlOH6+jvJphyq3drK415ther7XqAgcUUpjuIbKeu2TLcJT1izVLwqjJGQCj6UJUwb+CWxWNJIGzI= X-Gm-Message-State: AOJu0YzNp05WWjTDPZHvSKNuzY89jO1VPVCn3OflsZPbQhu6yJTMnMPY QoPcdAjFLbUYxaEHDcig0HW4PQLFXFHQ5yGdNYzW91bRQ0TTkuX/G7H5KBYrWQ== X-Google-Smtp-Source: AGHT+IHEbQ6k/spB/F4rjxeKOljXK5qMBOo6nR8m19hLRAfwF8PZ7AqOGD/HUUCFVnU+KrmkTId48g== X-Received: by 2002:a05:620a:28c5:b0:790:ed33:5b91 with SMTP id l5-20020a05620a28c500b00790ed335b91mr5568169qkp.56.1714403100578; Mon, 29 Apr 2024 08:05:00 -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 p7-20020a05620a056700b0078d3b9139edsm10568591qkp.97.2024.04.29.08.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:05:00 -0700 (PDT) From: Ricardo Ribalda <ribalda@chromium.org> Date: Mon, 29 Apr 2024 15:04:56 +0000 Subject: [PATCH v3 17/26] media: flexcop-usb: Use min macro MIME-Version: 1.0 Message-Id: <20240429-fix-cocci-v3-17-3c4865f5a4b0@chromium.org> References: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> In-Reply-To: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> To: Martin Tuma <martin.tuma@digiteqautomotive.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Hugues Fruchet <hugues.fruchet@foss.st.com>, Alain Volmat <alain.volmat@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Sakari Ailus <sakari.ailus@linux.intel.com>, Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com>, Sowjanya Komatineni <skomatineni@nvidia.com>, Luca Ceresoli <luca.ceresoli@bootlin.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Hans Verkuil <hverkuil@xs4all.nl>, Sergey Kozlov <serjk@netup.ru>, Abylay Ospan <aospan@netup.ru>, Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>, Dmitry Osipenko <digetx@gmail.com>, Benjamin Mugnier <benjamin.mugnier@foss.st.com>, Sylvain Petinot <sylvain.petinot@foss.st.com>, Stanimir Varbanov <stanimir.k.varbanov@gmail.com>, Vikash Garodia <quic_vgarodia@quicinc.com>, Bryan O'Donoghue <bryan.odonoghue@linaro.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org> 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 <ribalda@chromium.org> X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_080505_796468_DE01FFE2 X-CRM114-Status: GOOD ( 11.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
media: Fix coccinelle warning/errors
|
expand
|
diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c index 43dd3c932a85..90f1aea99dac 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));
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 <ribalda@chromium.org> --- drivers/media/usb/b2c2/flexcop-usb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)