Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp335793lqd; Wed, 24 Apr 2024 04:05:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjxWjbfaFot/qoG+zGaUofk/5RjfVfK1lGpj02Eu7je6D7jvX4T258O8P+cPNMmFNiB9sAN1FnvWVTISQ4fR+7xLv/E/ySI3fWqVqYSw== X-Google-Smtp-Source: AGHT+IGlk00cr03hXMP9QKOc1502iijoVaUaQWEYDubadsr56y29XIQ+VPhQ+ynPTkyI/t5jRMOL X-Received: by 2002:a17:90b:1e53:b0:2ad:ce3c:1498 with SMTP id pi19-20020a17090b1e5300b002adce3c1498mr1798444pjb.21.1713956714515; Wed, 24 Apr 2024 04:05:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713956714; cv=pass; d=google.com; s=arc-20160816; b=pIAGGQhNkqYKY5nKCezjmmlOK2SLUhOi1Ozj4dwi/64tBBIds1mdY7pBSR40Gvl3tI IhoV4m86H0GYpyvtnwr1ZlSMEPyNuUNQ/LkOICrxCXAyxkmOKf6Tp7Kg9FDc53eCL9uc Xuqfnz3w2KocZv1ZX9PYt52dL1OgBnxNMaV1FLQsJfNxSLnnTx6Z3pXvM/6bohRjyXRj xtZy3zRQxOdO2BgNjfYOrav8LJNOHduqk2fK/taki8jrM7JZKqVboec4jdqrySlmL2yB oRVoGvjq/S566USNVMzq4t1552GzhZBtz1P2jc1i3nU3gP1pbgKBSBjy8h/UPLVGxMOn bLQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=3NEeLl3YejgCxDEdfVd3GRFz3M8V6FuccnNjPfbKsGw=; fh=eVTj75UywcoJpWjM5FasZ2buvdk8E/NrS+0WJ/j6joU=; b=eK02Ghrq1e7MsDxbR/5CtJTMcTAOJt8W1cp1FgEDzdwm4vDswhPXUiANcWDf5qSY/i VWQuNzdj9Njb0RhA3RStJgV3l5bX9P9N215wkbzfaAZhHz12BwkxXu5MqEae1j4KgTSV wYAMRpd1r1ke15B6tPEF0OSMPhuIusbC1momn6h12sa0y0smPh3d00LiO8Y4C6lMZiut 814iQTFmXwmTUxCGybj6WtjIlshT4TigmeucvoGRKGzrRE/yBMMdOfZ3qW76ho0BqOeA YYHg7nhMXj7UYI0NCBNZmQCY2U6tW80jJjq5ydkWV/Eo1bknO66xMhAgp4wygm92Z0J1 CI4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-156775-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156775-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l1-20020a17090aaa8100b0029b8534a3cesi13025332pjq.142.2024.04.24.04.05.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 04:05:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156775-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-156775-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156775-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 96E1DB22987 for ; Wed, 24 Apr 2024 11:04:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47B3E15A489; Wed, 24 Apr 2024 11:03:51 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E72B13DDD9; Wed, 24 Apr 2024 11:03:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713956630; cv=none; b=IXacaWpaWGVn5Ild+hgMAXdYcptpyYxf0wOeFQhAna1U2Ve7OYcCT1+p/QdTFIngE5KtCQif1nSSbo24ZtzHp+rPBA5h6kBSuccjEcg0nSWbRDahxkW6RuOGnYiPNlrw/YpOQHgv4avHxQt5bVOZtU7TlhFcIiEzVPLu9SjkNOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713956630; c=relaxed/simple; bh=ZewZQj8SyBk4zmFnulpPapr44UY0UKJuMvtL1fwo35o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hQp46GGMk38Sdp5He/80px2SjCtjuN34/ANd+TziTcgm1uwhsmBMHVimDQUCRGFrIftDZcIUTDn9jkpoAf6UN6c0JHNyt1VyFJ97bYAUJVwxjdkAZUCbPjMZ1TRFJT2pLu018XEyUp6yrXUuFdPY2LSXilDA7jK/dcBxp1iLX5o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CA36C113CE; Wed, 24 Apr 2024 11:03:41 +0000 (UTC) Message-ID: <8ce6b014-331a-4e22-be45-763f9a12fc33@xs4all.nl> Date: Wed, 24 Apr 2024 13:03:39 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 16/26] media: au0828: Use min macro Content-Language: en-US, nl To: Ricardo Ribalda , 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 , 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 References: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> <20240419-fix-cocci-v2-16-2119e692309c@chromium.org> From: Hans Verkuil Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9SIt9uHaHjgwmtT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WD/9yxJvQrpf6LcNrr8uMlQWCg2iz2q1LGt1Itkuu KaavEF9nqHmoqhSfZeAIKAPn6xuYbGxXDrpN7dXCOH92fscLodZqZtK5FtbLvO572EPfxneY UT7JzDc/5LT9cFFugTMOhq1BG62vUm/F6V91+unyp4dRlyryAeqEuISykhvjZCVHk/woaMZv c1Dm4Uvkv0Ilelt3Pb9J7zhcx6sm5T7v16VceF96jG61bnJ2GFS+QZerZp3PY27XgtPxRxYj AmFUeF486PHx/2Yi4u1rQpIpC5inPxIgR1+ZFvQrAV36SvLFfuMhyCAxV6WBlQc85ArOiQZB Wm7L0repwr7zEJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== In-Reply-To: <20240419-fix-cocci-v2-16-2119e692309c@chromium.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit nitpick: subject should say "Use umin macro". Hans On 19/04/2024 11:48, Ricardo Ribalda wrote: > 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 > --- > drivers/media/usb/au0828/au0828-video.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > 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, >