Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1652029lqp; Mon, 15 Apr 2024 12:41:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWydUqdh8n2ofInGHYjx4D1bjZ1AMpflzBBt1TWwVMjL6YVAjKPac1B4ueH4AHxxJNH1c48uKRch5+8z3cDgK5u/gdZmvtd9Vdwml72Ug== X-Google-Smtp-Source: AGHT+IH+ND6Y3MNZMIBtOmufreahfT8Y1H2VZFI5loD1Jve6w7iP0XROs9BfCHNijcd9NZAXsJKp X-Received: by 2002:a2e:8046:0:b0:2d8:658e:7e9f with SMTP id p6-20020a2e8046000000b002d8658e7e9fmr6546600ljg.39.1713210080973; Mon, 15 Apr 2024 12:41:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713210080; cv=pass; d=google.com; s=arc-20160816; b=mcGSpPRaqoFLfStgq6/d5r6T67AknSnU8iL5fVVRWGyRQV+64b7xsmgK/96m/jwEdl 8ERLVj4Mylu0XvuHn9JeScV3gfbLLiVPf5pQzut9fizOvEVgqAh1RA5u/ZhayFWMJOKT En3L0zprrynNBzZ/CIBNJL+7nlFhhaDDiaBZvIB5ua5Br8VDLzZAV0qpcd2X2oT2azWS G/oztI7m+CAjxJ0JRnzlAj16+Dh0Zq95UBwDucY4iwGszkdu1T0D/Z5z3RuWdBQH/vCl svyIVH472aeRISpR3hdWu5VAvFIB7tvdS1wTkBqHxru8mN/ik+8F0oFlt7dsQI7YnI5M 6aWg== 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=VH1TTY2R78PVfXYnT8sQaYwvCkEpO00JMLA8gBHoObU=; fh=rw2n94zlMIxlUTVsg0ew0t2cx9S3eKkBII2qmUxNGEc=; b=vx1GVVTxq3Euc9051e9KcbUi932fSJu2O+7skSthLcXEgiyJHgY/jbW2nO/vP1D66a tt3jBKVxIKwfByoalrb723qmPCzF0Ak2LUxKv8BjKLltAdRN0rny01A1HZCIzejKPzrN yCSfuNWtHh8jfF1/TvIB+Lzg8kWu+yBZ7QgotVnJSky+OX3o/Jm/KCONfzSmozx4wboi wzsq79CBXjXsPyPgPVMUqRwwvO3QB6o52Y4PXb8GcmMcHCSZHNajaF26REOtanJZQMQB shcjDRPEYm8hJmhKKLfexMRbU4g51O7y104weiespXzyfkmvgzW3Tpg2Lt79HaRIlpj2 RKxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Aw8PVAeS; 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-145798-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145798-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 z25-20020a50cd19000000b0056c366daf26si4773755edi.211.2024.04.15.12.41.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:41:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145798-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=Aw8PVAeS; 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-145798-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145798-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 855D01F22FCF for ; Mon, 15 Apr 2024 19:41:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 995C915E5AB; Mon, 15 Apr 2024 19:34:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Aw8PVAeS" Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 80EC115E5DD for ; Mon, 15 Apr 2024 19:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209690; cv=none; b=k1CkimxhUHuv5hiIBKvCyQh0zhvqr01Q2eEU8QwhKHbpFcej05hRCEk+6SW0qgCfXHIac95+r4H6PtcfNHlzZ6i45hqnOvx+tcQLlJyMJL+yL14GckeEJspqLOT/Y0imGtqVap6NnPIfW9wZGrS2lxTD61lgyaKN4XiSEqhYdGE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209690; c=relaxed/simple; bh=QMsjv+wettsGw23pqby6M5jpWOg9Tw4lhss0lX66IJI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jrxRFGboC0bpV1sa93a/hZAjVP+2JQhzpTLYFBg9auAAF2NkHLM2qyT1YLxvYoj9M2zBtJlJney/eWuFKIGrFCGRCPd8lAJF1+4YfbJfyL7Wo7Iq74bwogTIguh23ExNc7ibce7CX2Z1CefDO4tE+eKxY2+JyyQe2TaV8g9Cn0w= 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=Aw8PVAeS; arc=none smtp.client-ip=209.85.222.179 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-f179.google.com with SMTP id af79cd13be357-78ebc7e1586so472920985a.1 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=1713209687; x=1713814487; 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=VH1TTY2R78PVfXYnT8sQaYwvCkEpO00JMLA8gBHoObU=; b=Aw8PVAeShZ4GKhUDYCsi2PsqSye237i9HPTPm5MU6c/HPaFPfsyJtQd89eZHNpm34a 383SVnae4OoILq4kG05YEdXY9ArcAK+nX+5Ku2mIY+EiO3aJDpQuTbjmNjkWlMwyTPQJ 6JDOEM/aiAPq5mgjy4d/Q3LEkvJKRx0KgKrMY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209687; x=1713814487; 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=VH1TTY2R78PVfXYnT8sQaYwvCkEpO00JMLA8gBHoObU=; b=Ogn0r405rdFuXkaxQn3O7YYKbPHJHJb8TPMuP+LqfXvjq4e8eAlcs3PSLgjifl7FRg vtLsbWcHuH4JcPyiCxCrIXCT+5WfgHnQv8OxXe3agDmCn2jZD+CC+8gvOso3JXeL/i+i mDa5d7sDq2a7tRN0oXOdQSmgwm2np/vcUqaWAcqNQmtgmmwRfo2qXs5YNzLceh+wYDPD FLnhC0Q+Lq9QA94WySfX17oyVAjpYlTTZilrGiqvlmQfqbHrENeMGTFJ4aZ0nvzgpyQu 15/3UG4PsCwqrhd3NKR6qqREAiEOATnMn8DZBGrFow8amvB416L93yPKhUhRn9mYvjip lGXw== X-Forwarded-Encrypted: i=1; AJvYcCVfEOsc4pN9Ldm1JMvxavPehVEl3mwgbmxJ7TxLg2p1q4FAROqoSKrruQ8ymENIwtpcDF5Z1hpJMjgNquYJHFhuVzKHWhQ0FIqMGMZA X-Gm-Message-State: AOJu0YzRpNZm0Q+q4t1w0Ss/DqHJVMB75AwpqiYPOIU5KymVEDGIjpTD 2IYvS4ks3eFRWSGGZzdbOaiHaDmYIc3m4ve5dfNaY4fFluqulGgRMaPM1qU4TQ== X-Received: by 2002:a05:620a:2953:b0:78d:61fe:77c6 with SMTP id n19-20020a05620a295300b0078d61fe77c6mr1118634qkp.2.1713209687511; Mon, 15 Apr 2024 12:34:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:47 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:34 +0000 Subject: [PATCH 17/35] media: flexcop-usb: 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-17-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/b2c2/flexcop-usb.c:201:8-9: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/b2c2/flexcop-usb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c index 790787f0eba8..3ba6a5ed7167 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)); -- 2.44.0.683.g7961c838ac-goog