Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1652369lqp; Mon, 15 Apr 2024 12:42:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/l/lw9venHYcCcaaj37aLWg2FEvm4HhA2cD8UtpSaRZ0fKV6Bj58ZEEuvdpie4owzB8iPDDnG2d+4IPuRWOeggoAeaxuOWjx/EOML5A== X-Google-Smtp-Source: AGHT+IGfdoB6A73AZ6FmGUW/oG+hozQzUAiAXPfGvBjBsP0PHbn9a5PdbOYzmZhhDX6gkeX/w200 X-Received: by 2002:a50:c043:0:b0:56d:fc50:ec50 with SMTP id u3-20020a50c043000000b0056dfc50ec50mr8874edd.13.1713210120209; Mon, 15 Apr 2024 12:42:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713210120; cv=pass; d=google.com; s=arc-20160816; b=I+39mzQwbdyjcwr8+OfpkDVePGIXAkvOF3oVc06IMB2mw6fnryro9QCysINYdURIXM bCVjBlCzln8d/S6LNP5s5eAOqV6oJvjRK7eLtWqiMj93wjnrTRoH9kffQkaC3CfQpuxZ dfRErPD93zMQqZtrv2Y14OOSC+fxdvzk/3ChfIKZsjhS8dR7Kd3XwcvEvvCb8w8nJQxn 3P9Qq2c78BGxAEm42FU/M7jczAfsanxA7eQz8oQ9UtKsn0xRlVEK4h0gxJAQ7GY/zPBN 9A5X/qVEkgQzMnpiQVy2+k5KVWGdCSX64SIiyKYBbYQI8wxpDandkXG0iSI+IakC6rFx UDHw== 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=VYb6g5i4FA16yMs6Dul0lviXONeB+8pR0V9zyRVb51o=; fh=eBUAABj/ta/i4r2kIIQfp0DoA97FlDfDw8yq6RWd220=; b=h+ze3fkm3J5+stuwOxm2TRDEDZx58NDsxessP+pkXY6R49nWVW7IlC090J9HyMLtUm YjnM0PhsU0f0svN1y8xPkhgm+dA+kVDAhEe2IecqQTT6XBX0XRrPcmRTKZr7iWWbhgjM Ar6xZDuhpPVpmtnawQPN/cj+A9EUXGhNdZyGnULc3DpGTjG2ttndSWoid16qBlVSq7xV kJ6D+BAbsxeyrblJLb4EUkfyCLCvIgkhQjZTlA3e2beQSHYADnSCHsJXKWZRMGG46Gh2 SpxnJYjtu74mlP10VEtNfTPx6Rn8ebYZhptFJwKFdNkhw4tTQGxLqMRf4ulUKIopgJPn 2kCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YKYOL459; 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-145800-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145800-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 m19-20020a50d7d3000000b0056e09e70426si5033249edj.6.2024.04.15.12.41.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:42:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145800-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=YKYOL459; 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-145800-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145800-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 A7DB81F22729 for ; Mon, 15 Apr 2024 19:41:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F19FA15FA85; Mon, 15 Apr 2024 19:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="YKYOL459" Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (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 1416915E7FE for ; Mon, 15 Apr 2024 19:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209692; cv=none; b=gXOSD6DqD9+yRWWUb0YWW9W1WTiCmDRpJhE8RBPx+lLQ6HbcqvjAgj4BNELb8AYN0CnXQIWy4Pg3QcJGVx/SrILlXOjHyIVawU8gSF2D71jYcRX5CPvs4igp/zfvh/nrjsn+ZWQGqk6Yso0/JhXPnWfutHtXophfczGp5GX/qB4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209692; c=relaxed/simple; bh=CPsjhfr0ipRuyWvLekJtBUPBvfW5sC455CD/yQi18EY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jb3AdLK9EMLNx3TMTx6vA16Vg4gpaVn6cPIdbB2cNykHq11UOyVbfzhLhFhHMgJa9kiLRPjgccX1w50f1Mk+QnX2UXfUceGSi3FS8EujWEyewSEVNOrLN1LhK2uewvVY1pa+LEj4IyJCzq/biB/74Bb/eHXFMp79jteA1zizkjc= 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=YKYOL459; arc=none smtp.client-ip=209.85.128.174 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-yw1-f174.google.com with SMTP id 00721157ae682-61ae4743d36so7754407b3.2 for ; Mon, 15 Apr 2024 12:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209688; x=1713814488; 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=VYb6g5i4FA16yMs6Dul0lviXONeB+8pR0V9zyRVb51o=; b=YKYOL459xPZhH4tkkQ7nCmxndqC2eNMd7Xk9q21LWkDq6nsrYiHPN1zik0CqpeEEsI pqlmtl6EueL36+N47JvXqAIhYaNM8evVxHhcSE6m6rQE9M/e9784zeouG/C1/Rlqr5LS 9nbuIa+oZkVT/qEJiUDrSI5XxG8wOpUGZT0/g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209688; x=1713814488; 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=VYb6g5i4FA16yMs6Dul0lviXONeB+8pR0V9zyRVb51o=; b=nxnS1Emt3JqRm5gRluCJ+VaQ7widAZhuHoLy4looAJ3auEkoQ4nvZPRS1/II+gAgSi 4YsdhOn5a5T5tyjG1jeqyzKfEshhWeCblHZK3q+5jvJLr0ogFXa1afVaSlUieqsZC/z0 fEUGyMAOyuXs2E9oEtw0UNhUR0L87HMtL7H7Vmc4ela6J8jdTrcfnhptpiqi0ssN9vQg xZifX+UydPVYpTC3NWGFZj7JzEsRaUhvbtA7oDnErcXRaXtQCBxyhHCB+XVNu84/ufr+ KLbaBCypgBtw+C0Sg2iqElkJN4fQDC7wBR2c4ranKH7jH+t3hwLKzegzYbfLW5Tg8iYU 4Qwg== X-Forwarded-Encrypted: i=1; AJvYcCUZO0x4O4BU6LC4CMUSXZf9ltTve1kiZEsyf6xB+pVjFsB5w+C703e2hnpvcpQVfDhZAxkum98BLMoyQuzTHPDoiiuPUTNP+Abik05z X-Gm-Message-State: AOJu0Ywy+dA6MB8zRTQc4zQUBtQp9lGrXTKglYq1+AhaY+EHTvg7vswy XDHy6W80u+8jvM3RLMISYeRU9X60nYKL63huOqCOlTQY//sdmSs6j9WjfyqtGQ== X-Received: by 2002:a0d:cd01:0:b0:618:875e:2bc1 with SMTP id p1-20020a0dcd01000000b00618875e2bc1mr8806798ywd.21.1713209686523; Mon, 15 Apr 2024 12:34:46 -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 s26-20020ae9f71a000000b0078d3b54eb76sm6718055qkg.78.2024.04.15.12.34.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:46 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:33 +0000 Subject: [PATCH 16/35] 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: <20240415-fix-cocci-v1-16-477afb23728b@chromium.org> References: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> In-Reply-To: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , Hans Verkuil , 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 , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , Benjamin Mugnier , Sylvain Petinot , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Niklas_S=C3=B6derlund?= , Pavel Machek 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.683.g7961c838ac-goog