Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp521399lqt; Fri, 19 Apr 2024 02:54:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU7bu5MKi11nrXwSmGYSsK2YszXEb4VSShM6ax8WZYRpL3WzKP+9Ce0v+ExQu/uJFXA1lCQLWxDdN8LxtweAqQ/Bcod9RpRvrGPlodvfA== X-Google-Smtp-Source: AGHT+IF++RipKG/crOfN2xis159g2CH5X7j6Zu8ly1N8iaepPDCToRZLQYesGT48ITwdif3CfnfE X-Received: by 2002:a17:902:7201:b0:1e2:bb09:6270 with SMTP id ba1-20020a170902720100b001e2bb096270mr2126995plb.28.1713520457133; Fri, 19 Apr 2024 02:54:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713520457; cv=pass; d=google.com; s=arc-20160816; b=YdhqX/2A1YufsWDEnMY2NHm0o0Qn/zN6BxnMCizBI6TSbIQX/JO9BIWXY40ULYjsMC 8gxL41BDE46S+kT6627SecvIpfzeuuoKRHG6c+nuOUVWN4HuIH0WYl1rb1LLejOfpT2n +URNUG5qLl/fjy+KQ/9z4HVj4dddaKr9yzwGEbam7Ls0X3bkgt7uFqCqcaeAvi3gazdJ CnSEdoedh8ofSi92amaIKtckJqdp1Ctnh7BxDYqMuvNCH8FdV2DA1+gYUJTkHgfuRYcj DsmXsg7ri/RimbwCDIyflLKyTma51uUh7BlcGpJvk2XU5qpuhPdLmZnqzOda0lQTsG2r Hq0g== 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=M868xcge+vjTb4vcqz3d1wlm8C5wkLs//kWdILTOdIY=; fh=tFDl8XyAzBlTUez+Ay9yIsGsocmFgyEFd/1U8FWo8Tc=; b=ghU77D4RbHjScunlpTgr+mLdSoRGDrdVoeo80j4+Fs13+f/RXeZPK/EuzblOpjJ4Os 10PuZsUzKbuoCjhTAb7ZF06BPdp+kHB8Ou5PdG8as+ddrQuPGKq9vBURfkY4eq99K4Ti au0ChugmhyifOMiQ/+3Ys+fyMX3aYqgXVw+twy8ZSa0wfrz6GiZGSF/E5qWOhp+dDGWz 4cfvFENuugRpTvdGp2aF03lzf1Ak6ZnluzSENhqDS1swTgMPC1r7UY/eEnp18VOQB/+k 2Vx97oTsNtLeWBGvFmhtjOMHWHDBSl+Tfs43IyxRzC1XJaDviLQrnLVjYyFAhzHkXQUN aKBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HumgXV+E; 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-151263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151263-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s7-20020a17090302c700b001e3e41b9f2csi3109589plk.15.2024.04.19.02.54.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:54:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HumgXV+E; 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-151263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151263-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BF49B283A30 for ; Fri, 19 Apr 2024 09:54:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F195112F38F; Fri, 19 Apr 2024 09:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HumgXV+E" Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 6561312CD9C for ; Fri, 19 Apr 2024 09:49:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520181; cv=none; b=pWUtikC6vkbOXLc7+LqB7FGzUSxrrd3ZEmookTXSKfwGyszAsWDBe95m1Chmi1V/2g39WKHhW13B3XXcpuCg1kwLuUHauClmEX6+qQ8pXZ5Ft0oD6sc2c6BiWjT1ZQxxwc4qdLS3jYelUbmRBXux4RXIFEmj3qjQFYFOKXsyPog= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520181; c=relaxed/simple; bh=A6XSSayOn3r1ipxe/l3oVKgkfleRFTrQcYLCuzASKa0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s0HXGORa5Dx4DvRObqBaqTLu1m1IQan9RW+AFLB8nxNL3QjwkXEysv9K38XX2nbcgeC+dCe+YY7AeGj6U86pEomAeRbA/aVLObfNLf/nUikoiBSgssNDfF+K32SgGzMFATrHRsif+Dm7IHntevE6Tb4KGKiiRGxTiUgzIS9p2y8= 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=HumgXV+E; arc=none smtp.client-ip=209.85.222.182 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-f182.google.com with SMTP id af79cd13be357-78f02298dc6so151338285a.1 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=1713520178; x=1714124978; 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=M868xcge+vjTb4vcqz3d1wlm8C5wkLs//kWdILTOdIY=; b=HumgXV+ErFIGnDnogPmlpKN32KbuQGE9FuDytc1rldliZGDvuyW2I3lfPtyz0oQUqX xqt47BhZaBp5aXQ0wGqG7cidr6nnhm2+gqpW6YtPENKGreCl/2t+aNnwBkfLRVA5JOm1 Xi3HJFhkhwKOmKSy28w3w4jE0sSaPyJImlAn8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520178; x=1714124978; 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=YbxEerQrY+4Sz1H/oVSWtylnLT8+arE76390tlPpVcJ24spoIFHXYG3ufcbuuD0LUB lLuQDKCjb/kyX99vsXoIQwZRB9Q3PKbA0KfirYDt4a1k2K6KxD1cJMEcT4FbMSgg6fBP EGqHN5o9G+RbdF61oF7VTX8ahOfph5iSSakyY9gESepQwUyNzdeHdqBRa1saE6R6Se0D YbXyCw08edbBlqtjCVMMeDHy2xbvJEDPCQTXeV5Wz8WHxkmHrQqwQ5WW+eymni73dVME N6GLJBhEqWRlxESt9lAwv6f6vVorRqFvZkxfvWUPlvmibxnRFUk+h/5XWSbBfjXTic6R 6SHQ== X-Forwarded-Encrypted: i=1; AJvYcCXCNUB20TYFFaOaL4wlxMTfZVhpce1Vi1dE23cf1vDa7Y2OzwIToZlozMUU6ZKTmO+e+w2KfOO0AxIr5vizbBQEmmkjax0rNSXIPVFX X-Gm-Message-State: AOJu0Yy4wV0OXEAdwW0fUxOZeXUe9/TWe8fDfyD1snn8IN8nyVlYyIdf i0YB4KsjRZmHHi2pWoWwYWKhJ05A6qT82SC2SMJO97Gq3fttE5SRcivEk6mWkA== X-Received: by 2002:a05:620a:45a7:b0:78d:5d86:ee3a with SMTP id bp39-20020a05620a45a700b0078d5d86ee3amr2694110qkb.27.1713520178140; Fri, 19 Apr 2024 02:49:38 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:37 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:48:02 +0000 Subject: [PATCH v2 16/26] media: au0828: 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-16-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/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, -- 2.44.0.769.g3c40516874-goog