From patchwork Mon Apr 29 15:04:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13647208 Return-Path: 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 5503AC04FFE for ; Mon, 29 Apr 2024 15:10:47 +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=RdnUnn1DqeDKn9S0llfgkh7xlSlzwoStITrFN5mfIsM=; b=YIO0XcmMnUfIqf iDUMVQ89ggib3HOpixtmERLwJOp5B6wmaVfidE50NvcpvABPVGVEHH8C/n85GrLnZ37SQJ5abqMbk 1TBan5/pKD62GdQI0XQtiQfb2VKNhnyrCx/12PdPRkaFJ+Cd9J1Zlr1aORsT1fUo8H0FcePiQTHAk KaFrNcJJSQJRN8hL5joYWU8Sz2WoYZQhH9vutmtKwHcYiGXMYdesi6XdHP0WMA3g8xZruQ0aqEUPL LvIMUH60MMHLT65A47gXSkdOIpsnZTry8h/nwImXC62TBrFLVFFMRxuiY/tY0i737fj5a4feOpWe5 hbX1KYJ3gYNW8UGSFLQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1SeG-00000003J6o-0PT0; Mon, 29 Apr 2024 15:10:32 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1SYt-00000003FSY-2pJO for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 15:05:02 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-78f049ddd7dso369264285a.1 for ; Mon, 29 Apr 2024 08:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714403098; x=1715007898; 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=oXXgUMwvGuh/bAZ05Vu9f2lIZUwmSZiJ1Ue2E9QmyGE=; b=gKdMVmmboYiRLPnHgjjgS2sNwjOt+hp7ULMWAfWMxBKmQMFDW5gwsm/o2WYxf5AuTA q6RJF1SwyWPDNFklCTcOSzhWtFL+A4iFauQYtnOEGrNB6HUuj4wNobcEF5JXdSBbxCbb 8j/lQ2hOqgGo+gAQKyAROwySV2g4Z4mmTneDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714403098; x=1715007898; 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=oXXgUMwvGuh/bAZ05Vu9f2lIZUwmSZiJ1Ue2E9QmyGE=; b=G1u3OarqST+6Xf6I8ucZpJ0Aa9uttcR8VPoLwL34XOSmmg+KM1w4Pw8VjotrF75YOQ P82xr2jyo3nYoDgTE7LDxGEgnOj6cx9wXPm5h8LM74AZBekzVdVFvQVddk5BaKm2BFgu pA2L3nmnQEbxZ2vqyPVoNxEtdaGkYXZZ+U+sWRi8FFBxTsCQRpQSJ24e2A+lfoMQ0PiJ ZYmQeYJ0Eppkj5MiVOqm0lrS5pvfdIi32lj0Rr7Ld5hIgvco7tgjgE1MbtNy8BIolldO 96RnpVdRwkN+kijcQJGhNkZMQQ1SHw62Uz8nbld7Bd9B8q2fBcrDf0ahq4qwfYVYXoFs hg+g== X-Forwarded-Encrypted: i=1; AJvYcCUn1dV5eQx+fUdmi2+2v2npoDZ7iyEVoKpFc6OowlvTxVFik8FCs7UEu4s43hJhefNoKG9iEO7a4YvzLXqNZPkDZgZQQNvoTHKjzS+kBF35M7F/q2M= X-Gm-Message-State: AOJu0YywSypvwkeoVeeJXJoyweGdv71O7YKi/hL7GvxAOJpZNaaxAAPP hp2wFG6dh8FpFJDLIUxAHbyWey0eQWyZv2ZVBVCvSneyxOrNeJy/grau1UIa0Q== X-Google-Smtp-Source: AGHT+IFJT4Q2Syc1PBrJKVClvA35sFEGet4fgiHKy6TprlGgcTs6U4UnMxlpWR+ax38rGRoBMytLog== X-Received: by 2002:a05:620a:410c:b0:790:ef3e:24fc with SMTP id j12-20020a05620a410c00b00790ef3e24fcmr5535437qko.16.1714403098672; Mon, 29 Apr 2024 08:04:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:04:58 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 29 Apr 2024 15:04:54 +0000 Subject: [PATCH v3 15/26] media: netup_unidvb: Use min macro MIME-Version: 1.0 Message-Id: <20240429-fix-cocci-v3-15-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 , 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_080459_960785_F82330A3 X-CRM114-Status: GOOD ( 12.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simplify the code. Found by cocci: drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c:138:26-27: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c index 46676f2c89c7..1c885d620b75 100644 --- a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c @@ -135,7 +135,7 @@ static void netup_i2c_fifo_tx(struct netup_i2c *i2c) (readw(&i2c->regs->tx_fifo.stat_ctrl) & 0x3f); u32 msg_length = i2c->msg->len - i2c->xmit_size; - msg_length = (msg_length < fifo_space ? msg_length : fifo_space); + msg_length = min(msg_length, fifo_space); while (msg_length--) { data = i2c->msg->buf[i2c->xmit_size++]; writeb(data, &i2c->regs->tx_fifo.data8);