Message ID | 20240429-fix-cocci-v3-16-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 0E980C4345F for <linux-arm-kernel@archiver.kernel.org>; Mon, 29 Apr 2024 15:14:26 +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=abb11M8114OIWGtfTSUNZy/TSVJSWZvpLeA6HDz9Bic=; b=CV6DtJml/zlNt0 pU89LKaKspBd/R4yiUJ8CtUKhqkujRF5hVUMDMSW1LS8gEziGsYz/tErYpKiZLSCeiFNwN8ErgSiX 7l7nhu4Wilro+eRRH+imYxsVgBNNjeWEzCeuR6LpVvcaT6u+sfsuackXHc7UKowFWy4DOLXH1xVMf Xrc+Z9xI0zC1kZrar/sod7n595FR1iLvfr/pYZZy8ziDLLA/JpM/KZbPBgZdHkbZhUuN4MagU6rJp euxr9L689ncLoSeYSuLmp4KfKG8xLVYeqdOZ+8EhsG7EANQ/rJDauSjyxEYL3VxW2KsOStSRLTwUw qyiUM/VQ5HoXZAWaBPGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Shs-00000003LCf-39HK; Mon, 29 Apr 2024 15:14:16 +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 1s1Shq-00000003L9s-18WD for linux-arm-kernel@bombadil.infradead.org; Mon, 29 Apr 2024 15:14:14 +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=M868xcge+vjTb4vcqz3d1wlm8C5wkLs//kWdILTOdIY=; b=nm2i61UsLT8w5x92XhoIxHvr8k TjJKDHs9UzTCDv8E7LGJiREb82O4P1vBEClikFEHjQJHsYxXFSNcc5W/RGo251FqaZcZgm8Kdoh32 xKOjkNO10hCS7WEwRP7bnljfgaEHpSwAprR5oa4gu9pqs2trXVgpBc8pQlaNypxe6glDMMeuyYfyx S8Y7GftMxXtRVKJNucImk04Jz5Imj7izHPARuqkNN0brdVeXwfKHs7/BaSgmFLst3dM8KGJs8TgLm ONtusTfXboJNu7BeV3Ms7BAa3a107fUnCWgHj+u/wlMYeKb3/7VVWC3fVTE1EqbPLIqmaWrLFOdzQ ksEa0EEQ==; Received: from [2607:f8b0:4864:20::734] (helo=mail-qk1-x734.google.com) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Scw-0000000GYM4-20Bv for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 15:13:47 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-78f02298dc6so392261185a.1 for <linux-arm-kernel@lists.infradead.org>; Mon, 29 Apr 2024 08:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714403100; x=1715007900; 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=M868xcge+vjTb4vcqz3d1wlm8C5wkLs//kWdILTOdIY=; b=ls9rRXi5HTnN+2uzEiAFCATRR8quPgEFe19KuSzKXJ+nrFVU+HH43FW+X3MJGKGtVH kAbL2u11f2wHm8jI5Y+mewty+uVKMSSED2LFJxYNImkz27MYy22BjLlFdMoALQlDORxw FVPnMpaSp5FvTJXd6TSB8lzKl7mDkP8QHOC/4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714403100; x=1715007900; 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=M868xcge+vjTb4vcqz3d1wlm8C5wkLs//kWdILTOdIY=; b=H+H3qe5CxWxj14IMi55mI84F9MMQXgoNStkCIxvxPb0/dg1wccnIqtanvf4JdJrRuZ ceUGk8zRuETc1monLOs946FL1QiPrQTRYGD3nfEXi4wLYy44kgQivmkWVr97VubmrBWF BABlaFW3Fu6tzIFV/7YgdvrBm2zNNA8kEU50cQkdPGnDVEOHEP8AaqL0DhqeBlFIMsHb nhrPnyfMggVYWaOsiurn3ieeH9oXZv0gmIT1wVlpFZsyzRr+jN8hqbJz6ZMMOLWeecAn feUtCwl3INXIHZfRajqG3yzi5URBUDvgS6OWr5asGrJJb0mu8cbWEAmSutY7x1wGezEM HCAA== X-Forwarded-Encrypted: i=1; AJvYcCV7Ro1pJ+Vw0Tep/QsijCYLTLGanzulZbMvMRTc8UThj5vUEd0ETc/bmoeZYAbNWKSvu584NoU4jZjjRI+SqStFkRKnhU219uUdEzmNFKwNe0ZBB1k= X-Gm-Message-State: AOJu0YxpSstksygnaY/njp4YajMQOtT2DV4+oLZOyy1CP26tiR/maUO0 8uRf+M2F+DNearbCQdUE4pKvkxo87HRqd2pagxDFUJY9Lb5o2OyhwL6Ds8ZnAQ== X-Google-Smtp-Source: AGHT+IFpnQ4ab2gf5wQortCnYRGRkza79tueM0GmMJw+OfK9t9OORYfudlojtT2eZzgU8317EfmzQw== X-Received: by 2002:a05:620a:2005:b0:790:a961:373a with SMTP id c5-20020a05620a200500b00790a961373amr16658835qka.31.1714403099487; Mon, 29 Apr 2024 08:04:59 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:04:59 -0700 (PDT) From: Ricardo Ribalda <ribalda@chromium.org> Date: Mon, 29 Apr 2024 15:04:55 +0000 Subject: [PATCH v3 16/26] media: au0828: Use umin macro MIME-Version: 1.0 Message-Id: <20240429-fix-cocci-v3-16-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_161054_912373_BADA406A X-CRM114-Status: GOOD ( 11.79 ) 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/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index fd9fc43d47e0..2ec49ea479d5 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -602,10 +602,7 @@ static inline int au0828_isoc_copy(struct au0828_dev *dev, struct urb *urb) vbi_field_size = dev->vbi_width * dev->vbi_height * 2; if (dev->vbi_read < vbi_field_size) { remain = vbi_field_size - dev->vbi_read; - if (len < remain) - lencopy = len; - else - lencopy = remain; + lencopy = umin(len, remain); if (vbi_buf != NULL) au0828_copy_vbi(dev, vbi_dma_q, vbi_buf, p,
Simplifies the code. Found by cocci: drivers/media/usb/au0828/au0828-video.c:605:11-12: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> --- drivers/media/usb/au0828/au0828-video.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)