From patchwork Mon Apr 15 19:34:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630591 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 A6A8AC4345F for ; Mon, 15 Apr 2024 19:35:05 +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=BGYZef+TQDgV/EJ3rc6yDialKCDZWZkSwwbxbmsLOyU=; b=Wf4FW9Bvnpd2dc 4H9/HYMlMqv7Q36mHA8mk71z6WGpLj/S7y/C+wWnSXS4ee6KaxwjS0IoAz/UYcyXz0kpGgIww+rpx crOcCFVzK4tuErAuJ7XQaefISpKgR4speyls6dB4v6L0vtXsYpRUG6AKixkkAsMxmcVCVypcUMHeb aDy3l1yLhoSM5CQBKLG1jvodRNEWi3HOe6qyDTKvgYIoIdGyGuFp2GpttuxfGZiDKpYSLI/h4DGTi rjFOk6jF/YP2+y0WukHCd2Jtt1oHPuNMhui8mxqa2elUP5P2wrdDmFgKs0MsUC4SgeBWraAMi/j/X nWFa5hVbTASXVe9k+DUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6M-00000009c5h-1S4H; Mon, 15 Apr 2024 19:34:50 +0000 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS66-00000009bou-1MA9 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:38 +0000 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3c7150cff81so243995b6e.2 for ; Mon, 15 Apr 2024 12:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209668; x=1713814468; 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=w+qS5Z4vkKN1UceEhIkP1myjPLSe7r+1w4SAg1mZwEM=; b=b+5gw1dHyw/pL+JPlvVWR5ZU9o1o0Fcm5Ea3D/d62XTJBiYSXuhnr7eInRXsPls41U y/5YhVItn4e8vjcK4P6NiLY62vO+4k49MyItvFJ39NMAiY85nSHuU/9ZFimPeXhEE7cb SPfGp20RYlQnLw4uCRRoipFyRSh4P2H9+5tQ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209668; x=1713814468; 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=w+qS5Z4vkKN1UceEhIkP1myjPLSe7r+1w4SAg1mZwEM=; b=XXL8HbIbuEzPkJ4E6KiTSedJECqCDJOx9QmdKjxi+kIT4s3uowI9TDPAPM8N4mP9nr CtcCXwGJZPtNo/RbmJ7k/RcUALfK0XJDR7BaJ4QqggpyGSbROETs0fd+fEIaiFF3/fuU C0zv454AFuEUUW8n9CIdfXxaXldgGG7Ul9rkK9UyOaHaIQlQOgJBo37eqFLoebGw4tYe 4fx/gpxsi5ZYJXPO9uzUVmeXySceqMVyutAy8Yy8B3s6CyLN5vdUSnLVSwtmcfNTZnjD MegVuW0O5tvA0kEHRtvDyQEa4yQ0DclOi2L4OIP/IWjcW1nG3Krx4/OboZus0S8Kszb6 e/OA== X-Forwarded-Encrypted: i=1; AJvYcCXd4uy6w2k0g27zp68/8AQDK+cCPxV8MpOeQfPu2/OaqjaAhaQ4zYWg0AYJyOYUn0SwbNqhSKBJWD1q9ulbnhNHPV17Lif9v3ik4ug7KqMMUfr4xJY= X-Gm-Message-State: AOJu0YxZG1ZdZEiTmyajY7shPaOHhemA3rJ3i6ZLDe5CG9OVfSA1dCFe OwirE7Qhyl/pvXOTNkg26oWdbVhJWdvQFaNpjsf7dHMHDe5xN8DSoPzdsJo0Ng== X-Google-Smtp-Source: AGHT+IGdtkSiZhnfiSTfKFrIX7aC7mQfEfNuaLQ9aOCusHbpbm/GtxuTWZQaZZkHNYhX7JRsmp7ZXg== X-Received: by 2002:a05:6808:4084:b0:3c5:f5a0:3b40 with SMTP id db4-20020a056808408400b003c5f5a03b40mr11232302oib.58.1713209668180; Mon, 15 Apr 2024 12:34:28 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:27 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:18 +0000 Subject: [PATCH 01/35] media: pci: mgb4: Refactor struct resources MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-1-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123434_534217_66350D63 X-CRM114-Status: GOOD ( 15.40 ) 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 The struct resource end field is inclusive not exclusive, this is, the size is (end - start) +1. Update the definitions and use the generic resource_size() function. Fixes cocci check: drivers/media/pci/mgb4/mgb4_regs.c:13:22-25: WARNING: Suspicious code. resource_size is maybe missing with res Signed-off-by: Ricardo Ribalda Reviewed-by: Martin Tůma --- drivers/media/pci/mgb4/mgb4_core.c | 4 ++-- drivers/media/pci/mgb4/mgb4_regs.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c index 9bcf10a77fd3..60498a5abebf 100644 --- a/drivers/media/pci/mgb4/mgb4_core.c +++ b/drivers/media/pci/mgb4/mgb4_core.c @@ -493,13 +493,13 @@ static int mgb4_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct mgb4_dev *mgbdev; struct resource video = { .start = 0x0, - .end = 0x100, + .end = 0xff, .flags = IORESOURCE_MEM, .name = "mgb4-video", }; struct resource cmt = { .start = 0x1000, - .end = 0x1800, + .end = 0x17ff, .flags = IORESOURCE_MEM, .name = "mgb4-cmt", }; diff --git a/drivers/media/pci/mgb4/mgb4_regs.c b/drivers/media/pci/mgb4/mgb4_regs.c index 53d4e4503a74..31befd722d72 100644 --- a/drivers/media/pci/mgb4/mgb4_regs.c +++ b/drivers/media/pci/mgb4/mgb4_regs.c @@ -10,7 +10,7 @@ int mgb4_regs_map(struct resource *res, struct mgb4_regs *regs) { regs->mapbase = res->start; - regs->mapsize = res->end - res->start; + regs->mapsize = resource_size(res); if (!request_mem_region(regs->mapbase, regs->mapsize, res->name)) return -EINVAL; From patchwork Mon Apr 15 19:34:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630708 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 09359C4345F for ; Mon, 15 Apr 2024 20:45:50 +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=aTku6vNZV5R9DJ3IYo475BN2kMb6AQdrTnpJzGf2Aug=; b=npXupZqeJU+OlQ KDZ4PQP1oX4zjwCNAnp45ZlN1omD1zh3oO75Qp9ExhqmpiX17VGmB45fyiPdyITxihXLUXA8jlO5y 2oJKvOkJMhyQ1EERdoe0EZTEt54Ss8/gzph9/E+o8vlg8F8eUJMKxtQeA49Ru+GSr8tj4TH5qLILb VsfFxb2S7A6eh1iyXGycxY6Da+2qlEOHd5maZdOAoknM819nUo4ILlH372HbFfF4ST2XYxss0FwZM WRXnuTUe+FFlp9gH0bGiQa0SV5z7+WHYdXhmkRRFck0aIEFmcXYCWBd5PQKoCHHQ30q5UauiKJJhd aaSZa6Pg7Mu77Gk/+5rA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwTCu-00000009ryP-42IK; Mon, 15 Apr 2024 20:45:40 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS66-00000009bpD-1UK6 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:38 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-78d5e7998a0so283663785a.1 for ; Mon, 15 Apr 2024 12:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209669; x=1713814469; 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=xRTXUwBhcFkchUD68etf7Ns4ncGhFtPLbimlhLL9HW4=; b=L0Qd7e9gcG2lEK2ZxDWdpFTtaHtGinZgytPOOEhKd4OFc3Lg2sKUXoIYtzy5nIRGhE zsIznevaS+fj6Sg6uWeydgjroUiWphVriTprTdMKctOULbROD+SvP0ghxxxTrU7bAACC C4eUMAFzrCGLRHtt95kHnhWVsNZbMuWntqELw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209669; x=1713814469; 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=xRTXUwBhcFkchUD68etf7Ns4ncGhFtPLbimlhLL9HW4=; b=BWCFco+cGXClUbkkQIfWexAMbIW+cKl3fn2QQe0F/H0SIgEc+hxKjMk0im7mRE7M5E jJXz/fnjbYmmg1BJDS6uNWn3ok1hosl2NtEsR5JdB9/d2iYpPiJezyBTT/SdzXaD2KdA v2zva6WG1K1oOsrVMiNrW40+7jRR5aLBtOJ1y2swazcLh6WgzkPGLrG9qpJhZz0KfpOG SCXG+tZflNMw1gbkZHefOGH/oVdwZ0GrZJ13myDRpcYFvJLbCveFLj+0yEUDoJq9w8DT fJzavEOCFNv/cSzEmXJ9BhXHQK/A8nsaUjB2TqAfdjk26EhtzWaSCDIeOsXakhGVLQTb Q0lw== X-Forwarded-Encrypted: i=1; AJvYcCVuFiADjp74zMIJe0CnwVLYTEFhWIOsgxHoiG0Q3Iti+hNuYqZ89NP5VbyDHhaV+q6Vw4yj5LHOebfeHrpqfE2JXjr3BBi2vbwrrJJkv4X0/CEaZh0= X-Gm-Message-State: AOJu0Yyb69mI+3P35SWaq1onDZAfwnenB6lVy+4TWkM93xwtwal4Zj8B wdldpYwrP0yehN5vZ1qwMNGj0mr72v0aJVPFcxrXbUdz8spDQb2zf6d9MXHADg== X-Google-Smtp-Source: AGHT+IEcDB670miUV6x3+CTDpPjHVUs4fSa2Vf0AT5UVwIYIhxKgJdBP21+/uHglj+bsAouxmzkrbw== X-Received: by 2002:a05:620a:370b:b0:78d:77f2:573b with SMTP id de11-20020a05620a370b00b0078d77f2573bmr14232523qkb.52.1713209669333; Mon, 15 Apr 2024 12:34:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:28 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:19 +0000 Subject: [PATCH 02/35] media: stb0899: Remove unreacheable code MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-2-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123434_621599_88F98533 X-CRM114-Status: GOOD ( 11.25 ) 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 chip_id is an unsigned number, it can never be < 0 Fixes cocci check: drivers/media/dvb-frontends/stb0899_drv.c:1280:8-15: WARNING: Unsigned expression compared with zero: chip_id > 0 Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/stb0899_drv.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/media/dvb-frontends/stb0899_drv.c b/drivers/media/dvb-frontends/stb0899_drv.c index 2f4d8fb400cd..222b5476ebfd 100644 --- a/drivers/media/dvb-frontends/stb0899_drv.c +++ b/drivers/media/dvb-frontends/stb0899_drv.c @@ -1277,11 +1277,6 @@ static int stb0899_get_dev_id(struct stb0899_state *state) dprintk(state->verbose, FE_ERROR, 1, "Demodulator Core ID=[%s], Version=[%d]", (char *) &demod_str, demod_ver); CONVERT32(STB0899_READ_S2REG(STB0899_S2FEC, FEC_CORE_ID_REG), (char *)&fec_str); fec_ver = STB0899_READ_S2REG(STB0899_S2FEC, FEC_VER_ID_REG); - if (! (chip_id > 0)) { - dprintk(state->verbose, FE_ERROR, 1, "couldn't find a STB 0899"); - - return -ENODEV; - } dprintk(state->verbose, FE_ERROR, 1, "FEC Core ID=[%s], Version=[%d]", (char*) &fec_str, fec_ver); return 0; From patchwork Mon Apr 15 19:34:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630642 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 E55BDC4345F for ; Mon, 15 Apr 2024 19:39:56 +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=6nr5NpTPg3+S6gVH+qauSg22tHuBGq1qfjLm59/dPm8=; b=XmlMnjYSMhPHLU uaiYfKP0oTMyGvkBLX/i0JjTMe1lh7QPaUjKZDwma4Fad2i668QrTHZGdQN1E25pgLJmX9k4509mS HS//xiJprwC/Gn4/Z9UvlnKzPPRrCOCwjwglGt249Bfm4Rlsch/wy1IcFX5fflHMrLSrR8Pol1UW8 Zi4zirpFzoryBjxXQvi4CE8ZIbjtKA5Xxt2giVGVY4tHBO1OzkLqWx+Q1ZQeHcAYZSw1rdV2RR20/ V43wwG2NgD3YYqdc/63rWtYoXOjS9QvH6LE03lznI/3fYVD2lHg3ziFzn0yk0baPQ8njGByr4cXYY xJVYAGlneMBwOoXFqs1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSB8-00000009f2l-1AIr; Mon, 15 Apr 2024 19:39:46 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS66-00000009bqE-3bLl for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:39 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-22f01274622so2465032fac.1 for ; Mon, 15 Apr 2024 12:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209670; x=1713814470; 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=vq+7mr1szAOvpscJpegvOEKeeaK/lFJAotzxeoFP90w=; b=Dap2LoyWw3Fi1Z/EqT97uA7GS/XVpVRddFrGcjNzH9iBzbSYkJvkK/yQhqGb+aNQaP lXSewnUznfk1F25QudnR5Fg2SOEat7pg6lQ6R0/UClgGriU5TIMb16E8NbS+JFpkmJ/k u9HfERQiwVhZb3OIAsDuhk85JW0P4JATBiwvw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209670; x=1713814470; 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=vq+7mr1szAOvpscJpegvOEKeeaK/lFJAotzxeoFP90w=; b=b0JqyYIf5hEM8/eJ2S4mVhFb8/G54XRIkkWmeV8ENfbsoH/AL6TllTgEntyqcAzBI1 HgUqa446Wke9YDgx5RwF89fwt/pC70t9AS9/1/sPwujxAhaxkheqCyku14uMgGlwOHd1 ZL4wvbFbmOcHRsfhYgCS5QWLRUSRz6xfr8BxwiISRRBRuzT3Cvk6Y1QLUQWLTlTbv+OU 0nLgQGWblZGLr5CzZUpvTQwMO65nVUmZY9TPH2XnppPZiwJ/VDSfiH5HanNpC7YLINwy EYReRsrlQk/cnbOUDn8u+zl1ca8hhKzqPN6lQgqzbBtqY/2vn022WGJEFHRO2J3CLadx /6dQ== X-Forwarded-Encrypted: i=1; AJvYcCVdc4IWaUiLO5NqjyV0rwA2W+6zHXvbMGUf3ii4LBNf+sATyK4yJPYJdcuJab4iAL0Bhb8PJwrFH/LlfQY93M6xrtj2LnN8/t+2F4rDcLpAFaEWl1Q= X-Gm-Message-State: AOJu0YyJloT0zC0K1VySiSBh2RYBkhkz1zAuMSr7PuhphbywnyriZlJP sHI+ay2KcjyJw4gF0R6sRtzmgkBCnXMrEQ3EosnGWNG0JraQBEvx8DVDAEY0UQ== X-Google-Smtp-Source: AGHT+IFDs72yHh14dMP/v3LcOXYq1AzGZaPkrHXx/btoSixg8uGduMLiI7a2hIPG7rGea4VcIV3D3Q== X-Received: by 2002:a05:6870:9a97:b0:22a:2e6:b82e with SMTP id hp23-20020a0568709a9700b0022a02e6b82emr13491647oab.38.1713209670403; Mon, 15 Apr 2024 12:34:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:29 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:20 +0000 Subject: [PATCH 03/35] media: uvcvideo: Refactor iterators MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-3-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123435_219729_89E63909 X-CRM114-Status: GOOD ( 17.41 ) 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 Avoid using the iterators after the list_for_each() constructs. This patch should be a NOP, but makes cocci, happier: drivers/media/usb/uvc/uvc_ctrl.c:1861:44-50: ERROR: invalid reference to the index variable of the iterator on line 1850 drivers/media/usb/uvc/uvc_ctrl.c:2195:17-23: ERROR: invalid reference to the index variable of the iterator on line 2179 Signed-off-by: Ricardo Ribalda Reviewed-by: Sergey Senozhatsky --- drivers/media/usb/uvc/uvc_ctrl.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index e59a463c2761..a4a987913430 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -1850,16 +1850,18 @@ int __uvc_ctrl_commit(struct uvc_fh *handle, int rollback, list_for_each_entry(entity, &chain->entities, chain) { ret = uvc_ctrl_commit_entity(chain->dev, entity, rollback, &err_ctrl); - if (ret < 0) + if (ret < 0) { + if (ctrls) + ctrls->error_idx = + uvc_ctrl_find_ctrl_idx(entity, ctrls, + err_ctrl); goto done; + } } if (!rollback) uvc_ctrl_send_events(handle, ctrls->controls, ctrls->count); done: - if (ret < 0 && ctrls) - ctrls->error_idx = uvc_ctrl_find_ctrl_idx(entity, ctrls, - err_ctrl); mutex_unlock(&chain->ctrl_mutex); return ret; } @@ -2165,7 +2167,7 @@ static int uvc_ctrl_init_xu_ctrl(struct uvc_device *dev, int uvc_xu_ctrl_query(struct uvc_video_chain *chain, struct uvc_xu_control_query *xqry) { - struct uvc_entity *entity; + struct uvc_entity *entity, *iter; struct uvc_control *ctrl; unsigned int i; bool found; @@ -2175,16 +2177,16 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *chain, int ret; /* Find the extension unit. */ - found = false; - list_for_each_entry(entity, &chain->entities, chain) { - if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT && - entity->id == xqry->unit) { - found = true; + entity = NULL; + list_for_each_entry(iter, &chain->entities, chain) { + if (UVC_ENTITY_TYPE(iter) == UVC_VC_EXTENSION_UNIT && + iter->id == xqry->unit) { + entity = iter; break; } } - if (!found) { + if (!entity) { uvc_dbg(chain->dev, CONTROL, "Extension unit %u not found\n", xqry->unit); return -ENOENT; From patchwork Mon Apr 15 19:34:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630709 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 642A5C4345F for ; Mon, 15 Apr 2024 20:45:54 +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=EjAjIx3+Tr5jmyNzm53+R98K1+EF2yUic6zvltCotFU=; b=GCv0vK+e4Eeqld EXiow9gBUI0LcKrmGhQpc4rzL70LhGG73oXT+Kf6eyR++CkKHZTWD5NRI8+keNrbdne1W/PewcPmZ 6f9dmUYsv+4RlnZVEMILaxEfVhxNyhsGzWMj4BiEOC3JMATiwANfrLKZmYdnyDdnZER4MgUKxpQEv lh5tbhGbvHi/FOnEBY8dRSqP2q/u9YT3RjHJG3Zlz8duYK5bh7KsN/Tv63dVOOWi9HC74pPQj1Qcj 79oZ6pWgH92Ei70D1LN5j9RMJmdd/Nv0PT6SOfcavgEUNJB0kv3aqVtNdkD7vyHtYdTKUKA6oDl/w 0I/Jkg9EHG2tiMhjLLXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwTCx-00000009s1P-3RgT; Mon, 15 Apr 2024 20:45:44 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS66-00000009bqK-1KLe for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:38 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-78d5b1a34fdso245468485a.2 for ; Mon, 15 Apr 2024 12:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209671; x=1713814471; 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=0M0QjtxbXw5Jbt1UmA7dF8uJnSqjZdDcQqjFwr3Ktis=; b=gyTDEAfQ2y5Zb3DOFftNToixljDiHIUT1rJKPgzyl2z0iphZvZ0pwSrvsVjDHAICt/ tnX9mCtpkI30Fxo2o+/m5dT/cYwZRBumwWgZxFq4iJhOLRUVjXbzLr1W0bXQ2/cO5ipT sD7gWcPyBx3S78xYDOFd/ZHAXBBq6GwvUeknc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209671; x=1713814471; 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=0M0QjtxbXw5Jbt1UmA7dF8uJnSqjZdDcQqjFwr3Ktis=; b=b8VH1htO8t7ygF6yN8K6w+b6A34buzc3QN0p+nPbGW+u5UmTtU/I43Jj3K8rlQzTeA fYFJY829brN5XIByLIFVJ4nwAJqIfvljBDmLhtNBag7r7G6HHC5ClQFTtWEUvEkBXfnE tJYDIVcFzlussJg7xA2gqCKwGAUhxnCqznnkRRS8gO58l4FPXWpr5uJtCBsyvV2QmAjP myF8PrCRQj6IlkzPT4XsXXxQZ51tlNCbVK5akkulopUZEmwlyPrnN2Uy6FglHRfCmzDV QxFsYzqNAOKKXi9go14BI72JV7RItCgN3zmnaiJxYAcow1fAJHNKMu0l6NNsHhNOVT8t H4Tg== X-Forwarded-Encrypted: i=1; AJvYcCUMrdbD3+SChjDu6ug9/j2995PNONgMKlUpL17VcIkH+a79u393JPPBXGOAr/LHb2MNoycwlmoUr5Aj0cHcoAERWelDpqrDZXlPVfhQh8NsrCEFC7g= X-Gm-Message-State: AOJu0YxS+SlrG6nkrHDWnO5KY7YCIMmobBVnynqFQaEskZEHb1SRKDE/ 7KUOIhAEg76x0ZSCfuZ6YXEAQGpiUPthr4LHTH0itt+WroDz4pGXXHo/xHzDGA== X-Google-Smtp-Source: AGHT+IEqj59jRDGSbVB+H5v2oX0HE1xlFJSWXdttWaWsHugr/F+aCppE0zEJT1gUi+zgVZvdSbru2w== X-Received: by 2002:a05:620a:12e1:b0:78d:4424:b286 with SMTP id f1-20020a05620a12e100b0078d4424b286mr11683901qkl.39.1713209671340; Mon, 15 Apr 2024 12:34:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:31 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:21 +0000 Subject: [PATCH 04/35] media: uvcvideo: Use max() macro MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-4-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123434_636061_59195AED 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 It makes the code slightly more clear and makes cocci incredibly happy: drivers/media/usb/uvc/uvc_ctrl.c:839:22-23: WARNING opportunity for max() Signed-off-by: Ricardo Ribalda Reviewed-by: Kieran Bingham Reviewed-by: Sergey Senozhatsky --- drivers/media/usb/uvc/uvc_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index a4a987913430..4b685f883e4d 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -836,7 +836,7 @@ static s32 uvc_get_le_value(struct uvc_control_mapping *mapping, while (1) { u8 byte = *data & mask; value |= offset > 0 ? (byte >> offset) : (byte << (-offset)); - bits -= 8 - (offset > 0 ? offset : 0); + bits -= 8 - max(offset, 0); if (bits <= 0) break; From patchwork Mon Apr 15 19:34:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630595 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 1F114C4345F for ; Mon, 15 Apr 2024 19:36:06 +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=6vToNhB+BqMhMGqLzBZOxrdVoOavY3DQnWM/yqkjnsM=; b=XqcrNm7FiSrfHr Wj6qqQu+Pqk4CPwR7NlG2/aKpymZDcchYPf/H2KLJvbRzOE1qCeTrFLqsHnVYlHyc5RNOzOvrLRP3 +GAlNGRZN+Pm+1iYKMOZxdGHPHQmYyc5pFpD7wSP9GNA457mAQk/tDAGdusUojOhWBf7ntm9JB/ig EHVmRGkLVNhX3Qg6dyLaHor+5zXChCI/KobuCBktDFDKiggFcS+QJI/aBpjCX36XPKex8wAbx/gY7 exTuiREfS4eeajxyGDDDpURXt0URHYw1uP/U66asUD0qEkYN/4KHizrW1m4kJoXlL/cu82pl0eub7 ig9yB4ukJ/suKwIopYBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS7Q-00000009cq8-3OAS; Mon, 15 Apr 2024 19:35:56 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6E-00000009byu-3F8Y for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=30a1609TFHVDYvbsiCwVx5jyS7S7qnpRfAGqZPi3zic=; b=BvB1KLSEPP3HD0hAGF1hlODJ2q gIVXK7cyalUDbY0NwsiY7c0Yb/DvZKiU6j5OU/6Lxf5Z/iAFh8wlyPzQKP6QVR8crJc5Uj9+8Rqlx +SNxG0WMbFZ9s4KW20EF3zUI66LaECXkJdLLPmil/y3s07lHDUjGY3esn7b9IM6RWTtUDA+T15qeC faEXG35crlACLfmkuPvNHbKFU6s6WbRrKOHLZ3WMWFM6T6ElYwJ6i4CwLkAGZQzAQSOrkEeeeyncb C0rjIMuUt89uKfIH2kAuabv2opQCe2FRR29Cbe9tpa4BT5yCQlzx1zqqDNWAls++60lS8TZZtUDKd 54phgm/Q==; Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS67-0000000AieV-0hLw for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:37 +0000 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6eb797e10ceso1201261a34.1 for ; Mon, 15 Apr 2024 12:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209672; x=1713814472; 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=30a1609TFHVDYvbsiCwVx5jyS7S7qnpRfAGqZPi3zic=; b=ikth4y38JiQWoY5y/3HuiOVTJOt466W4Ns+6/KC9aWf+jtNhY2RhFrMJ0X2R287d9N nn6PNc7wMa1T35NvydIRUlv3wnuz4R3Sn8JTMhpeP4yc4teFB802m3i3HfUJK89CoOvY rHYVDwJFWWIk2Sf6j+38mlPnRIx4swiUk14Yo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209672; x=1713814472; 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=30a1609TFHVDYvbsiCwVx5jyS7S7qnpRfAGqZPi3zic=; b=pWCeZwVGBDh7DHlVFUN+95ceB099N/rtWBp1Ybe7n3W6oH/cXsi0MoASRxxXJX+ek1 l7hsEfVXXm03qHlQEviJB1i8V/SpQSsQkgPnQCpFZkgO/JvzZipI9HhWMIyk8ea1hz4o YknbmqLJYa7XO0Lq2KON8BQUfOgLAP/FDtTCcObrJDZ2CdouOyHDeJK4NpNa4CYVqMbk 5xbGMQsJnlUida5cLrP0DrB9UemP7Uv/dNJIorwd5MLirJWzkaopJGtMEyUeHT59ebwv IcAnIuy3k0LT+yeL3ZtDxxPXReUrSk+HAO6wqHoLKX6GI+KDfq6s2IVI0OOYHv7Y1Fkg mpJw== X-Forwarded-Encrypted: i=1; AJvYcCX/mlPYBvJ8yzIaVPrtUlaP7wsSZkzJsVuNuS7PfSWFlr+K3OOHvFYIgAAKxGKThR3yn46Kn+N/C8q792p3mboQ06YS2R34uNYl2SD8PvBEQ7Qzq6o= X-Gm-Message-State: AOJu0Yz4UI+srQhDkh5fu5c+tKsGIc3DLKx3C8QuPMJxLhiUlb+rhndf 5KDPis6ksrQucXWt+PNtl4NsVa/H23T2XXb5+axdy9LYMs8eNyBEL0MpsazGNQ== X-Google-Smtp-Source: AGHT+IFajy4caV38o9egD00xBm8+r7fFdvax0FnbVE1biamOQ+jag9WqCsqV4RWMv5Us6Un2NRlLiw== X-Received: by 2002:a05:6830:14cf:b0:6eb:7a07:8746 with SMTP id t15-20020a05683014cf00b006eb7a078746mr5458830otq.31.1713209672276; Mon, 15 Apr 2024 12:34:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:31 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:22 +0000 Subject: [PATCH 05/35] media: go7007: Use min and max macros MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-5-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203435_948576_502B905D X-CRM114-Status: GOOD ( 12.91 ) 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 It makes the code simpler and cocci happier: drivers/media/usb/go7007/go7007-fw.c:1292:14-15: WARNING opportunity for max() drivers/media/usb/go7007/go7007-fw.c:1293:14-15: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/go7007/go7007-fw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/go7007/go7007-fw.c b/drivers/media/usb/go7007/go7007-fw.c index 018019ba47d4..86ce593e0c54 100644 --- a/drivers/media/usb/go7007/go7007-fw.c +++ b/drivers/media/usb/go7007/go7007-fw.c @@ -1289,8 +1289,8 @@ static int avsync_to_package(struct go7007 *go, __le16 *code, int space) 0xbf99, (u16)((-adjratio) >> 16), 0xbf92, 0, 0xbf93, 0, - 0xbff4, f1 > f2 ? f1 : f2, - 0xbff5, f1 < f2 ? f1 : f2, + 0xbff4, max(f1, f2), + 0xbff5, min(f1, f2), 0xbff6, f1 < f2 ? ratio : ratio + 1, 0xbff7, f1 > f2 ? ratio : ratio + 1, 0xbff8, 0, From patchwork Mon Apr 15 19:34:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630597 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 07CF0C4345F for ; Mon, 15 Apr 2024 19:36:38 +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=JN5K4oGkf0ulKlnWtuRVauLUCSUTFgeIgyea/ANHZTs=; b=k+aQIYUfUAw0My nOqUvCNPpHL+XOF0ZU+e2cTxsI39zm0OF5fJpA7O2UOuiyLy0NGzClDKwwCDz3mPfoRvD0tmCoHu7 hDKgXJadvTcvvCj1yJR6AQij76vZVykO5YOhOws3I6eVB2I7BOwKIEiECwOjaI1Jxpz4WewzXfisM Gf3CKj28F4YbRNajl0SAgFCLnyHVbwTAkeVJLrf/+Toywtc7fevuYX1HKmPkqpkYU8XebsOb7bVtu Z1rzaTWEDYt18OHZBZG3EJXo6WVOwPcOAdybA/6dMD9ImG0XeU3KcN9kL0GUT17GO0hn+cR55m0+J ym56tGSDVfRNZ42foAyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS7x-00000009d8b-2ZRU; Mon, 15 Apr 2024 19:36:29 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6P-00000009c7X-0HCf for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=8w49vqOwnRlIfNq1dtx4OWinIRfPHFawqCMqrawnhls=; b=NSlsQVIk33soXdkwBwoR05Gug1 h16yDvyzaPDQuZydp7MpmvlzmEXsSFwZtz+jb8LFoBwVdDUF/tXOwWVh92w2QHkL6vGVmPXsvoh8Z w9u+FUei+qTyAXfEBjqcrqWUuK5n38o/VKqGa4T8XQOWBxKdSQ7NlqRdVDE8Vd4DPfjRsbM6vYNS9 mle179HN+OQBIoHVfoy70IrF6HtnjV/SW2Kw+ejKOILum78yzXBFWwAfITY2/u7dW7mmF6lp9gFX3 3M40+4vsl2Qf0Lkph+Pq4RZY8XtP31eeGM1WOH87x4Q5w2EIsrPByiHZmWmnJUodByLR1S+xqX5aJ 19HS1uag==; Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS68-0000000AieZ-0MCr for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:41 +0000 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-78d5e80bc42so314622385a.0 for ; Mon, 15 Apr 2024 12:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209673; x=1713814473; 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=8w49vqOwnRlIfNq1dtx4OWinIRfPHFawqCMqrawnhls=; b=SXSJyJOE6QQC/V7SLIkSUMATmbOkbIb5YEyfdEhY/7XGHwgQjxysZItg+rCQckT++P LZGPXFkWg6nOi7YLRZzgHFopaFap6JaLS2w+jZ+HIQgGLl7N1jin/Quz6C9EqcvC2BUe vfSjjrnoiutARqtToLBD9H77Sd0dnTjK12UX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209673; x=1713814473; 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=8w49vqOwnRlIfNq1dtx4OWinIRfPHFawqCMqrawnhls=; b=IjhoPBx1HvBYcUIkEPVDG8Gibni8++0LG4u/IJD6Zaoib8sxgprhpLFVsBBMnZoBZm Yl/lxY+9fiG+5vZeq/b615/2zmu/Ol7uc1IeOS7EOW+LPfTHc7vvMud5BuFWNR4g/bsM q+L43T+0FsMtD8zgInDsEOBeHfcghl78lTdo8cv00cYCK8sIf4IfcbHYp7FXgx73IGzL X0bCp2lxMQJc+FJPASxigULytDzofMgPv3kreDsRso1nXKA9V34LhDZtXZ+O78WVa8+Z EJ9hGf4A27cjZIt0X/vtgCx2wchfLMNqaegxV52hU1rjjkXkl+LdF6DUBTx7sZWfR86w CLLw== X-Forwarded-Encrypted: i=1; AJvYcCX4bieSPQfL30GnifDFVRYIjM/ItCtjj0X6tDYzkhAdMW9q+lIxb1WwzYvK6K5olX489DbSQ6Ze+ofWE7bfwM24Wklkvsta2zlIoAnn6jZl3fZ7eng= X-Gm-Message-State: AOJu0YwnupGVMkfIElTCpFTN8W9TSPpGBNl+3UFK/Tp2hyRLdbJeOAcS J82qjmFWeXvUUTacNPAmPJ4A1Qw6DFFydxxgtgsoAAJdfp6mFQw7eTiZDEXRPw== X-Google-Smtp-Source: AGHT+IF3Z64gOvH813ZrsURn6c5OX0cA+P7DewlH+o86rsWDf5urUOYDJaPeLXGD215pMul/2CCAvg== X-Received: by 2002:a05:620a:5e48:b0:78e:e7f8:a5e3 with SMTP id ya8-20020a05620a5e4800b0078ee7f8a5e3mr3707352qkn.52.1713209673334; Mon, 15 Apr 2024 12:34:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:33 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:23 +0000 Subject: [PATCH 06/35] media: stm32-dcmipp: Remove redundant printk MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-6-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203436_631471_3EA6B35E X-CRM114-Status: GOOD ( 13.80 ) 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 platform_get_irq() already prints an error message. Found by cocci: drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c:444:3-10: line 444 is redundant because platform_get_irq() already prints an error Signed-off-by: Ricardo Ribalda --- drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c index bce821eb71ce..c25027b0ca32 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c @@ -439,11 +439,8 @@ static int dcmipp_probe(struct platform_device *pdev) "Could not get reset control\n"); irq = platform_get_irq(pdev, 0); - if (irq <= 0) { - if (irq != -EPROBE_DEFER) - dev_err(&pdev->dev, "Could not get irq\n"); + if (irq <= 0) return irq ? irq : -ENXIO; - } dcmipp->regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(dcmipp->regs)) { From patchwork Mon Apr 15 19:34:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630643 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 25CE0C00A94 for ; Mon, 15 Apr 2024 19:39:59 +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=p2ODGpmvRD12gMo46OkkmdMfRQsI3OEZ3QWws7nhBog=; b=iSW88utVW0wFrC mpkaxrXxG7Nv8QFJsvaR808+qms7wE+QeC5k2C7v9CYAK21lJSsrOep6pS7b2fQJXDW7TnyAJsi+7 23Q2dA6COMdUhBzMyLV/CmjRIt4CaSbZQy3iyhJgjFc43bdHYam2NdqfGEcRGvJQYYd36hAMhKQkD 4o/JcXZ3RPROMXP7gTt29KI+mH2j2NKKg26KlVmBP8nOmiTGKQcPX3C4eDy88F70V3ldTeJ1WSnYk mgFAhVIhzKnMXw9r2In4rS1iYOq65MA6PNRMXQ/SzJ5o+euruVNkqI7HjDaIxD4eio4w/TZyvrp5E 7E7waqguCXSra9KJ84Yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBC-00000009f4O-0uA1; Mon, 15 Apr 2024 19:39:50 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6O-00000009c6b-0UJw for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=Zm8YRFoKsGw65QxzcHtGCuYCsdcn5gIPOa2id9cD3ac=; b=H/qNeyf5LiMnGNsZhrpS083AyU qhM+3VJDYmMryldJuZDCqYfQD0ZP0qDKma1Nh/6vqr3BiNr1RdtUCYyQAGT6oc0HTN/a2c+E7HKY/ IU8jTj7quzs/Sg2ihbfRE+YtLAxpONh2F2E8xGx8ZR1SS8yoe7ZZ/GZhV2xXYDhQJSpEB1070dP21 x1k0QU04yoZJJRgD9xqx7NP+flhRWip6y3XD6CZW+pGNrXoiv59sk4cCxvpW5J3DEwt3qFX0WVoFC /YsxKQHtSSmnvNedFY4zvT03hEqXJmrawxPqIDs2S65gQ0ryn7Y34ciERtMwxYhOkXyxMGcfH5erq hNFf7HgA==; Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS68-0000000Aiea-1hLa for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:41 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-78d61a716ddso251504185a.3 for ; Mon, 15 Apr 2024 12:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209674; x=1713814474; 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=Zm8YRFoKsGw65QxzcHtGCuYCsdcn5gIPOa2id9cD3ac=; b=D5oA5mCj9RIRR4eNjdBJce96+65iVx+VnAuHyTWLpFf1x9MxJDH+/wez7/DNs4ZBGu bKi5MBCQh4SkBuHhALCWmas9fTQOEM1SYqlQft3yvmbhhG0mYTc8VKFu6Af+0UZwEbjB mapjJ7nCPJpWrALJN9R4XpMtyOZmPtaTt8GoU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209674; x=1713814474; 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=Zm8YRFoKsGw65QxzcHtGCuYCsdcn5gIPOa2id9cD3ac=; b=Xk4qSqD6bQ+FDRfatn+fZT3hUFlJi5VVfAgFprH/JijD3eXKt9owu0CN8tQ5zMinJj +BOQXiuq1kE0hrRZHIij+00tQEB/7zf7caLEAw2FOBFLdHOJCcffSHUknZUXiWDeURg8 EdLpyASpbpdgTbRh3uJuK+1WpCmPtUmZkjYPGgcrbxtbNY1ZU/LW0ogvAMmUwoF2TxMF Sd9guqGSBXeiWOw1kDobiYKDCcKVZOxUT49qiG3t14rrF8vsw3MrtVBF+pY2dEdaDlwU 2H+h+fzAa1EKKQ+PE58kBDRbJva/RQ853aOpB44QFjviMymt+5jU7GMKRRJjEI95QzfJ 5skA== X-Forwarded-Encrypted: i=1; AJvYcCXHBfVlY9H8K4H/iQK54st/XEPAelc4m4C2WldKq+hrwSkmC1Oq6pynYCVHoHy9Zl/PN3zbGge82IC+Z1BvZB/PO8vt0K2/0WSyJmqZO2QvRZhPCRo= X-Gm-Message-State: AOJu0YwwWyLH2Br/jsuODrexF3eCqDspdHSxD8bTynexTafbBQ+a7Ut1 3NojxscNW5XV62hymX3S7F/JDvIiOGWsA5/bwktbLhkiMHQgFDrZJRZPni7H1Q== X-Google-Smtp-Source: AGHT+IE9q0KgLtAucdxZbWyn6MqzUt/EZtQ+H412AW7kKWoV5ItTNsK0gfo742OJilnTZ7BcAn728w== X-Received: by 2002:a05:620a:2116:b0:78d:61e8:2f12 with SMTP id l22-20020a05620a211600b0078d61e82f12mr12082197qkl.57.1713209674381; Mon, 15 Apr 2024 12:34:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:34 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:24 +0000 Subject: [PATCH 07/35] media: staging: sun6i-isp: Remove redundant printk MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-7-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203436_866095_EF3FC78C X-CRM114-Status: GOOD ( 12.46 ) 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 platform_get_irq() already prints an error for us. Found by cocci: drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c:389:2-9: line 389 is redundant because platform_get_irq() already prints an error Signed-off-by: Ricardo Ribalda Acked-by: Jernej Skrabec --- drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c index 5c0a45394cba..a6424fe7023b 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c @@ -386,7 +386,6 @@ static int sun6i_isp_resources_setup(struct sun6i_isp_device *isp_dev, irq = platform_get_irq(platform_dev, 0); if (irq < 0) { - dev_err(dev, "failed to get interrupt\n"); ret = -ENXIO; goto error_clock_rate_exclusive; } From patchwork Mon Apr 15 19:34:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630598 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 EAA50C4345F for ; Mon, 15 Apr 2024 19:36:51 +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=JLnjav+r21V5ItwAxxzEq2sheNPN991mPqdw3qf1ojY=; b=AB1jwa85gmHTir ILWU9dQytZZ23/DmkpUolc7cFJkHJVKDArwCDVIGqHRC7s06CyU94Jv/K8z7ieK12E4d/Rxv0zmIF jFHu2wFlrXU3Lrpbj6/Lr26GZYwG6M0oDL0GAdkpk1KxuIidXqkgKH/MAlScbHOxnfKOlELBLUS64 idcLVheknxd15n7jmAmQG6l6TkKU1bpSf1Rt2Pl9MlHgFUV3vU5ixtnX+532sl0dyxYEjonQ1q0cL aEYnrGHhBqcgEp8sNWjdnfpkJmBorTICbLAgSx/a7PfR+sV2/HPvOk3lAppPwfFxJlFVfCil8JrGx CTaChV6FzIAcbKADlh0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS8B-00000009dF9-0NWa; Mon, 15 Apr 2024 19:36:43 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6P-00000009c7h-0ZiT for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=ISUo+c+Z6d9jp43vDna7WArpy0Bh/pUYqJP92YgrR0w=; b=l0Av8raC/o2/XevB/036t1E2Ec 1J42zTeqdJs7JfgPW4rY+Y6fMX/C0m6rLd784+AVCc4jJxb5DDHflKIqllNdNQslnprzrLgZIOoKt 0WaI6qTQvdZzw4FdTPSnJ4wdyiq4YzxH7eafqQrh1NIENIoBTaYng+IVn/8iHAPQM9OXpzj/rXHOI q2/02x97/XyEilzZ9/8rL3oaqdXXgZaCKkXTdsJNJdN2zHb2fD1t2Ev7XcO3Tkfyeieoue0YcTA7F cb2ZjG6ruwNdp1GZtD7awhbmr6W0X3y8dpiqRFo6/yH5+4PzpUUGJWqSoFnezYehAElCf40QN/lHO PkA0AX6w==; Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS68-0000000AifN-3YL4 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:42 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-78d555254b7so293822185a.1 for ; Mon, 15 Apr 2024 12:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209675; x=1713814475; 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=ISUo+c+Z6d9jp43vDna7WArpy0Bh/pUYqJP92YgrR0w=; b=ZLnXbA3mqK2Cf2rWguyE35J/nEps1Al5jk6H+nmWqyO4aQXrMTd5prsKm+fco48SAi Hmh9StfZPWwfBUN485PC4JRl/ZQfFzcN4vA6EIsT+9NBP1Iw/G2Ren5ixp//3ffhMpHr mXZ9/E3Zt7uHT35GNgTr7ggrz7u+lVOypnPcI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209675; x=1713814475; 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=ISUo+c+Z6d9jp43vDna7WArpy0Bh/pUYqJP92YgrR0w=; b=BV4YoWHuh8UeGUXi719dczRvrN5SdNYPsNErZo6mO02d0/1LvkguUKIw6dm301PQkz qY/DFTF4nVm9P5Z3BoPUbZWM6FqYV1F+yZTainnWyQHoo5CvVKdeLwNKMrpFJyMqpIH5 aluIB30LkCXIdtcqrXCJBE5FWKgV7S6G4Myo4w9yMkCD5AQD44EI89fTB6JbNC4TpOEn mCZtCmrEMotfn6Q4RZGs6H+GupNZr+Y7NgtxofkC4QsBZvQOckqxRWd3hekzVkFpwcCb N7Q0dOjSENY381fHTepFpqxFuJaJHm5IArjhDy7HqeXXt6p/amPIkkBksSjUAgRsqfC2 5daw== X-Forwarded-Encrypted: i=1; AJvYcCX+VyHzvC6KlN1EVtGxaJfCilJfALuLzHuo8rd0jTzJyI8oUvH92InaGP78WRLgYvwNRLZYZsJafruxBerStgBO6gARxL3jRHOFYa0zTHUc4kSRSjo= X-Gm-Message-State: AOJu0YzsZrMysGc0uNn5qUBUxDpNRqMgMWOyxtSgodHtQGlaku0TFppX gq0BF9BjpTmxzx5kJAZuw+kcwhgrUamrgGv4lqMdY7WEdJ6Y+u4/TphqPPSAJQ== X-Google-Smtp-Source: AGHT+IHNEVyzd3evramKoXF4voaYnhuPvr7ES/TUx15oMijuB+fT7oxPAB5JZ66ego178FVyftQu6Q== X-Received: by 2002:a05:620a:470f:b0:78d:3b55:21c8 with SMTP id bs15-20020a05620a470f00b0078d3b5521c8mr1321999qkb.24.1713209675268; Mon, 15 Apr 2024 12:34:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:34 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:25 +0000 Subject: [PATCH 08/35] media: dvb-frontends: tda18271c2dd: Remove casting during div MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-8-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203437_628058_CD93ABEA X-CRM114-Status: GOOD ( 13.28 ) 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 do_div() divides 64 bits by 32. We were adding a casting to the divider to 64 bits, for a number that fits perfectly in 32 bits. Remove it. Found by cocci: drivers/media/dvb-frontends/tda18271c2dd.c:355:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. drivers/media/dvb-frontends/tda18271c2dd.c:331:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/tda18271c2dd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/tda18271c2dd.c b/drivers/media/dvb-frontends/tda18271c2dd.c index a34834487943..fd928787207e 100644 --- a/drivers/media/dvb-frontends/tda18271c2dd.c +++ b/drivers/media/dvb-frontends/tda18271c2dd.c @@ -328,7 +328,7 @@ static int CalcMainPLL(struct tda_state *state, u32 freq) OscFreq = (u64) freq * (u64) Div; OscFreq *= (u64) 16384; - do_div(OscFreq, (u64)16000000); + do_div(OscFreq, 16000000); MainDiv = OscFreq; state->m_Regs[MPD] = PostDiv & 0x77; @@ -352,7 +352,7 @@ static int CalcCalPLL(struct tda_state *state, u32 freq) OscFreq = (u64)freq * (u64)Div; /* CalDiv = u32( OscFreq * 16384 / 16000000 ); */ OscFreq *= (u64)16384; - do_div(OscFreq, (u64)16000000); + do_div(OscFreq, 16000000); CalDiv = OscFreq; state->m_Regs[CPD] = PostDiv; From patchwork Mon Apr 15 19:34:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630599 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 146F2C4345F for ; Mon, 15 Apr 2024 19:37:04 +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=vX1PwagOqddGZ6+QT7PkARliRmXIqvA5eDaztt1pw+U=; b=HbX8XVlWy+PMug 2VHwRbFpg09HgZ7PtGK4obkRg2BKjfHF5hq2X19AnNDHyk2BoS+uqFa1tQrkwzuyXpWC1YR7z+nn9 s6cit3bKAMP2HqEMiDdyOa7FLNoXC+GD3oRR+kQv9F/hOv/H2Pjgkdcnn0EM0l+JRO/WtI7rl/W0e Br9N49pj5RP1/kk3zGihFMNHQNThp5v0ZISMXJ3U3ntQnRS1qpfEzV8VD5EWkP4/Yq6P0SKnd0Roi novK32zWad6SqLdZdKXsSgjSJVe07xlnukBmf+lO3uBjJzSYVjnW+vBJGdenyUOeva7Xx4kZknEKJ Qvo2mdoYLVts9GxGXZ1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS8N-00000009dNP-11M3; Mon, 15 Apr 2024 19:36:55 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6P-00000009c8G-3VvJ for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=bek9HrODBg0M3bgnVqO/LKhPssOu/ibs61pEEfKBgdM=; b=QqRf+GvMV5o2FDE7rJBZusTmsL r3GbDHslzoKp3YyhfODvq57MSVSP8P3JQv3sCbK36rts6aKhU18NRcTWq9tL01WyEQ3x2QR3GoTiQ ug4jipYblsnyCqDyYWialHnqJOmEDWP53N+iqUASJlyeZ8qGAZ/vExP64fnzrywzI5z1E5gvVdHss 2b3hKaKgoLrzrb6WN8vVUIfNuTZpO0RhUbVnSkzmFiDzEGTrpAK7rW8p2AV6QpJdNRqeSiG+Tqo8f UpvF/O6MbCKYTzh8zpJrOQevnHrgSxgLGK1JAhQ8GntM/Au2Pmisfm3ZgYd7SO98v4nF2h4qQq3+T VOnl2rIw==; Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6D-0000000AigD-0QX8 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:51 +0000 Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-78d57bd5781so264753985a.3 for ; Mon, 15 Apr 2024 12:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209677; x=1713814477; 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=bek9HrODBg0M3bgnVqO/LKhPssOu/ibs61pEEfKBgdM=; b=lGIpfzBEEmX0MSiI/rwwrSvMa2ZRGrJvY9m5EMXq4NMMDR79x7U0GX0C+jBjbHTCXE Ee/CC4ptBEaFBVZLE3ND1AEctXSBueNFVeJqPk8Y7cuC9reXZoP9m+lcNi86GZ0djqp+ cibEgreOlVuglIvVWKlnbpCPcqrHNY4jHua7Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209677; x=1713814477; 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=bek9HrODBg0M3bgnVqO/LKhPssOu/ibs61pEEfKBgdM=; b=we7FuLBU9oyPn7GHwvyhWtxV5Y68kPNh3PN5r9xbOT7AZdbgebijYmBNdgGFRRRDDB p0exe/jRybpEGp/1KfhNcTIDZCYNcT/2bqcor8jk9OxlY9+3NTQ2gXNsvLkWtqxHwUYu 5J/nPR/mj6nZydivAUkUHXN9ufx9YC6J4U+xCGJr01QwpICMcemKR/y9xsFJT6YpMmZG I6MD/euUUVKGueJ3eKpNN1oDqYKMe9vsa98fv8FKU4QTXhwUEkTgR/DYwEZaM4lI8E/n 9IDTHWJuH8wpnRGlvDPO6So9ITu2BrrX3fmP2cY4kWySI8gvtLhUSPlFEwiNSsL8ESmz UyBw== X-Forwarded-Encrypted: i=1; AJvYcCVyxmgBRI9REao2RcZatC6a3lmtUrLTTALcxNUXsbTuE1mjoZXrUWiCRweumxYCcgR2N+IDe4J3dSjmJzJTlXhsYsUhOTJfieYpyP2e0owvo50ECYE= X-Gm-Message-State: AOJu0YziOdzOQ+AexW6gcXZm3NDibhKpPevx0YD3oDQZuaXNCV1daW0+ UTnno3GdkBmfB0HStDuV/BuaL9mT/cRRZH48J5cEv/JVLwSH0mGihD2rujD00A== X-Google-Smtp-Source: AGHT+IGdkApYbK4mkbCfGsE7agdP/ocKeSLQEP1wZl23ZOICtEnIFWB9MCiZP2rFcKrIOjZRFtHqpA== X-Received: by 2002:a05:620a:611a:b0:78e:e035:e898 with SMTP id oq26-20020a05620a611a00b0078ee035e898mr4919595qkn.75.1713209676753; Mon, 15 Apr 2024 12:34:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:36 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:26 +0000 Subject: [PATCH 09/35] media: v4l: async: refactor v4l2_async_create_ancillary_links MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-9-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203445_740017_EC1346E8 X-CRM114-Status: GOOD ( 13.17 ) 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 Return 0 without checking IS_ERR or PTR_ERR if CONFIG_MEDIA_CONTROLLER is not enabled. This makes cocci happier: drivers/media/v4l2-core/v4l2-async.c:331:23-30: ERROR: PTR_ERR applied after initialization to constant on line 319 Signed-off-by: Ricardo Ribalda --- drivers/media/v4l2-core/v4l2-async.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index 4bb073587817..e26a011c89c4 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -316,9 +316,8 @@ v4l2_async_nf_try_all_subdevs(struct v4l2_async_notifier *notifier); static int v4l2_async_create_ancillary_links(struct v4l2_async_notifier *n, struct v4l2_subdev *sd) { - struct media_link *link = NULL; - #if IS_ENABLED(CONFIG_MEDIA_CONTROLLER) + struct media_link *link; if (sd->entity.function != MEDIA_ENT_F_LENS && sd->entity.function != MEDIA_ENT_F_FLASH) @@ -326,9 +325,10 @@ static int v4l2_async_create_ancillary_links(struct v4l2_async_notifier *n, link = media_create_ancillary_link(&n->sd->entity, &sd->entity); -#endif - return IS_ERR(link) ? PTR_ERR(link) : 0; +#else + return 0; +#endif } static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier, From patchwork Mon Apr 15 19:34:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630592 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 0655EC00A94 for ; Mon, 15 Apr 2024 19:35:30 +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=OI8BNI6iWmsnVWt73fz12FJaWPT8xjWqySrFDJVvSuU=; b=GsE6TjndTRC512 yzv+d7dPtF/cJxaq02KLVVliY0DUsNCtEdDGh/CkbHgks5eOm1QeXO3AgJxBO8W5Q7OJdZYJVIJyt espx32FSnTUGEIAYzpdq8aFmTY9oo+ZaKyPSjZI57tanlzG1b8mWGlBsLCLrYj9ahEuIrQ5G+/+qm XD0auzX2SB6S8xV+BzVskxBynlKELT9yrjzzXsyggbKW2jqR9zQZ2gMLi2XMLUYBjQr/Mc9PDRajd xZKrtZvzi8QcBjhkM3woX/3z5ApnfE7CzN4jZ5aT2ZYYzMquL34mfvVFkmzh8Y18Glt4Snc/miswt w8nbDmNfRP7i33Ocrerw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6r-00000009cUX-2cZp; Mon, 15 Apr 2024 19:35:21 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6B-00000009bwC-3ChD for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:42 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-78d77b309f2so322267985a.2 for ; Mon, 15 Apr 2024 12:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209678; x=1713814478; 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=iffer3/QisAZiMzK6e6qkKJFt6oDSvxeznUoOZCft7U=; b=k32ury/s5Q8lQh992GFLxEC7DgQw93ZPNHk9zHV3qc34Rlhu/GMkqwao4/NddupoaY qWCOaA15M85byeGpxJS7uEb+4X7vjSvPPHqxr9E4C2zgYhVxz5HgXe2rCgx1w1CMRJOv hbqNVn1E+ONpRLKaa9SdWrm9BMNDD0ZcmNYWo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209678; x=1713814478; 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=iffer3/QisAZiMzK6e6qkKJFt6oDSvxeznUoOZCft7U=; b=KEfTwVFPk7FpbXSIMXVxB5tqSSXmDftVC3DNeNvne24OMrcTWOBBkrkZPk4sAhV6C8 KxMrusvE9Csp9JMkKetW1m5+kZ3FUQSzcNl2lxRhtg0yQlb9zyFKIqYiX7Mr6GYT6Mbm +5o+7cSS010XLXO6vkKN97Ov4fVuPs/3i6V5VGNOuBC3x0A1lmInmaeGxs1/FgOC/ozP BOBoFoaSFnuoCLH7SKLI0L+loADdId3iPXJ97aNP4LyAhIYjeuaC5lTBUmwKicxHP9yA E4dHQaaba59hBNpvPXqMlJXP8fBKfV55y0BU839GGhYP0NTt4F7gFWSgIO02ZMQ4TEIj BmxQ== X-Forwarded-Encrypted: i=1; AJvYcCUhxOgQEM7Awj+wkdSPu96puCj1r2tRjg33EU5IyGM9xFZyLDiZH7s0D8V6cjrHq7o4FKsyOxNtc8qsz/q+n4PaBYd4GmIFFfnQukmcp/08TzH3xFQ= X-Gm-Message-State: AOJu0YytIjBojtgV44B2fKwaLTRPEOzi7Jb3quiNC/c91HTStPD/vlqt bnljO6qhDtSZSwFUK0GI+A1RvEppZr9B0+TJUn40bxFveRjCRdGVE/RzDB0+1g== X-Google-Smtp-Source: AGHT+IFEHU7eIzT8/HtrN2B+e04dqI5HiplT7bCOIBdeXvPZpYPaOGCG3Tv+rHX6H2GzPAb2+GvQRw== X-Received: by 2002:a05:620a:3b8b:b0:78d:58d2:b600 with SMTP id ye11-20020a05620a3b8b00b0078d58d2b600mr11752858qkn.42.1713209678448; Mon, 15 Apr 2024 12:34: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 s26-20020ae9f71a000000b0078d3b54eb76sm6718055qkg.78.2024.04.15.12.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:38 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:27 +0000 Subject: [PATCH 10/35] staging: media: tegra-video: Use swap macro MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-10-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123440_332548_FA41F8DA X-CRM114-Status: GOOD ( 12.62 ) 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 Makes the code simpler and cocci happier: drivers/staging/media/tegra-video/tegra20.c:324:44-45: WARNING opportunity for swap() Signed-off-by: Ricardo Ribalda Reviewed-by: Luca Ceresoli --- drivers/staging/media/tegra-video/tegra20.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/tegra-video/tegra20.c b/drivers/staging/media/tegra-video/tegra20.c index 630e2ff987a3..7b8f8f810b35 100644 --- a/drivers/staging/media/tegra-video/tegra20.c +++ b/drivers/staging/media/tegra-video/tegra20.c @@ -317,13 +317,8 @@ static void tegra20_channel_queue_setup(struct tegra_vi_channel *chan) chan->addr_offset_v = chan->addr_offset_u + stride * height / 4; /* For YVU420, we swap the locations of the U and V planes. */ - if (chan->format.pixelformat == V4L2_PIX_FMT_YVU420) { - unsigned long temp; - - temp = chan->addr_offset_u; - chan->addr_offset_u = chan->addr_offset_v; - chan->addr_offset_v = temp; - } + if (chan->format.pixelformat == V4L2_PIX_FMT_YVU420) + swap(chan->addr_offset_u, chan->addr_offset_v); chan->start_offset_u = chan->addr_offset_u; chan->start_offset_v = chan->addr_offset_v; From patchwork Mon Apr 15 19:34:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630593 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 967A5C00A94 for ; Mon, 15 Apr 2024 19:35:43 +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=IJjICtBC/PxgbqBZOnUcC9gT/+1sJyFUpDptyTrj1Og=; b=G8Rn6pPiawDY+i IzrR8XDMwj8ce8ShgB7QuhVyoh6uuWAVe3zDLaPEDNTuih2fB9cN352F2fFyuMrbpea0mn58B8zrn ofo+2LTe5yniQWqHh2dCdsCbXDxiCzwycJbTHYyewpPb/lS2SYGq138rrFe/oXvtdyjtx4mnR+QsR bLU3sjTPoTrmD65QlE7WTmOtYA4azj9P8ZeQv88ylOUXMK0KnXAgpPKPkyfMZfYrL20/m0J0vm/sv mVPH7aeyr94Bvev5BN2rGN5dqVnafFlFO5aD4HUixmTgZYmCs0OPNmWnbPE8nKrwg5OqWwPeYF625 eC2oLrqTkqpu5ewFzyYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS74-00000009ccf-1Pat; Mon, 15 Apr 2024 19:35:34 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6E-00000009bx8-0GRK for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:44 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-78d68de297fso296428985a.2 for ; Mon, 15 Apr 2024 12:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209680; x=1713814480; 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=hx47X/CBEUsxAKiiRrHT5ksgFdQJWx3yIi/EXUgSCek=; b=EM/YiNLLBRYwRqKsfVPTYiIWwoZV1VewuWGSp/p7XuieY8MuWuVrK7EAjr8Nq33wxt 4c9GCkHymGThIgBZoxI1RaHtz7cF5Nldt3kUyhq2FQ5CtWI/HMtiPdHSdXVIAm8YFLe8 0qcmj/0ZgkJaGBpVuB76Z0bwb++oOVtvAuCQ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209680; x=1713814480; 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=hx47X/CBEUsxAKiiRrHT5ksgFdQJWx3yIi/EXUgSCek=; b=sAvZcqTb+DIxpvD0+DlA3IUo1l6+qw/oqBqzUifSrFR3z+hRUc/qrbDikCgPfCBoj7 XsJxlr7Z9bO80yPKCSZmys2rdmxgqtyo9GpE5i6Dm0vhRoBaPK9/udV6ur6AXWkbbV4q rr3utEdjxp49U+SypFSbdTUFmlxzhNTta/ANUVaiSQjEd3I+E5xBH/dDLewq4lykO9Mj 72GE1XamZ20FB4TXuAyKPzSrqrHLpvejMl+c1F4NAIXZMgejMhPQ28ch6s7MWyvYRTkN q0zGzcZeVEToTwfUZ6o7hP4MvWYgi8aJS1sc/oMsteqXPydNm+0itVmbOoREYXQGaVfm m/Ug== X-Forwarded-Encrypted: i=1; AJvYcCVYvh4rVRWmhKl7YN0+MJX2Vdku3rRfNWYjvc4elTzbhRvteEDbvsPg1f1IQxeKq1LHBXEczRPhbyurygVlywkZJEm9f1HidqfGVs8PDEY61fVlQd4= X-Gm-Message-State: AOJu0Yzg7zaess0smxcHlFEqquEXexyruIlIkCKDvRLTTJsr1R1ViaeD xqxMJMXzhLlOMBPb9UvbCAf/AaMU4jlwlK0kJDaPeivclLPhNcw9fPkR4imIoQ== X-Google-Smtp-Source: AGHT+IEmAtiOSDGP5pc0WLRzcDyQrYD70pzi958Nl6f5COykB700BmbE9taYsEHtf+WGDgg2JrZfiQ== X-Received: by 2002:a05:620a:2443:b0:78d:6b72:b45 with SMTP id h3-20020a05620a244300b0078d6b720b45mr14283622qkn.1.1713209679634; Mon, 15 Apr 2024 12:34:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:39 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:28 +0000 Subject: [PATCH 11/35] media: s2255: Use refcount_t instead of atomic_t for num_channels MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-11-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123442_283540_BD10B173 X-CRM114-Status: GOOD ( 16.76 ) 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 Use an API that resembles more the actual use of num_channels. Found by cocci: drivers/media/usb/s2255/s2255drv.c:2362:5-24: WARNING: atomic_dec_and_test variation before object free at line 2363. drivers/media/usb/s2255/s2255drv.c:1557:5-24: WARNING: atomic_dec_and_test variation before object free at line 1558. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/s2255/s2255drv.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index 8e1de1e8bd12..a6e450181fd0 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c @@ -247,7 +247,7 @@ struct s2255_vc { struct s2255_dev { struct s2255_vc vc[MAX_CHANNELS]; struct v4l2_device v4l2_dev; - atomic_t num_channels; + refcount_t num_channels; int frames; struct mutex lock; /* channels[].vdev.lock */ struct mutex cmdlock; /* protects cmdbuf */ @@ -1550,11 +1550,11 @@ static void s2255_video_device_release(struct video_device *vdev) container_of(vdev, struct s2255_vc, vdev); dprintk(dev, 4, "%s, chnls: %d\n", __func__, - atomic_read(&dev->num_channels)); + refcount_read(&dev->num_channels)); v4l2_ctrl_handler_free(&vc->hdl); - if (atomic_dec_and_test(&dev->num_channels)) + if (refcount_dec_and_test(&dev->num_channels)) s2255_destroy(dev); return; } @@ -1659,7 +1659,7 @@ static int s2255_probe_v4l(struct s2255_dev *dev) "failed to register video device!\n"); break; } - atomic_inc(&dev->num_channels); + refcount_inc(&dev->num_channels); v4l2_info(&dev->v4l2_dev, "V4L2 device registered as %s\n", video_device_node_name(&vc->vdev)); @@ -1667,11 +1667,11 @@ static int s2255_probe_v4l(struct s2255_dev *dev) pr_info("Sensoray 2255 V4L driver Revision: %s\n", S2255_VERSION); /* if no channels registered, return error and probe will fail*/ - if (atomic_read(&dev->num_channels) == 0) { + if (refcount_read(&dev->num_channels) == 0) { v4l2_device_unregister(&dev->v4l2_dev); return ret; } - if (atomic_read(&dev->num_channels) != MAX_CHANNELS) + if (refcount_read(&dev->num_channels) != MAX_CHANNELS) pr_warn("s2255: Not all channels available.\n"); return 0; } @@ -2221,7 +2221,7 @@ static int s2255_probe(struct usb_interface *interface, goto errorFWDATA1; } - atomic_set(&dev->num_channels, 0); + refcount_set(&dev->num_channels, 0); dev->pid = id->idProduct; dev->fw_data = kzalloc(sizeof(struct s2255_fw), GFP_KERNEL); if (!dev->fw_data) @@ -2341,12 +2341,12 @@ static void s2255_disconnect(struct usb_interface *interface) { struct s2255_dev *dev = to_s2255_dev(usb_get_intfdata(interface)); int i; - int channels = atomic_read(&dev->num_channels); + int channels = refcount_read(&dev->num_channels); mutex_lock(&dev->lock); v4l2_device_disconnect(&dev->v4l2_dev); mutex_unlock(&dev->lock); /*see comments in the uvc_driver.c usb disconnect function */ - atomic_inc(&dev->num_channels); + refcount_inc(&dev->num_channels); /* unregister each video device. */ for (i = 0; i < channels; i++) video_unregister_device(&dev->vc[i].vdev); @@ -2359,7 +2359,7 @@ static void s2255_disconnect(struct usb_interface *interface) dev->vc[i].vidstatus_ready = 1; wake_up(&dev->vc[i].wait_vidstatus); } - if (atomic_dec_and_test(&dev->num_channels)) + if (refcount_dec_and_test(&dev->num_channels)) s2255_destroy(dev); dev_info(&interface->dev, "%s\n", __func__); } From patchwork Mon Apr 15 19:34:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630594 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 D3398C4345F for ; Mon, 15 Apr 2024 19:35: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=BaWYMlg7CHp0GPh/NnyE6LPfFkt09hiyBOev+177f3w=; b=mZPdjFulsyvxnL qSRVsXNklQV0o231LBfko0XnqQfuSMXsXkYjYbAjWMp9hOyQqx7ewmpCD6rur4LxFzFCTITAwten1 k6p1+CW3blYwass19OOGTTpv+cwoxfBWIErKQk0ZHTYBA4XYB6fykZXFmqK4hgmp7L1chYedVWKyA TOKSraji8+Q/ilDXmUecQUITpZ51cPxngkt+hMGfOU926JByPM5K21yUeTwTz7gyUOwfcM9o//NSE M4znBp5oFkDAXL63C/YESAbx+k8NnU6AjI1zqk8GI5LS40RGo8HNMVmF4ToKzmE/5fQoqf+AFirMa AP+yW+ldX7zM0oeOECxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS75-00000009cdG-0x3n; Mon, 15 Apr 2024 19:35:35 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6E-00000009byT-3Y22 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:45 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-78d778e6d3cso329909085a.3 for ; Mon, 15 Apr 2024 12:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209681; x=1713814481; 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=33KvbvTql7+TfuU6gagkdE47f06z1GuAxIph77Mkm3M=; b=NyndJEUDFdFlQoLIe8VUDT3s+z8ovKKUuj4zIE5/jZplWEBNgvwyCCb1V1m5u5cUSA lp3O6f+LnRMDYwAl5WLxsk0wJEOAn1a3GcV9ZK1VfpvYw0u0Czp0ZzLDKPsmuxCogjXm qWFKGOaEQwJGz4MfsFojLPkd0jp1+0kPQiW3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209681; x=1713814481; 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=33KvbvTql7+TfuU6gagkdE47f06z1GuAxIph77Mkm3M=; b=BhF79wNvWOakg0wW7zNfSj0GB1lw220tcKpG1LvsJgOvbC82KCJq1h8duBBcwRxlTw nmGBTjZas6CHCWvNybtONc9vPLpSkRF8I50NhKYuEDoZag/B2wCUmWSIQettI9M+6pxk z1xVBkRhz7uqou0FAToH6wVbGXA6llW1eY9TgnnTw2EiUd5yN9PGTdQcHC4J19xLZIyC BKHyLj5XT+FKPIyKoNh36XpZ+6op7kEHYITYhIJdSASyXRQO6vQFlB6r6tiSwzk7rG+z jKqlgUfXvwGTKgoQwQ4G8l9HxlfL82p3/IJviBiLTZFymrhknedLz7nYZzYswH/LaAVz IbQA== X-Forwarded-Encrypted: i=1; AJvYcCVB17T0x6hi+KvG4vPUMcJsZjgGWQibF2xBvd2FzOq/+r/TsrllQ5VbViSI/HPyl11R/ONDH3T+PNYHd7gHqVM+ty/0a8Bc2BW/3g+bJdlBXN2GRME= X-Gm-Message-State: AOJu0YzrqZZI8pB0fFfWuaoVWAWEjF/PEell03+J1U0BgnBpu37wdlIN W6tfdra1xXtfnl040cSXRjSnl9K1g2dU5reXT7R+oCSGb1CcTTYPI6O1GMVlSw== X-Google-Smtp-Source: AGHT+IHgMrhfCo+nCeS1fB2Q2DO/uvIOv0/GoxcEriQYnGbBf8HXaYl0FV1YT72ppySseLhcU5xKgw== X-Received: by 2002:a05:620a:5719:b0:78d:6b8e:18d with SMTP id wi25-20020a05620a571900b0078d6b8e018dmr11861292qkn.64.1713209681163; Mon, 15 Apr 2024 12:34:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:40 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:29 +0000 Subject: [PATCH 12/35] media: platform: mtk-mdp3: Use refcount_t for job_count MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-12-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123443_088916_F19A5EAA X-CRM114-Status: GOOD ( 16.40 ) 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 Use an API that resembles more the actual use of job_count. Found by cocci: drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:527:5-24: WARNING: atomic_dec_and_test variation before object free at line 541. drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:578:6-25: WARNING: atomic_dec_and_test variation before object free at line 581. Signed-off-by: Ricardo Ribalda --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 10 +++++----- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c | 6 +++--- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h | 2 +- drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index 1d64bac34b90..ea2ea119dd2a 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -524,7 +524,7 @@ static void mdp_auto_release_work(struct work_struct *work) mdp_comp_clocks_off(&mdp->pdev->dev, cmd->comps, cmd->num_comps); - if (atomic_dec_and_test(&mdp->job_count)) { + if (refcount_dec_and_test(&mdp->job_count)) { if (cmd->mdp_ctx) mdp_m2m_job_finish(cmd->mdp_ctx); @@ -575,7 +575,7 @@ static void mdp_handle_cmdq_callback(struct mbox_client *cl, void *mssg) mdp_comp_clocks_off(&mdp->pdev->dev, cmd->comps, cmd->num_comps); - if (atomic_dec_and_test(&mdp->job_count)) + if (refcount_dec_and_test(&mdp->job_count)) wake_up(&mdp->callback_wq); mdp_cmdq_pkt_destroy(&cmd->pkt); @@ -724,9 +724,9 @@ int mdp_cmdq_send(struct mdp_dev *mdp, struct mdp_cmdq_param *param) int i, ret; u8 pp_used = __get_pp_num(param->param->type); - atomic_set(&mdp->job_count, pp_used); + refcount_set(&mdp->job_count, pp_used); if (atomic_read(&mdp->suspended)) { - atomic_set(&mdp->job_count, 0); + refcount_set(&mdp->job_count, 0); return -ECANCELED; } @@ -764,7 +764,7 @@ int mdp_cmdq_send(struct mdp_dev *mdp, struct mdp_cmdq_param *param) mdp_comp_clocks_off(&mdp->pdev->dev, cmd[i]->comps, cmd[i]->num_comps); err_cancel_job: - atomic_set(&mdp->job_count, 0); + refcount_set(&mdp->job_count, 0); return ret; } diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index 5209f531ef8d..c1f3bf98120a 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -380,14 +380,14 @@ static int __maybe_unused mdp_suspend(struct device *dev) atomic_set(&mdp->suspended, 1); - if (atomic_read(&mdp->job_count)) { + if (refcount_read(&mdp->job_count)) { ret = wait_event_timeout(mdp->callback_wq, - !atomic_read(&mdp->job_count), + !refcount_read(&mdp->job_count), 2 * HZ); if (ret == 0) { dev_err(dev, "%s:flushed cmdq task incomplete, count=%d\n", - __func__, atomic_read(&mdp->job_count)); + __func__, refcount_read(&mdp->job_count)); return -EBUSY; } } diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h index 8c09e984fd01..430251f63754 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h @@ -134,7 +134,7 @@ struct mdp_dev { /* synchronization protect for m2m device operation */ struct mutex m2m_lock; atomic_t suspended; - atomic_t job_count; + refcount_t job_count; }; struct mdp_pipe_info { diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c index 35a8b059bde5..0e69128a3772 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c @@ -104,14 +104,14 @@ static void mdp_m2m_device_run(void *priv) task.cb_data = NULL; task.mdp_ctx = ctx; - if (atomic_read(&ctx->mdp_dev->job_count)) { + if (refcount_read(&ctx->mdp_dev->job_count)) { ret = wait_event_timeout(ctx->mdp_dev->callback_wq, - !atomic_read(&ctx->mdp_dev->job_count), + !refcount_read(&ctx->mdp_dev->job_count), 2 * HZ); if (ret == 0) { dev_err(&ctx->mdp_dev->pdev->dev, "%d jobs not yet done\n", - atomic_read(&ctx->mdp_dev->job_count)); + refcount_read(&ctx->mdp_dev->job_count)); goto worker_end; } } From patchwork Mon Apr 15 19:34:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630633 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 A0B58C00A94 for ; Mon, 15 Apr 2024 19:37:57 +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=dXGlWf33eh7qoSHwDOOoLateIdhPmbrFQM90TPlw4aU=; b=bWf6E5y9UE+Wl2 /7iQ3UaqiV9M3zRGIRIdNHQiZIw7Ad/bvJ47s0x7Aw10UPBpNm9+iPszkh4JVFlZkAoJ2Kmbz3mDu kOs5g24AnbV/w57DI3RUXGByFvW9RrLVHk3WjjqrrJqY0Pb9GOEr4OUABjI7OjfGjkWth1mJd4+fC Ia9tcYZeKWJcLG3vdgTP34Q/hrCrbHoxgE9uxC2nmjRCEkKzUcOAVegxjCo5mTPCQ/sK9Xu8/6B2s DbaYBlnkPVDX1/cJCsmD/UNEYNWLAFUp/CJ7ohc7kJtLH16QzYHNfFZldH5EII8NBe4qaOo3pGgKs 5aq5xD6+019RRPrC3zag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS9F-00000009ds2-1TTt; Mon, 15 Apr 2024 19:37:49 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6V-00000009cDo-15UZ for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=CefUC+YxzIgWNX8CpaofkTMnPwq7GRiYus7oOXvNDPA=; b=B+QlthqxZVtkaJkC1jNBGmcGhX oYbWWkceCtk+9FsJ3FypI8JK/K4mc1UhQy9mthOs7tt7YtcvQtv/TUwJcI3q1qnl9v/j0HEUEeF8f 1sudjgMXnTP5AjxObbzymlSmI/BmU3PCGj+sUTaf01X8n1kmdDeHzqY1jxh+2RFgoBxtfTVFmUflg ptWmAAyObdzNI6+biWJ/WE9R7EOzPVG6y9WtVFzf35OXJLoJbZmcL6rKfrLSp9wDRtnZYmTH9YW6w yjHjrbkY07ylosjYAduYbvWyJRijYIB0Bns5n87ExkC9c2XnG2USfT/j9MvChsAvXr8XHw+Pbnbnv 7NAYrHbw==; Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6F-0000000Aigw-3j34 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:53 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-78edc3e7cd9so133687585a.1 for ; Mon, 15 Apr 2024 12:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209682; x=1713814482; 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=CefUC+YxzIgWNX8CpaofkTMnPwq7GRiYus7oOXvNDPA=; b=hFw6wclFwy1pyO5pPFOTfhFW/TwFmXdbFGLEp2Nzevm2WcFmQE0BSwoLl3IsRkAAJe FvkqWMtLzvfiaAzKh7hbQfNVL2MNUCDIKEyJuLIAbt91Rn+LX6FuklS3KY1gvh+kEsIp 7YC0w+bpyvhTZXxsp6TRmOAe0YwjkJiPSt5hI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209682; x=1713814482; 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=CefUC+YxzIgWNX8CpaofkTMnPwq7GRiYus7oOXvNDPA=; b=IeoV9pkBgp+ptkixESAc7Wi/8jJrWUK4Ko+EtvYhE/zfn8DnUlHG5zFfzYbSoSZjOF T/m1yw39GFZaZk6t5kzjl83hVsqzU5rYq1p7u67P5lgKidAx216qgYAqWJOZmlCbGGoD xmX7bQRU1i+Gs72P+ULcGF0iofkWavfwCxfvJLnLoBkhsFtf6BW+D08n/9Y/UblB6DQG u7EW1br7kCKCalaMzASt2Z4oieVHKYfsCqWtP7lFAPPBFmoi0GpBq97ZraYfBf92/Tv0 lwKPl1j9q04NxxWxxEYhQI7eH1iEmwzPMQa/pk3/aCdL+tgeGBmPZIeGWpHxhRoaq86P nuiA== X-Forwarded-Encrypted: i=1; AJvYcCWGJaWMrfOojlijZ+zMfdMLO9wb+5lK73Bb6B26uxpttXd1x/ap8SvEdsC+MmF2QkCLpTADK/Mb2LtweR4vVHLX7k7br+fRez+PVgRvHeJGYX3IH1E= X-Gm-Message-State: AOJu0YxwAficUWFLP4P65B7E1ASoRxGaGBCoKe6AiqTjBxTrayWCO6V8 nn2CSkEjjHCDwTQbfW1Gx/TTLuvKrBYYksnXeHC0VvpGDr6ujfeFQjBdgQe1pw== X-Google-Smtp-Source: AGHT+IE+3KdNYzINGLb3rrR3dbCdrA74Ddhjd2P3YHrcD0Jca/9uMwZH+j5PP3pBwpJxZ8tf3OsdUQ== X-Received: by 2002:a05:620a:5a6e:b0:78d:6786:7637 with SMTP id wx46-20020a05620a5a6e00b0078d67867637mr11767547qkn.71.1713209682098; Mon, 15 Apr 2024 12:34:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:41 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:30 +0000 Subject: [PATCH 13/35] media: common: saa7146: Use min macro MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-13-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203447_432487_0CE35383 X-CRM114-Status: GOOD ( 14.00 ) 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 Simplifies the code. Found by cocci: drivers/media/common/saa7146/saa7146_hlp.c:125:36-37: WARNING opportunity for min() drivers/media/common/saa7146/saa7146_hlp.c:154:41-42: WARNING opportunity for min() drivers/media/common/saa7146/saa7146_hlp.c:286:35-36: WARNING opportunity for min() drivers/media/common/saa7146/saa7146_hlp.c:289:35-36: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/common/saa7146/saa7146_hlp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/common/saa7146/saa7146_hlp.c b/drivers/media/common/saa7146/saa7146_hlp.c index 7569d8cdd4d8..fe3348af543e 100644 --- a/drivers/media/common/saa7146/saa7146_hlp.c +++ b/drivers/media/common/saa7146/saa7146_hlp.c @@ -122,7 +122,7 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, xacm = 0; /* set horizontal filter parameters (CXY = CXUV) */ - cxy = hps_h_coeff_tab[( (xpsc - 1) < 63 ? (xpsc - 1) : 63 )].hps_coeff; + cxy = hps_h_coeff_tab[min(xpsc - 1, 63)].hps_coeff; cxuv = cxy; /* calculate and set horizontal fine scale (xsci) */ @@ -151,7 +151,7 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, xacm = 0; /* get best match in the table of attenuations for horizontal scaling */ - h_atten = hps_h_coeff_tab[( (xpsc - 1) < 63 ? (xpsc - 1) : 63 )].weight_sum; + h_atten = hps_h_coeff_tab[min(xpsc - 1, 63)].weight_sum; for (i = 0; h_attenuation[i] != 0; i++) { if (h_attenuation[i] >= h_atten) @@ -283,10 +283,10 @@ static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field } /* get filter coefficients for cya, cyb from table hps_v_coeff_tab */ - cya_cyb = hps_v_coeff_tab[ (yacl < 63 ? yacl : 63 ) ].hps_coeff; + cya_cyb = hps_v_coeff_tab[min(yacl, 63)].hps_coeff; /* get best match in the table of attenuations for vertical scaling */ - v_atten = hps_v_coeff_tab[ (yacl < 63 ? yacl : 63 ) ].weight_sum; + v_atten = hps_v_coeff_tab[min(yacl, 63)].weight_sum; for (i = 0; v_attenuation[i] != 0; i++) { if (v_attenuation[i] >= v_atten) From patchwork Mon Apr 15 19:34:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630596 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 7E89BC00A94 for ; Mon, 15 Apr 2024 19:36:11 +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=HI9+d+irWB9Ml6g3HtkNW4yOgpo+05acEGbGg441580=; b=JPbkHmLpRprTaT qobYU6TjNFX0ZKL4VfVkEcHcWLgAW0A6nifLo62lAGCR1EHFkrYkey1dnCMtDdBgzlD8Jstdd3COq V89twGtiK2tEDh0vPuuf3UT/wRwNUjkWy1+TOTIfhdaGjzSvEuFqKoYC0XPq2DzfY67hibtl6DJUs ZXTmCSF/GzEX8+m7T4vbiaQTBgm4QVHi5ZtUzNO+GEBT50OWquZy7nyOdRzbKrfXyCxjl9jhZ6s21 mS2DgLqUd65f75FjBY5bfKw7ZHhrIoBQHKlAuBOEqN2HUBH72ADXt7lPgrHlLXjX+g2Wi2OSWfyfN sUQ0bL4Z46f23YnQzTKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS7T-00000009crE-07R3; Mon, 15 Apr 2024 19:36:00 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6I-00000009c12-39Kn for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:49 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6eb8bdb84f3so331608a34.1 for ; Mon, 15 Apr 2024 12:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209684; x=1713814484; 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=9NumvJIfF1EvDHzhvgph+fzItnp8SRnkGAbNB8M/eao=; b=R5BF+5NkOwg4BobKzcSYMkW82JTLrun5FpriOzlFETQ3lFKCnatD8Q24bWX7LQMvm4 1XOssbbT2ThuRrgRZpQtVTTM2RwssEq/2KH8HOFAOldPu1TeYSpGIdeAatYSwDbkNQPL 3ejibdUTGRHr50zdyOgqjt/2YSM6zfaEUkWxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209684; x=1713814484; 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=9NumvJIfF1EvDHzhvgph+fzItnp8SRnkGAbNB8M/eao=; b=Zr1ZzICCIV7Bmoc3k/eKBotiQxDocKoHxq64LhBuAiz0D5lS8qEUBy4fRi0/Lp7L9P lV0HKpkcv35NPS3EWH/N6K3/Ug10QnyOgt+qX6RhzENsaEX7GBuV03aiHX9WxHsAlIF8 PFPa4iq1tdDkIxew9Ai4DOg92EZLUKJu5lbcaARhlKsLT1Wf+EzcDbRenrz1O5PHZ/2J p4BV574SKtbQuHMUV2LqYs1peW144oN1GWOVt40DHFlTprQ+Y9uIUDwdnh1235D7o4fv ryB4EKWXRkTlIO8CPuSrJsVkbz8K4iFt2g0FE6lxwu9CGg7P5B5OAkZakDALcTE7iM8U 4LLA== X-Forwarded-Encrypted: i=1; AJvYcCXjV1ooGhkgD1JtfSiY5beW7+5vjeREOPUxucxWshlFRWUV7o1cM49Ckr97J3wfBrg9XSkitOxJLIGLMvanOTRbljv9EInA0Rskb3psrBYuLHiVTGs= X-Gm-Message-State: AOJu0YxG6g8JpIvw3wO4tI5Ryg3xkMxy4BRxdKI8lK0McEYrBgNjIClN IoGm/cqbxACQoO9Qisy09J5Fi41pclgIGYuDXLSpeGF8mHOPkEJ5C8tqGucjYw== X-Google-Smtp-Source: AGHT+IGDpQP0lGeeTbw+d3WHAnrIlvzGQRlawHZd8kFq+13/xBXNhp6Lzy5O5V8WuY+aqcrpA2RYcw== X-Received: by 2002:a9d:7991:0:b0:6eb:7c4f:d4d with SMTP id h17-20020a9d7991000000b006eb7c4f0d4dmr5274597otm.8.1713209683858; Mon, 15 Apr 2024 12:34:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:42 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:31 +0000 Subject: [PATCH 14/35] media: dvb-frontends: drx39xyj: Use min macro MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-14-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123447_243161_3BFCF5BB X-CRM114-Status: GOOD ( 12.65 ) 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 Simplifies the code. Found by cocci: drivers/media/dvb-frontends/drx39xyj/drxj.c:1447:23-24: WARNING opportunity for min() drivers/media/dvb-frontends/drx39xyj/drxj.c:1662:21-22: WARNING opportunity for min() drivers/media/dvb-frontends/drx39xyj/drxj.c:1685:24-25: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index 19d8de400a68..d41ce75575bb 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -1444,8 +1444,7 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr, /* Read block from I2C **************************************************** */ do { - u16 todo = (datasize < DRXDAP_MAX_RCHUNKSIZE ? - datasize : DRXDAP_MAX_RCHUNKSIZE); + u16 todo = min(datasize, DRXDAP_MAX_RCHUNKSIZE); bufx = 0; @@ -1659,7 +1658,7 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr, Address must be rewritten because HI is reset after data transport and expects an address. */ - todo = (block_size < datasize ? block_size : datasize); + todo = min(block_size, datasize); if (todo == 0) { u16 overhead_size_i2c_addr = 0; u16 data_block_size = 0; @@ -1681,9 +1680,7 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr, first_err = st; } bufx = 0; - todo = - (data_block_size < - datasize ? data_block_size : datasize); + todo = min(data_block_size, datasize); } memcpy(&buf[bufx], data, todo); /* write (address if can do and) data */ From patchwork Mon Apr 15 19:34:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630644 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 78945C4345F for ; Mon, 15 Apr 2024 19:40:01 +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=zQEGvW5U5iYQseS1jSTfCTN1/tHB+G9/h3pI2+LAISU=; b=VzCKYip1txsgQ5 nTCUycIDyjmLGGMjS32aKD2RSJ7EPe/PI9LMvF8NLs8484rPAYblCkFQPACKsNz6dFh94a3qHR77U wyPdPrFmUzEr6ovHP/sCzz97VEng+Fejy1nrvcl/nTSTXK295IYNmHm83t8IQYwPJFSHYPIvxgy83 QM2uYU5TKEfPs38hyWFd7psGfoOsdvCjBpm6HwzCDuKtgS17f2My+Opz6suNm0oqSez2Yl1HDxnrc smIWx0peQ5G1c+BtOOWBWLcHqlfXwwvCooLn9ZgJMJR+lbSMgwgcFH7bAJtiSzh8hobJ+dh3m5aEN 90+61G0H/XQMV0UFCGwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBB-00000009f3t-1VgB; Mon, 15 Apr 2024 19:39:49 +0000 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6J-00000009c1h-0wvY for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:51 +0000 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6eb6b9e1808so1002797a34.3 for ; Mon, 15 Apr 2024 12:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209685; x=1713814485; 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=9DQ62C5vkEz8a1t/8x1ghE+E9JYa6TkiF3DSBiMd/dY=; b=TpxfJ6V7hp52rSLUj73ci7zcNYJIus4f/rUPsJIteq0G/TaumIBP5mclHoAfevycXh 0YbZ2AGlJlhzQhH93ayp2i28U0ZwcR4c5sFK71pNHPCzmXnP/ci4T0riM3qw0KZQvrn6 qwFSqnWfHLUBAvXxAhFu+arYaZUwFIOmsbxm4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209685; x=1713814485; 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=9DQ62C5vkEz8a1t/8x1ghE+E9JYa6TkiF3DSBiMd/dY=; b=fS/5L4pQ519idXlIriScgl6OO+fDxVYfHsMZQks2d2oR1q4oUSj2aeCIZDzfHWpV1G Yt5ebfKKgcEjmXIlbMSxJgrP8fJuYDsCX+9VgXUJE6Vq3W52H7HPXbHXzN/xoU29PFBm KvFMBK0dsOEXZR7sWAhgEZyEwkT6D8sTyAMTrLL8WoPGXKH5mU1hTk8D3MN8VgcwU0mM 4CZsY71hbor1iP9+Kn8ViP2QgyfW/SLd97yPqYOsHuzHD8ajTFbI5AJXC77HLvQtt/Rt tBqRky2c0p2uEZKteljcLg2LH6JDTS83IC57OB3AeR0VcFuMIFhG3KY36+veJxvET7jM Jpjw== X-Forwarded-Encrypted: i=1; AJvYcCVBc1jO1e0q/f+rru6BcKYxDj024sComQ0nJCoUY6iOwz3zkH67NxNnNKkEtuxm/WLGt8/xVKkbAaGZX5vFh7VLDVQ8ndirpfsMe/4tMSIv8IlmZWo= X-Gm-Message-State: AOJu0YyoHPUOqcv9HtH3znL+gB/7Tb/HPQVrlJ5fI/uCTIzZQvAgg4yT mwLo/EGxVmz1OfFzq7FQiWdF68Ti2skIXmREfJiwGz1hkRq0L4irDkW97PzIsw== X-Google-Smtp-Source: AGHT+IEAF9806y97qmHJ2SnDYiOLkOnVwPWcqFC1NWaJsEOh0gdLwpHuhOdGRcF5Wy59Aixlf/05/w== X-Received: by 2002:a05:6830:100f:b0:6ea:ab3:5c1e with SMTP id a15-20020a056830100f00b006ea0ab35c1emr12447905otp.29.1713209685165; Mon, 15 Apr 2024 12:34:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:44 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:32 +0000 Subject: [PATCH 15/35] media: netup_unidvb: Use min macro MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-15-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123447_473262_998DD12B X-CRM114-Status: GOOD ( 13.05 ) 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); From patchwork Mon Apr 15 19:34:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630645 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 81084C00A94 for ; Mon, 15 Apr 2024 19:40:02 +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=oZsBZVwyuZNFt5oy/bIrkQB1eClNiib2DqKmCNPhJQU=; b=A3jIT/h5o650lY CO9RVtBTY3WzmZ+ahV/gGOETqCaC70gLr7uzT+eCgWkO1BtThtbV3dg8hbferhxYdfpSkbweReP8v JPpT3oouugsPQ8VVDDty/age6U6zNORs+BQOg3xsHiEWmQZUwldKBs0iCG6NMcKM8zqvVlYmgEvWV KzhK8g4L0MiO+6/x5ORrNV2g/DhMyYiTlSFQvPg4y6YJpOnkaz8vCWE8XLvTNac+V2QXUHjQNsn8c dg8hnwOSP3rDSM31W8yl00rn/qKv7owcHuGBxc0zabfwzAWIdzclXzpWslz0BUawp3Df0GuGHOiqb iHowDRj84cgMyiyKv//w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBD-00000009f4z-0Fk5; Mon, 15 Apr 2024 19:39:51 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6S-00000009cAN-31cZ for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Cc:To:In-Reply-To:References:Message-Id :Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender :Reply-To:Content-ID:Content-Description; bh=VYb6g5i4FA16yMs6Dul0lviXONeB+8pR0V9zyRVb51o=; b=gQAXb5zNTNnMUNNL9bTaVY/iM+ pQOAdkD9FTZkwjbuvQHN6uwj9IX9jMGtJ7EyJaygCQDe/vqkqbgdr7bzgLklEQZtXQTj7zVmSx9Tr 84cqzQurwrOjUk6YqNd9r7P2M5T8fg53GJL8xsjba85YMbvXZtspFxQ9JlsIKzIEQtBx+gU4eEd69 BXEararuggPTnLObtmzY0jHVUFv0S0BcoEYFxT9FJZcMgYbkcqaTgoBlAsEZenXwFq3O0s8NE1Yh9 QbcXkht2Lsx/bdMbwdfVB40iDcIXQ+7tYGj0YPTzQrCUErcbC5cEEJHgM8gcxUEBL9PseSRFPuSUd Nn7csqOg==; Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6O-0000000GMte-2vle for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:55 +0000 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-61816fc256dso31275877b3.0 for ; Mon, 15 Apr 2024 12:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209688; x=1713814488; 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=VYb6g5i4FA16yMs6Dul0lviXONeB+8pR0V9zyRVb51o=; b=eAALKokadjNbcLW5OcmvZcKpBWsVNS8BEZNKVdlQgbOQBbaSG7TFsQKwZ46+y7lRzW BnSgx3MEFPhxN2UGNm0ObINNesyObzbSQJvFCUuvJ4aELVnhYyPuUo1qRQsY4vx5s+to 8UOypdehnuZS9SzKOux8wD7D6xPJztFywKB0Q= 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=KGo/IPtvpuDcBVUEzkwhkdpqQsA7MrqiLnT7uvzvqp3AGh/BshwWAyMv27lt5s9VYi cwfVs3/Iuj0MhkzDkXR/eK2i9fsLKvdrVt8x2+f07WbTZYJNGUeyVUcc2poqjHaexIAu g2H5rLlYV6uWuICYG6aRGjRopUS9G1mPAkqWx4iuh16Dxshm+XCj2J8tk1gLzMpGglgN vk8zqJWJB0a6tZXBde/r/eVtk3+HkQc+5QZHlbHGEosWiBdQJBz5hREHN/2eSOFcxLan hORh5jKsqY3khpr1sPGFz+s+G0Csapx64ge5leszCiT9QuwizWIxPc923gVHZZdpW32V UuuA== X-Forwarded-Encrypted: i=1; AJvYcCW/83X1b2jvDBvMhs58dzhLyEn9LdHjfFhVAWqTzqjuuoXmT4QjFiHK1YlUTeXVKGW89zZkEHUN1ziBbx6Q9VTwxP+KwiXTCt9dlwcgZNmU8NPTbhU= X-Gm-Message-State: AOJu0YzcquB5vDVSroGRNIP+ebhkmc4mEi4n1q0+KgkgjwpShqbP/4nF OoFvf3pD7ZSc5wm3CT48OkvJPJs/Qx9pYHnvVKWSoSrwJ0M39VazpEF1pEp3Dg== X-Google-Smtp-Source: AGHT+IHXF7TrtarHgpunekvNDs6nvd1JJs+Lc0bh8dwb/yJrFpFk4KNuzD4FvIVwGteAAQA7ZBlIRw== 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 MIME-Version: 1.0 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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203452_791932_240D40C9 X-CRM114-Status: GOOD ( 11.27 ) 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 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, From patchwork Mon Apr 15 19:34:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630646 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 4FC0BC04FFE for ; Mon, 15 Apr 2024 19:40:03 +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=diSs6PjrZWNfVSFXwepvrcOnwBCEIA+9LlvUuQJC7Cc=; b=4ycXwUeSEucYmO IgXr6zcKi4TMb78F3rOmwxuVZp/iB+TQvxmY2/zkVSNrUqadpWIl4vHSvfyrPP/8ZSmKUwWnMEsRH n5nwUz4VBeb/QoIyedOrb3P9DVEVOFWh2P1auXP7+n3QRJZ7K4QTuIhTi41XXQPaUBBs+Hejv7War WScH8QKEwZjirVfRMJGtRo13kUXTm9/I6AvIpMtfSzPNXahpOzMCgbzljdP5xYOkYdb7Ze8lP0rZY iCKOPeL4HRGBdLsSleVg07etkFoacn/kwRk6jCoo63bQpcVtWO3svVVfFCgCWCdU12S9tAjg8VEas CGkKKFjoJdCylLqyuGQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBE-00000009f5u-0yrE; Mon, 15 Apr 2024 19:39:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6T-00000009cC1-3y4E for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Cc:To:In-Reply-To:References:Message-Id :Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender :Reply-To:Content-ID:Content-Description; bh=VH1TTY2R78PVfXYnT8sQaYwvCkEpO00JMLA8gBHoObU=; b=eweKQoLFEyIcZM+danETyyF95G 6hIhe/yhfBCAXshvfXhbH3oUBMgZCTTSjXOs37xAvShat2LqWMbS9ESjm0/7DbPI6TToRjoAwQvLK xubxs2YnBUAYFZl7xnWP7tEEG+5Kzb5bHALqntfLDarule93Gp2kYRGKl3JW+/x/1seGS7XVWxyAw CDdXiKBfVfJmIlp9XObUwry75vD72C8l40Fwz4SKtV3LZUckVeMG/8kRHMUzzWcP8L4/UiV2vZ+go es6ZzFkTWYaWW6uPZfFsG63JaSP2TbHcERdaBRnPMqyMdXt5dEf5CRAKVO/qrfs0rmEr6uvH2oqF5 e+gXJzlw==; Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6O-0000000GMtk-3OiV for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:56 +0000 Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-78ec78c4fceso238120085a.0 for ; Mon, 15 Apr 2024 12:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209687; x=1713814487; 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=VH1TTY2R78PVfXYnT8sQaYwvCkEpO00JMLA8gBHoObU=; b=WgzmjuLAFtTb66jKNBzJrF9TTALaud0mHJbDYsJPi2byS7/zc7IGOosO+2ts7WmpSn 9ntxW5gO2Nh03bkwQITozolmHqnevV6I1oZ1V7cOTUIGqb2JZ3TxEJA72zECFvmOtEJo IOfGgF/PlCO2X4Nn0k5G31LcAjHVszFPD34eY= 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=OGEIpMzkV3HkKymuB/pbE2cKdBIEpil29zn4Fi7obUoDm/2XdacucvUu5Rd8uIoBYR nYwDaALLaUQmakN4Pr7Z02472xOEXcmQO2OE2VpojNWZiZGj1Do4gmdbCd5R5Fd9bX/Z 8Ppm7fQF853r3/zQrwmp3AC7p7KVtCJLr9/TWrVOAkSSN8t8sKlDry4L9sKKUR+QmN86 QE7bQTqfcbvSO/NJVGaFyGW9QvtcmmTpiPntAJ5lKV+D/ZnLge319NpLi5h9kXl8RKF6 anGo1+C5Qe+JjBX/lEtqOZTuHHWRgv8d8cbCz5TtYy/tuV7leV8g9pD0wTbZwJ0WkNnt v2Kg== X-Forwarded-Encrypted: i=1; AJvYcCX0i+EQTKdgVKpKvPL+9Kh8ZEm5ZiKFkiG6JwJ4j5tqkjaLpZyjy/j5YK/x3QUchW+zjs32Ohag+esGqFXTOavzhGwLPk0n7fWD254qZBLaxaXN7Jk= X-Gm-Message-State: AOJu0YzgoJbfD0lRmCbVycKruyQ/vBMwfH5ODYcPVE00oVniIrMK4X5V OFs2y+7bfwt/ATgvZ+k79NlBGGtdzRblLxNouTtLXbNpjlIRQuIEI2yCWHbaeg== X-Google-Smtp-Source: AGHT+IFZZwBtLZMDNfJayMBU/PaT+EdKNrIoBaFoYxfd58lYWJrbZu6cOvIxZ8QNIWMRuOhipLdFVA== 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 MIME-Version: 1.0 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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203452_917837_5B4C4F07 X-CRM114-Status: GOOD ( 10.36 ) 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 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)); From patchwork Mon Apr 15 19:34:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630601 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 684C0C4345F for ; Mon, 15 Apr 2024 19:37:17 +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=NOYgilJHVzDrWc6iY200IXLShyzuZ/QaR76S6p1QHJU=; b=EwlO/BuBL5XqmG aJ3iCdP9bKaV9j0052cihdnC7dM70HiVJqkKICixkxNJ8mWIPgQqyBQTPGcNoSLTPSlhyyzGNJaG8 iCTFNxnTQREC1gcoucMUkdatfY0ny8kbrBrxVrhkceAkeT5ERXbRlfghsD+xG67XkZSj1L55tqODR JQnvnBjrJFfpOC4chVhoIXT+7qdLKmJhJXf3iBl4GfNqMA+73n2MWVYdVPtwpVvmecY4MdChGIf1A UHJrUuGWVGtu1yHb0otbWCzYIGghgi+nIIAtFaVm/9LX1AMGnCZUaRHCe+bg4SyXRHePR05wxzTBV khW2eCY7E+v13Z3ZO7Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS8X-00000009dS6-22Pz; Mon, 15 Apr 2024 19:37:05 +0000 Received: from mail-qk1-f169.google.com ([209.85.222.169]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6N-00000009c5g-1NNQ for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:55 +0000 Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-78edc3ad5fdso160183585a.0 for ; Mon, 15 Apr 2024 12:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209689; x=1713814489; 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=Ysx9uvN3ilBy5tFwit8pBZpHwFo890jKkO1ecScbT94=; b=fZA5oeW/VOEiGk99R11vG3vOd9XFD39voraHUOBlLZKiHNa0MmhSsNRO03+D1z2/uN mWtLdcmp8E7hlx2xTAol9kDdOwnRI/I0RRmP/gckTkaSnstFk4QHNDHpj9UGIBOfeT3k dUikhrPmL+yf6KRiNJFc4nxtYdsHq2vnUA2kU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209689; x=1713814489; 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=Ysx9uvN3ilBy5tFwit8pBZpHwFo890jKkO1ecScbT94=; b=tokRzbX5hZks6XahIBV1rgJL/gOT8l19/hIyAKH7ZfNZg0Jt5vaurIvxhP5aHX2q5M ZYx3haAUyRD1CN/Xaq9J5nW/1zszI7tcV1CpI8iMnsPjb6stD01ZQ4Mnj6yDXVgwPmrc lUHirqAJx/aKWbiW78dA+6HdY/2xDffFXBhRJpa7U7G7JVmKkruxHaJxMewsJdx0z/RB NIvOEWzELL3vpfeoZXzDuzliJtjH2oPLEwo176uB917GvWhgpHCSD0zrA/KPmkZWLnMM ZKbbJgC17e3ZW8HWbOmcHbsLVmaUhcjoAj2vE4r5LJOCQo5SrPA0HvQCycKm+9TuQJ+P 6Rdg== X-Forwarded-Encrypted: i=1; AJvYcCU6ExI5BRZd2ZvUs4kaCw/8+ARRyLUqirJH1go4RlY8lfwL/Fbc8enWLWhrDpNc+OlM19hueKrWv1G9zJ4e/MdymwGcZNqyMMlzxVexPJAgZeN7SdA= X-Gm-Message-State: AOJu0Yzpdj17QiiNXQNRLPy14WWZTWv6AKCkmyEQrEmFv9XQ1ZY9qA7W dmddgJMxnb4UQUZDWhNpA3oo5ihoQKGdPLai3Knp6EOJ+ssH/BW2ubva+/pA/w== X-Google-Smtp-Source: AGHT+IHQyP/6IMh0FCNlSBAUIYfTzsci3IX6XU70Oi2xtR2oFiLVlI4GVoQeVlX1sWvOJp1rCpFZ7g== X-Received: by 2002:a37:c244:0:b0:78e:f0d6:3ac0 with SMTP id j4-20020a37c244000000b0078ef0d63ac0mr1060376qkm.31.1713209688866; Mon, 15 Apr 2024 12:34:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:48 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:35 +0000 Subject: [PATCH 18/35] media: gspca: cpia1: Use min macro MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-18-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123451_537314_E3BBB9DF X-CRM114-Status: GOOD ( 11.96 ) 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 Simplifies the code. Found by cocci: drivers/media/usb/gspca/cpia1.c:607:30-31: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/gspca/cpia1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c index 5f5fa851ca64..14aaf36cde6e 100644 --- a/drivers/media/usb/gspca/cpia1.c +++ b/drivers/media/usb/gspca/cpia1.c @@ -604,10 +604,8 @@ static int find_over_exposure(int brightness) MaxAllowableOverExposure = FLICKER_MAX_EXPOSURE - brightness - FLICKER_BRIGHTNESS_CONSTANT; - if (MaxAllowableOverExposure < FLICKER_ALLOWABLE_OVER_EXPOSURE) - OverExposure = MaxAllowableOverExposure; - else - OverExposure = FLICKER_ALLOWABLE_OVER_EXPOSURE; + OverExposure = min(MaxAllowableOverExposure, + FLICKER_ALLOWABLE_OVER_EXPOSURE); return OverExposure; } From patchwork Mon Apr 15 19:34:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630600 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 E3043C00A94 for ; Mon, 15 Apr 2024 19:37:11 +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=Q/1HIHLdwKeWIK7v8vAPM81y5EDG3tZMZwuW8iq/CFA=; b=cV+G2r7aHst6gk b0kMVxPTWaLODUJeeTThCcbfobwYxziB/pF9RvsAcRtuOXgzoQdpO9ES8mUH1KW3/dUbf3yN7ajUl 3Nw9R+P0FS/RbAEiOX3KFy6TyK/3GcIf4L0LjWmzJfWk44eWB83Tyq06nuRTkSw+97bFAVAgKRkdg 6xdIDoBAZ9wV6PAxDLVhRbKIx3e6dahT1okir/z0rpZeQwamYaE+/4c8Y6znIeMaQwVIfv71RHD0J nr+2AGAPCB/iwkfCqTnQTV+D30NdDrzqL9I+v/VC+0D1L70RLyvABjEHajo++oXqi7Z6+/SnWDSxi P0SMzBs8/RnhOcy3t6bQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS8U-00000009dQH-2RtG; Mon, 15 Apr 2024 19:37:02 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6O-00000009c6A-1dUz for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:55 +0000 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-78d543db3a4so272579785a.0 for ; Mon, 15 Apr 2024 12:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209690; x=1713814490; 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=cKMvbnJBvce6w6rhgAtTaziLR0gQM5TDA935faRghdc=; b=hZlszzlgbAW6CeHqDfWA0DxNT76rUM3rFB2LKmsjx5NrhrsjD/tfr52Wbh+v++wMrB zjJ23wZfhfO3ltdjxOt83A91N6QQxiSfsFQXIPn096c6qwjUw1rbYY7na9cNvs6Mb15o +DeKjJJ0ioo5SVGslephigA05Ff14AlMOXoWA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209690; x=1713814490; 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=cKMvbnJBvce6w6rhgAtTaziLR0gQM5TDA935faRghdc=; b=IoLl0XlSYjXLGaB7DgqrhXquJEGh2vWuHrXcynxrfGHrVgM0MnV4S+pb3giH4GIGZv cPPIwza+qmhDIOuL2hlQi4BFr7pMrBJHdVnzicUbnFqsTG/dhrfRvuqnigHsZE30TCbq qqbAc0l+djtfaYnwnGOd8d4ZbylLi3s2pnKsMWBNdA+JptN/OpH6pV48rwblRP+XQif0 JG8FZnNJs2+MLfKsQlQYAvRIpuy6AEQUIbchC0N1VqsrW1x+YytjIxuBec1Y8mQFts+6 eUzlrBroMGs2avJfEH8q1g8OtUa//Y9yu9p628tf4FRguq1m8ldnxVuVCTSz3yLPvzsN TeiA== X-Forwarded-Encrypted: i=1; AJvYcCUvJtrgF8Lg1ofAEfPGS8ELsMcRM74Fv8krjSdYJBj7+P7eGdDeZQWNH4mZgUUr76nELUFAJqC7t6yttD75h11HljJRreDKX6A97SVAf6w+U1kxqUE= X-Gm-Message-State: AOJu0Yzuw4WaQniPigCYCunEnw/LLYe7AINaAjYGHGOFJY59a1JskfN2 lHy3Zd7nU7s7xcj3MLWtRM9Iwp2kljA94lqrxGpClRSp3DzqWX9AV9nlSAjffw== X-Google-Smtp-Source: AGHT+IEuVGO99fF8WY6cFUn2TeptksBJEwdpaYOr7CSPDLRmva6Ltt+et0Zcs6jy4zj82KXO8YnR2A== X-Received: by 2002:a05:620a:4486:b0:78d:65e0:3100 with SMTP id x6-20020a05620a448600b0078d65e03100mr15166755qkp.60.1713209690125; Mon, 15 Apr 2024 12:34:50 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:49 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:36 +0000 Subject: [PATCH 19/35] media: stk1160: Use min macro MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-19-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123452_669415_938AA36D X-CRM114-Status: GOOD ( 14.59 ) 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 Simplifies the code. Found by cocci: drivers/media/usb/stk1160/stk1160-video.c:133:12-13: WARNING opportunity for min() drivers/media/usb/stk1160/stk1160-video.c:176:13-14: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/usb/stk1160/stk1160-video.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/media/usb/stk1160/stk1160-video.c b/drivers/media/usb/stk1160/stk1160-video.c index 366f0e4a5dc0..0ba0f41fe3f4 100644 --- a/drivers/media/usb/stk1160/stk1160-video.c +++ b/drivers/media/usb/stk1160/stk1160-video.c @@ -130,10 +130,7 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) dst += linesdone * bytesperline * 2 + lineoff; /* Copy the remaining of current line */ - if (remain < (bytesperline - lineoff)) - lencopy = remain; - else - lencopy = bytesperline - lineoff; + lencopy = min(remain, bytesperline - lineoff); /* * Check if we have enough space left in the buffer. @@ -173,10 +170,7 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) src += lencopy; /* Copy one line at a time */ - if (remain < bytesperline) - lencopy = remain; - else - lencopy = bytesperline; + lencopy = min(remain, bytesperline); /* * Check if we have enough space left in the buffer. From patchwork Mon Apr 15 19:34:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630602 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 D0DA6C4345F for ; Mon, 15 Apr 2024 19:37:20 +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=Oh2m/nmL6rdn5/S7z/hQmJ3udMvCMEdotQ41TQlxY7A=; b=hKaLhJe/m1337T mayHMzA+GAWEFfm7YEteFUbcyVbW1SnvXdyT1lltdeWA37QypCEYRspuRwvtmKQb78xVcehE5o3Zn mIzX1uRgmpkRF8rS8vjLYCsOq1wqsOHB8d+i6U34cOZQTwTnQVQnaVaHMH72Nw2MNxZQIYBGBftRX P3Nr4CAJqD63/3MZUAwdO9BX+jBCVEyY+k2ZipNLL6a/HrPLvgS9lf2RN17nRAxZ/z+qXl4Ggjf4W NDXnSV0rOU8rIlv7RYJZ59/xuxzZFCe6ibVtzC8K3Voz8orGEd7WV8jKnPAHemIpawzjZmtMNrjFv cKwzvKn9zxxTsASUquVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS8Z-00000009dTY-0Q8h; Mon, 15 Apr 2024 19:37:07 +0000 Received: from mail-ot1-f41.google.com ([209.85.210.41]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6P-00000009c7G-1BJv for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:56 +0000 Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6eb7d1a5d39so1007890a34.2 for ; Mon, 15 Apr 2024 12:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209691; x=1713814491; 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=9xYCSct9boZ0BOkqN2tXVepjBV7/8cHg/+IKo1joAc4=; b=cdY25WV1HjuPQY2SeX4L/xlta+eH+H3fndGFFHKAOplp7iKjrEGQ7PdGogVpaYtknD MvzKQyUZoqlFcf27WpN/Lj0VJ/qPbrMlN+n3lj3aMeMXzgJ6YIww4C5D9jUqC/hon/el /jKP7nzxWS71oBkNneANPRl9BzjkHfluLMytE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209691; x=1713814491; 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=9xYCSct9boZ0BOkqN2tXVepjBV7/8cHg/+IKo1joAc4=; b=HcrVJkoPPzTLy4eyWAx0wLAjkD4Ryh5RjlZIcwSY0RN1LILTN8p9v/zYj2xj4r86lY o0unlJFViRzKvieWgtm/LMr+8JBx+1p46VKbG3A5jOB/ocMO4A269wUCJL7B+R0/mVwp knS+dxFPt0/nPZq6aU1Cs/QmzxB7M4pctfWXfgRwixMCTGMKcgLCeqSMtL/u1mR7a4mk Q485jaJkT6bWMJtOqD8J/weYZAwvjzFPSSlsU/z4/HH8Pegx9PP4zzB7PGlwr8tlFWio U33wlIFgftcdJF3hgh4YkpsqDQ6bYB/TjyJ+z6eH9T7MhaczHrbCAhAK+K+oXMuzviSP /mrA== X-Forwarded-Encrypted: i=1; AJvYcCXJSELtoElzvtFEvF/6Rx0LhLIf1pTMcCLJpvoRk6qp0nfgV7GIMYtmrubm19sTk+6R2DfkgB9CYD/neYugZ9oYBSSMxYlXgzd47mmkX/YimfGaMHI= X-Gm-Message-State: AOJu0Yz5kfwqpA9CncFjAOsPVrBeE40MQ7UwD925KY1C6EV7EE9ioujI YyktocgNQJLGM0MYIGGz0aRHz1ifMeQ+nDzA9cbvMBKVnF777LVmVXNhdmOtgw== X-Google-Smtp-Source: AGHT+IH6vSvyyYYzExFejV09di7HyPhtKMxRA7xlKo8y+g1ouireMhE+BqwQkFqVSegum+jG+Rz+Iw== X-Received: by 2002:a9d:6ac8:0:b0:6eb:75b6:4245 with SMTP id m8-20020a9d6ac8000000b006eb75b64245mr6116943otq.15.1713209691286; Mon, 15 Apr 2024 12:34:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:50 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:37 +0000 Subject: [PATCH 20/35] media: tegra-vde: Refactor timeout handling MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-20-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123453_564700_8ACFCC1D X-CRM114-Status: GOOD ( 14.72 ) 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 Reorder the branches a bit, so cocci stops complaining about the code. drivers/media/platform/nvidia/tegra-vde/h264.c:645:20-21: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/platform/nvidia/tegra-vde/h264.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/nvidia/tegra-vde/h264.c b/drivers/media/platform/nvidia/tegra-vde/h264.c index 204e474d57f7..cfea5572a1b8 100644 --- a/drivers/media/platform/nvidia/tegra-vde/h264.c +++ b/drivers/media/platform/nvidia/tegra-vde/h264.c @@ -633,7 +633,9 @@ static int tegra_vde_decode_end(struct tegra_vde *vde) timeout = wait_for_completion_interruptible_timeout( &vde->decode_completion, msecs_to_jiffies(1000)); - if (timeout == 0) { + if (timeout < 0) { + ret = timeout; + } else if (timeout == 0) { bsev_ptr = tegra_vde_readl(vde, vde->bsev, 0x10); macroblocks_nb = tegra_vde_readl(vde, vde->sxe, 0xC8) & 0x1FFF; read_bytes = bsev_ptr ? bsev_ptr - vde->bitstream_data_addr : 0; @@ -642,8 +644,6 @@ static int tegra_vde_decode_end(struct tegra_vde *vde) read_bytes, macroblocks_nb); ret = -EIO; - } else if (timeout < 0) { - ret = timeout; } else { ret = 0; } From patchwork Mon Apr 15 19:34:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630637 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 A9D3EC00A94 for ; Mon, 15 Apr 2024 19:38:37 +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=B7FijsbPM5g1I1RDThWiZT/T/X092VhSRMCZW7iSRXo=; b=BD3/lGqZj2ShEw 4pATwO1fzqgDoTTLWQGYXvU7rJbNDeVtWzogQV2JkBzJKIBtiPfYJ69e4gVAMpHoKRQVMSwCbBiNg ELw9XRsdw2cntZ/eUhYM1knQauyX4N9yJA7slo5zlN8CPSTQQa/5A0T50RQsDgADYQ1MY38vmeAHJ FgJGdZBe4wCnJ8pj665UExKGZ7ATfbAxYB5scstH+KsbJ616SM/TMdtWWnF3qBb1OlvrIHDOLJZ0W My8t0dDniQg6eew1IiZKVXuEKQ2+Nb+bXwFKuB5/YL6D3iP3N7OXqlnvo1Lg1cqoyjICqqeN4ZxM2 T//HyDQH1xWylYzLSXxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS9s-00000009eIT-1IJ8; Mon, 15 Apr 2024 19:38:28 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6a-00000009cJU-2T4x for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:35:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=ApRUmXHVQV4ipJPLdz2OGTOSZdnvD9pjmVa3NeYIwaE=; b=GSJiL6k0TD+96yN5W7yXPJDoZ2 xf5GcXV7CfHj7FaSDBV0jXE38gpoCnLR8nod1QXUZmPz1dZaAqGZCQgmcO1heHMGLFSTuMx1Vldci xjRgYU9dF1Kpl7gP+BVD0zbQpNAAOCZ8/J8l21gln24hCU2ZidwsATAxArqCYm3s1K5/rUfqmPssB jUiV6L0C8zVdSQLaMJa9wFQF92XqPw759P7rww4EKMZx0woB1oA4pI9rvNy5OSVri0wkMkvIuB1Q/ /YZK2j8gfvUx+ecvbeOBWaWPJMO7/jvD7Okzpnga/tKJjxUX8iVvJE0hZ6ITz+PdvZS63Yv0IidP6 Hax2h6Hw==; Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6T-0000000Aijk-2Bzd for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:03 +0000 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3c6f6c5bc37so1583546b6e.1 for ; Mon, 15 Apr 2024 12:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209692; x=1713814492; 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=ApRUmXHVQV4ipJPLdz2OGTOSZdnvD9pjmVa3NeYIwaE=; b=itrtW99D7xQ7IlIF614iSEy5rHEWv+eM1apUpG/C5zErDwcOCOUTX37vPhlKoJG8Ij o3OMeKSWx0ltingBCdmS8/3K1ub/9kJDXkxKR1+qxM5sy2B0dM55Sch0imzHqyDzj1k4 8FRC/En6kxcu6EWWlqbDgh7EvXLPY/JXnJCWE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209692; x=1713814492; 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=ApRUmXHVQV4ipJPLdz2OGTOSZdnvD9pjmVa3NeYIwaE=; b=bD4j2C5AFMYlzBt50QX6sy5h5R0Gbl9kgxF8nIl+Ij36W3vBpfaqYkxwFDRh2rC9Tp p8J/OGiU86Qu6PuWmURjy15xJHoRt/t7TK3542qruuKXSJkiWIJ3d/KiqokIFF710ssd UrzifISLC62XHLBIsRrCIFC5LJD5bOA861/S7GgK80JSV6/EaQJfWPAUlyb+kTrFKt6U qAqeZJeuI/TEil2+uf7TpTsOfwdHPU9sWDG+AxBd+21L070YoiXEQlMgScWwZMm0Ps+F 9KEHZXc6jAH9YrmLRx+aMzOnjKT5RPqEeyOR6RS5By9rfXgHkp7Z6sWQuaozynep/Vq2 fAjg== X-Forwarded-Encrypted: i=1; AJvYcCUYt4plJLT+Sc2RDOWQI8uSDqpVtacn6OhdlpieFx7MFE2hT2icoLCy7wbjgA5bw24McbNv/mvhmnVuwieEq0uMmp80fePtrlOB97jk9lhx2/AH4qM= X-Gm-Message-State: AOJu0YzwkA2I+e200KjbblHr6pz30XX9mNiWdHt0nscwstitK1rFj+fD v0w3gDEqvxQRTWlhkfVKBBQMGdO/u6GxMF5tQk00o0i8x3QhvJIcdBEA2OFxfQ== X-Google-Smtp-Source: AGHT+IGZ58NMkpObXyXFmK/dlwdDRAXnKMQeVrLnGqtYNcTRA6TD/q28Ror56VZ2t4DiW7soUyKUtg== X-Received: by 2002:a05:6808:128c:b0:3c5:fe95:2371 with SMTP id a12-20020a056808128c00b003c5fe952371mr14036703oiw.29.1713209692296; Mon, 15 Apr 2024 12:34:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:51 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:38 +0000 Subject: [PATCH 21/35] media: venus: Use div64_u64 MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-21-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203458_764311_2B71225F X-CRM114-Status: GOOD ( 13.21 ) 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 us_per_frame does not fit in 32 bits. Use the appropriate div function. Found by cocci: drivers/media/platform/qcom/venus/vdec.c:488:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/vdec.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 29130a9441e7..1dffeb7de76e 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -464,7 +464,7 @@ static int vdec_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) struct venus_inst *inst = to_inst(file); struct v4l2_captureparm *cap = &a->parm.capture; struct v4l2_fract *timeperframe = &cap->timeperframe; - u64 us_per_frame, fps; + u64 us_per_frame; if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) @@ -484,10 +484,7 @@ static int vdec_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) if (!us_per_frame) return -EINVAL; - fps = (u64)USEC_PER_SEC; - do_div(fps, us_per_frame); - - inst->fps = fps; + inst->fps = div64_u64(USEC_PER_SEC, us_per_frame); inst->timeperframe = *timeperframe; return 0; From patchwork Mon Apr 15 19:34:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630635 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 0DE60C4345F for ; Mon, 15 Apr 2024 19:38:26 +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=rM0avj3cbwHUkeXRc7XmCJn/ZjmJxQQBzythnncSOQM=; b=qin4tUsHToeTbD 7Z8gPMZjifPJnvcE5rodq443ytZAdxIfhxZ4enzGfpo9RQfMkh1ZVmMppGciMjDL+8EAHTjuWIbaJ 1FVwVBMYmJbSeTJS3tRZRaNQGj++UgLK9PkoV99DPcc7iS1rBzOTiHyaKcEsAFYUT+EQbooYW4KAV cfFZRKOuneByMg1nbQ/dUhbm9sIZxYHY4+zROAyRSf2gb2RvExIZ4EcsH9vcXwJtBe7FOk5rO53Yv oWKm8/LCbbYBSOkjI9IMUq1gKYFjSvDXKFmCGaHt2BGkjQCk9l2t4nZCHxOjYyi/E18eeDgbMQs3I TbwcMk4CxOp2Xg0j4KfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS9d-00000009e6S-2wxt; Mon, 15 Apr 2024 19:38:13 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6Z-00000009cIK-1x1N for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:35:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=/qWsKtiTtM68cPujZgkDbgLJScEQ/KU6IejvF8XzFy8=; b=AV6bJTuvtAFMBo15aW8TqaiiNA D8pCiwRKU1VeJqUAPRkZleS9LYgBZLH4+5fdZflryd3i3EyatB/S4HBz5gmkiAn1JH/naQT0+E1iH kumGsAqX4yeqaE7n7P72c5WF72PeYtVTBK09zREEYjqvnivLGWNOGNEwucmVzSMlbzGGuUqxp8Ngs +fqS2DOqPC1gLZuQ0tEchDcZ9CDWsmhnu6nrY/MaODES6u+jEjvAx7FhdQjhzb4E1Vw0seWb1gqVE EVVcT5wNfMKTYWQ5IdltYEEOyWlHI5G8fDv1oODwejr47b/ASea1VWt3tpnPDXlIHFfyyLgh11/Hm 9SMPjlWQ==; Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6T-0000000AikE-2C8w for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:01 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-78d57bd5781so264773185a.3 for ; Mon, 15 Apr 2024 12:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209693; x=1713814493; 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=/qWsKtiTtM68cPujZgkDbgLJScEQ/KU6IejvF8XzFy8=; b=UQl6QrNmDvjwcTQk48q73CKd3hLujSZQ+IxoKPgzbZOjAYirqFIjUTtl2b00piEcRX vUpWXNbIeIbI36yxaBksWPgirMiHEZJNAbF97UNubO1xIM0QoQwsu2lOXsyJtZjFZFo0 h4dTcZHw1s6/20RDc+wBHOs4nd40DJUGsxG0w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209693; x=1713814493; 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=/qWsKtiTtM68cPujZgkDbgLJScEQ/KU6IejvF8XzFy8=; b=UQroD9JI+5m2kbjhAfn59XuYxkFVwIrSV9c5CbSN9KE8fSiEuxNH2W/LYT4oE0W1RR GTOKRL73xeYEtKcCUg+Ti2URKI8cNSqSEZ19FMkQ8Xlbv+qZBpyP6zjcv8d07MUgfwDj fEfBy3ARzycV50S5luLQmZistgOItVtnA+TtnGDfdR9XllD90JhzDk0p6xkCJTx7r8Te rxDx7QlqCHYIXb1wAVL2Xz9vcMWy+NfYikrtWays5buo3zGwT5lBRhEQQK6XbRkVuQsu cgmuyeJJFDYfPGN6i58fE0BAiXgm7If9ekYfjw2ZnoIcU+RoYCw6QfaaJsIsV+Z6UcVk ZzXg== X-Forwarded-Encrypted: i=1; AJvYcCXIVIgBP1ynSC1tM2gEvbEcEdJRgtbgyoRroEmc+Tc1UtuiUI264vcqLTKoBRxc3Bdfa0vTdutuEQwm1VBWLsO1Ig/JHVty4T/AAoXtrWrtYr7ynG8= X-Gm-Message-State: AOJu0YxS/BRx+w3beQbRf+CatYW9VKIrcZ3FPGIfcIOW+e6VPe+1888c l9S7oEzRaHSVPwHlan2kFls0rgzDJf6uFOpjBt+7zuqisPIU+t1iQnpKDEl0VA== X-Google-Smtp-Source: AGHT+IE7tE6n2LOOWlxUIvgFNmo/Vr0dYpoxwwqjlaXwS/vDwhHd4c5esyFK2/v/y9hDaMP9p/kqqQ== X-Received: by 2002:a05:620a:410a:b0:78e:f439:64ee with SMTP id j10-20020a05620a410a00b0078ef43964eemr19862qko.72.1713209693277; Mon, 15 Apr 2024 12:34:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:52 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:39 +0000 Subject: [PATCH 22/35] media: i2c: st-mipid02: Use the correct div function MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-22-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203458_435046_35E2FA7E X-CRM114-Status: GOOD ( 13.02 ) 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 link_freq does not fit in 32 bits. Found by cocci: drivers/media/i2c/st-mipid02.c:329:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_s64 instead. Signed-off-by: Ricardo Ribalda Reviewed-by: Benjamin Mugnier --- drivers/media/i2c/st-mipid02.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index f250640729ca..93a40bfda1af 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -326,7 +326,7 @@ static int mipid02_configure_from_rx_speed(struct mipid02_dev *bridge, } dev_dbg(&client->dev, "detect link_freq = %lld Hz", link_freq); - do_div(ui_4, link_freq); + ui_4 = div64_s64(ui_4, link_freq); bridge->r.clk_lane_reg1 |= ui_4 << 2; return 0; From patchwork Mon Apr 15 19:34:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630647 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 9ED3FC4345F for ; Mon, 15 Apr 2024 19:40:06 +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=riWBDqiJHvRazSGQl1O2QhP51XoLLbWAaWRN7YSpU/Q=; b=kazltkL+OW0Ofa gGwMzDI0NtmIdoXmrDfyEFiPbsS3UVVkWUKPBBTifG30zDXsPS4MOUXKD6ZjtLGbQU3fPRzPvglAA gsPykCuF+T+YjnfF+/jy/jEB5ko+DjEXAOxUhqUoZcTIlltezlEDayHwFJ173gwDUBQJ6nmChQoyY A2REfIzLu/4u0k3BnOdDnu6zmd17zN+MNgiHeZyS3q8P49kJB/ABI/oNaKb5ANli8SRDuIOcSd2p2 8KhIzgmyiY1tYqG7aDJVHRES/ZwUA4jRH2fknEK7rJFnCJshS99DsJwF4tHvAmSd55BWGS9YcW3dg TZP9HRgwbwBxY49RF4QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBG-00000009f7Z-2rCY; Mon, 15 Apr 2024 19:39:54 +0000 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6T-00000009cB3-415a for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:00 +0000 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-6114c9b4d83so28625657b3.3 for ; Mon, 15 Apr 2024 12:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209696; x=1713814496; 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=uh3OglTS/dLlK8U5oP5C8O8FlJacnVYJb0xAej3AKiQ=; b=eh32KnmL7BUdm4tpZVfbpeA2osIpp8cO/3hzk1ShbpbWT6b6a4bWq0PpOTQom345jk tRCqg2IcLivSVZCwF7kydZvKC5t1EobGrxCX0/eyf+ljAWWsVAYg1EDMk9e0eYxxvGNc 0bOEBtLMfEcT2pHE2OcG+uPKiY5orWNmupJFc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209696; x=1713814496; 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=uh3OglTS/dLlK8U5oP5C8O8FlJacnVYJb0xAej3AKiQ=; b=X+yw4SF6CZZ2vGL4U2CMoiBhSAmH9kEni65Y3WV7iTWnbD/0tHMQJJ3/VWGt7DFQwY 7mC/kL8lWbVQ6gy2aVfNPG9o7oOM1wE9d01o97365sz8KhMT90UBHB8ewb2cFV9pOXOZ 3NOm/zdSAKyTJGovZzeOBEPAklmAaxaiWeSnCOzMubeU8sE9oqHUyRM1NE1Ft6MzWjhD UhJ+ZfHSbDJV+fNBtbE/C3t3zbhEtSRYnSJ0RFdLIfpUxaLYECXkFGqMo5bGEOQamVKe pyKJEz1KZdWp9KA585sDLP4LmKlRMIFzOkWaepGx3llG2aapClTVuD1v2XKt1N242J93 PJ9A== X-Forwarded-Encrypted: i=1; AJvYcCVi1MeMSS0va01G4ip7oWCexZSTOHVQseW5bDk4xdDkZTGuTmIcle486LRvgBJsfZvldFf6xJ51SqqSBS4uyEguuPfPFts5RBLiwbs96ofqABLIpYc= X-Gm-Message-State: AOJu0Yy8r+HBChHZHvBGXEI7IfNimgtf5VuQP6SYTqJxUqdTzma0ZrKt Cl2ExTLYb1I/zMgWtVBuTWzcUxktMisFsEAOh39TaIaREpnMe8QuYpCVCebaKw== X-Google-Smtp-Source: AGHT+IG9BJHIxhgRtiyDrmvRjmvCt0KkebPpr6qQTdSe7jE4SlMZNfcxa6IYFxpia/6VuZ7zYE1XoQ== X-Received: by 2002:a05:690c:1c:b0:618:822a:e69a with SMTP id bc28-20020a05690c001c00b00618822ae69amr9192708ywb.9.1713209694201; Mon, 15 Apr 2024 12:34:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:53 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:40 +0000 Subject: [PATCH 23/35] media: dvb-frontends: tda10048: Use the right div MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-23-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123458_153313_AFED4D96 X-CRM114-Status: GOOD ( 11.40 ) 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 z does not fit in 32 bits. Found by cocci: drivers/media/dvb-frontends/tda10048.c:345:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/tda10048.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/tda10048.c b/drivers/media/dvb-frontends/tda10048.c index 5d5e4e9e4422..b176e7803e5b 100644 --- a/drivers/media/dvb-frontends/tda10048.c +++ b/drivers/media/dvb-frontends/tda10048.c @@ -342,8 +342,7 @@ static int tda10048_set_wref(struct dvb_frontend *fe, u32 sample_freq_hz, t *= (2048 * 1024); t *= 1024; z = 7 * sample_freq_hz; - do_div(t, z); - t += 5; + t = div64_u64(t, z) + 5; do_div(t, 10); tda10048_writereg(state, TDA10048_TIME_WREF_LSB, (u8)t); From patchwork Mon Apr 15 19:34:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630648 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 48523C00A94 for ; Mon, 15 Apr 2024 19:40:08 +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=0TdHgSaDiCs1c4K/m/8T+9BFpj6G3W3jx8k8PPuc7ko=; b=B/yv5ykQEH4ECB xz6r3djB3/DaiIpOOZMn8XaFoalDgoakQitr+7ZnRg+oOibLyG2nF2EuPBDLBAyjdEus97Eo7lbJy Nw4GDKOkN+v4ZiRTE3c0EgZmgJXwIyxoyAS0x+ZxRTFlfs1/goPxTP4K01mqM0sbfZyd+ZOIzw2qw d8sxEAYkUT1V4c5fEAlwyMvpNlrqxS8k+YyoYUkyNz+gR919NYy+ETAt6twnTvyjkW9lrW+IUSJ2g lJZnp5bOZM2XgnjRGiZE88ppvIB4E5BgfNyifdDnKrZshP5F2tR7h0aezME9em7eQwnHrC0fXaM23 UDoQlXrlydZNEeHK1kJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBF-00000009f6e-1xCI; Mon, 15 Apr 2024 19:39:53 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6T-00000009cA7-0trS for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:59 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6eb7d1a5d39so1007943a34.2 for ; Mon, 15 Apr 2024 12:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209695; x=1713814495; 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=QeRLp7zsOtUSdDFmgCUblI9njYJR1iKxSTZ/4ILbF+w=; b=BiH0OFMokANpupNxOxnsbd/u/XWAKQHEli9550JBHXJNGF65nVeWf0922ErwXNUoF6 Iyn/5qFQBpmpB2iZhJbS2kNZJ5XQPYpXF6qEg92pwYDG+NMNDYwsgAgFcXZ7NYREVMdY qkCl420YfcfuTZjeI75wop9l1LW2DQ8GAdDLI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209695; x=1713814495; 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=QeRLp7zsOtUSdDFmgCUblI9njYJR1iKxSTZ/4ILbF+w=; b=KO64HviabNBaRI7QfiRSLMkBhpmPf5GwUExSpa+xJbOTjIJuIXIW0OyRi8Q1sry4oW V5luJulCcioPkQpIwC1/8En4pNirM6OEmUu4SI5u6cUG2S71tdt3ZP+kiGLgfK8uFBD+ ZvGfuRGaJSyWapBNmW9g0G7iHp0uQkyzkTsQWlbm2ItGeAQhR1kscrQipznijjjjRuKx raLCkh3XFlSmT/ZlNur6yM5SZ8baDr98gmWxqCvbH9UEmgNbmULjoy+9OnP0APazecD4 boSE9cIxhLugt4uhXFpDreLIF6jABtpNHSEkL5DQMAwavYvb71vYuXom9/DjxcpVn2dy zFdw== X-Forwarded-Encrypted: i=1; AJvYcCVQxxbyM1xIMemEhgIwNiTqvSXTXOVBqrC+85NAVwNIdf44s1ijSWK+zulh6DC5X4Ru0GJg+VEiYWk+L0D8nEAZAIMyxHzzD7bkNiiD5zUR4adxqFs= X-Gm-Message-State: AOJu0Yy4ud75vSpWXhvlaLylh2E0u02RarV4f4498B8KEtQsT4RmbTv5 GyMwdoZdCVRqQJuIwv1ce4meTunxtbmKEgCmp7JIvOl0L8DIsHyUPXyt/0IxtQ== X-Google-Smtp-Source: AGHT+IFsqXR5fSRZnzm1Kf6aaPblaNqmPYRQpJrXNEFCJBpTElAi4AncAaUAPBA9CFnD3PK/w6M+nA== X-Received: by 2002:a9d:748b:0:b0:6eb:7d1c:f793 with SMTP id t11-20020a9d748b000000b006eb7d1cf793mr4227322otk.31.1713209695186; Mon, 15 Apr 2024 12:34:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:54 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:41 +0000 Subject: [PATCH 24/35] media: tc358746: Use the correct div_ function MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-24-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123457_324674_673FCD98 X-CRM114-Status: GOOD ( 12.36 ) 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 fin does not fit in 32 bits in some arches. Found by cocci: drivers/media/i2c/tc358746.c:847:2-8: WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead. Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/tc358746.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/tc358746.c b/drivers/media/i2c/tc358746.c index d676adc4401b..edf79107adc5 100644 --- a/drivers/media/i2c/tc358746.c +++ b/drivers/media/i2c/tc358746.c @@ -844,8 +844,7 @@ static unsigned long tc358746_find_pll_settings(struct tc358746 *tc358746, continue; tmp = fout * postdiv; - do_div(tmp, fin); - mul = tmp; + mul = div64_ul(tmp, fin); if (mul > 511) continue; From patchwork Mon Apr 15 19:34:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630636 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 6A748C00A94 for ; Mon, 15 Apr 2024 19:38:28 +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=xNjicHf+zsceSbuh7TRHBb+cIGNS/vI0TUFLfXM8B9U=; b=Q7kjiECdREW+57 UQcE6RqcM0yH6gTkv18ng08nqG7hPWxAEGs/i21UdQXq8oiA3wjdRvQ0HjzLCOCnUnYbv0IL8uLOI mxux2N8TGfxvwyNNK9+kREnZPtH4LZywbgswAX0Ngi3vf/O422v57M1IGLHn6p3fHIZrSsVx/4g4E HyEb/XlyQej+y94PiN0p669ESH22xGMUmPEIZya/WcDun64DJbMToYfEEZXim3Db9wqwJyWy2MWqm QGttd83ciTCXswCy5GAVBtUIXCqfQEVX/NtQHv3+7jRlIMknaHu5bVVdb284Ep/HGI8DDZsz3Jph/ BzMrff02vNBG0Zukdd1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS9i-00000009eAY-2e8W; Mon, 15 Apr 2024 19:38:18 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6Z-00000009cIS-24Jp for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:35:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=LUBi0S9+ghcjER4xO9v0racZxhYV4zff+IOh7tdBF3Y=; b=M1ZxqYOzbRMkwvuwAIzPIFQIKy o73neqj8fMO9o+JXvKVEKPRXrfaSEsGXL3BLgRxFZ6/bvHALHT8c+GM6ZZ8fBwBrfM2F1AA1TLhvH tdyCN5jquRmweRr6JZxdtUP5fWOQx8nVqG4BZF6FHTWbH/NB92tvFsCJhapepbcyw5RQy+fRZAUNa SEHFEtE+cYcdgMQPq3Xz2+qIT6UC4Ets1/svkFzoao2TaEc+E6CcKdyRed2K5jHURXa9h68OIwbuL LNhdSreCJw8mb6GLozDwrR7qWghX0JEL2PfG6LqCC1TcZrI+C8dsd2JuhXSylM8c/MBzj2jrU8h6z 8MMJbbKA==; Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6T-0000000AikN-2il4 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:01 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-78d61a6229bso247229385a.0 for ; Mon, 15 Apr 2024 12:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209696; x=1713814496; 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=LUBi0S9+ghcjER4xO9v0racZxhYV4zff+IOh7tdBF3Y=; b=XYY6D/EOMyD5Xl5MJDrtkwuYiqbGLSGhoZGoN5QnisiSDAz68C66D8TgRqAQbhVJqb 2Zhj7t6fzkYvYx2ERmIU/00QliHyRFneT2O1q1WztOW//FAEoW4boaH7dKo9gFn53JcN 49e6Z1/Bmoaqvb+p5hued8KRy7sH5cng0u5e4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209696; x=1713814496; 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=LUBi0S9+ghcjER4xO9v0racZxhYV4zff+IOh7tdBF3Y=; b=Q1jEey9eMMA3jlsYnKUrs7T26PAOrYa1u+1Xqnai+++CoM7x4NCablgPqM9EUIcRoi VLg4Aqf9S+evXqlnCfMKadDZaFhiaUhQgKEjouW6gCs/G3dctn7EOxL0L84WtEZaYcPS pYmy5bcVyIoa6UriPukrOjsZi3JErU2ohCMM8EHp+Nyam8RswcYKXEpQxTmhCM8AGy5P pldM2qaq9CkfC8t9Kl2VdpHevlgK6xmIp2Alon0DZRf+dBT53cV6hmnM6p0KlCC73kXW Rk+dblx/Zii/sWJmUMgDRNfTWYF2Kh0NLWeBYXWQRA5+UUhiQz51GPdaD8ylxLxaMBvX JjTw== X-Forwarded-Encrypted: i=1; AJvYcCVrv3NtgbqxK6xm4EufQZk+UA/w/LOYZ5PMZV7VOypKfRkqxREJDL/lzp7vt3JXD0WiLov5IENtxGIBkMlwNnxGjAE0G9d+Zfz/dtYIiEzdgKEL4IU= X-Gm-Message-State: AOJu0Yxo+DwOmDgw3U0FrOU5PTrlkAX5dlqXZUC2DREdfeRRkIoA4XQj foE/DOhzi5krIGPQr+4UOzW8MJkF/ktwjzTc7O1g0rSKCU2jHSnFJ7b933IW+Q== X-Google-Smtp-Source: AGHT+IENHla9VOs9zol9LIJSv1150+DgeHz4OsMQu2kACgbSSAPw34HTPzLa823VVZ1Js6TnsSST2Q== X-Received: by 2002:ae9:ec08:0:b0:78e:df14:19dc with SMTP id h8-20020ae9ec08000000b0078edf1419dcmr4888734qkg.20.1713209696184; Mon, 15 Apr 2024 12:34:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:55 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:42 +0000 Subject: [PATCH 25/35] media: venus: Use the correct div_ function MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-25-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203458_657339_F3782ABC X-CRM114-Status: GOOD ( 13.25 ) 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 us_per_frame does not fit in u32 Found with cocci: drivers/media/platform/qcom/venus/venc.c:418:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/venc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 3ec2fb8d9fab..de06e1712d09 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -393,7 +393,7 @@ static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) struct venus_inst *inst = to_inst(file); struct v4l2_outputparm *out = &a->parm.output; struct v4l2_fract *timeperframe = &out->timeperframe; - u64 us_per_frame, fps; + u64 us_per_frame; if (a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT && a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) @@ -414,11 +414,8 @@ static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) if (!us_per_frame) return -EINVAL; - fps = (u64)USEC_PER_SEC; - do_div(fps, us_per_frame); - + inst->fps = div64_u64(USEC_PER_SEC, us_per_frame); inst->timeperframe = *timeperframe; - inst->fps = fps; return 0; } From patchwork Mon Apr 15 19:34:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630634 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 247FCC4345F for ; Mon, 15 Apr 2024 19:38:22 +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=s3jOuDNkdTG23IAh0MdsxYSvErdvelI1xVejwYuK29Q=; b=nBA0qD3fmMUHbL WipkkmjhwlhqUnpuoX7krHhcjxHRWhtYkISYLcUNVAiCkeT6AV1FwtO4nKEe4lx5Jpg7ApAqyRmD6 a67j9HX0joZq35M/Wsfur6e8crxXqM3rnj+qtIkKUAYL96vFqn5I8K+nXltNG+jn5YyIHwR4Yk6na lQ17UcMjEU5VO3L+wKcEnqvdO78idhhw7jPTvCXn2qD9NXHWQfxqSV6uU3PAwCGy7y+M7JFUy1bGP CBuyy0yBD1Wac8cfG6n924JNW7ous4v+wPayNkAyIBZxvhTV8Qbn5/9X+8EZs6eBTImJVnX419kot ibcmL5maxdqBtlj5BPJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS9b-00000009e4v-3LME; Mon, 15 Apr 2024 19:38:11 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6V-00000009cCj-0DFO for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:02 +0000 Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-78d777d7d1fso282209585a.1 for ; Mon, 15 Apr 2024 12:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209697; x=1713814497; 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=9iRxS0Wfwa66zl/9FdFOMvCFtgSuuwnNLZrwXVx0B2s=; b=F8ve/J4L66jAtFjNnkNT6P6Qx5vX7Atb74hrRkBOOghk7y0rNNAywxMwgO5MqzpHyR T6Yiy4meWnAuaz22T4oapcnpoKk9IXj4RTTewFSQd71BxK4ikaQtNGh/GvDAbvgoJQh5 CAdBZNqVb3KCjTviUgYVhCk8/p0BnzmPIofO0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209697; x=1713814497; 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=9iRxS0Wfwa66zl/9FdFOMvCFtgSuuwnNLZrwXVx0B2s=; b=DOdCf26KYmg9ry9Fbvr2xSkDQfFX8g5ZnkoBIdHfj0bLAHQINyu5HtIVFqAghiWoTa U9yP2Awmc4Uwuw9CFowRqn7khB+3YJ1Eqc90M5Uz3ZTRLA9d7W2u9KGsAds3Avq906Wx mlvPcbWCH0xd9lmYIJXhBGqc8iJZ1BC2KvWsgV+/z6hTMkKuERstlanvWtUCOLf4xGQu PZr3E2RUftxYXQCmqjprqwzVstibbMpXLQEFXZv8N5fG7Eptti8VRTbhDyGlm5kpFhkh B2OEFzaCHWt0kjqQXLNxtcqUARnD2pVoWncJrQ/GuNndpXAO+zqqb6xjN+5n+VTaILs5 hJQg== X-Forwarded-Encrypted: i=1; AJvYcCVgZ1C+DNKU3Wt26rOONG/+1Ug1Oe9tB+7sys/bvvtcsozucqrOZvwnKHSHA5GvMd1jTWe18LlbQn6rp/cH2NM6lYmU+8DML3HgwmP+N7IFLqLbgkM= X-Gm-Message-State: AOJu0YzdNBeWjcFpvQS9rM83YLGvE2YYD9MRc4doVIB51v6xi5YbM9pE itYET3gOry5De2apQ8ryQYq/wSU0YCTClWHhE3t1i9ZTzwn8VAywLRQnTlaVDg== X-Google-Smtp-Source: AGHT+IGwiJ5/vTLqYTTLWbehOkrG3Z1CC3Ai73ckOtHPinOfOxtyAdhFhhrjbccK1nhZt1UUqJLF7A== X-Received: by 2002:a37:e10a:0:b0:78e:d2a6:63e0 with SMTP id c10-20020a37e10a000000b0078ed2a663e0mr9260421qkm.4.1713209697430; Mon, 15 Apr 2024 12:34:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:57 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:43 +0000 Subject: [PATCH 26/35] media: venus: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-26-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123459_262675_2FDA35EB X-CRM114-Status: GOOD ( 14.34 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/platform/qcom/venus/vdec.c:672:12-13: WARNING opportunity for min() drivers/media/platform/qcom/venus/vdec.c:650:12-13: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/vdec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 1dffeb7de76e..2bc7aecb35e5 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -647,7 +647,9 @@ static int vdec_pm_put(struct venus_inst *inst, bool autosuspend) mutex_unlock(&core->pm_lock); - return ret < 0 ? ret : 0; + if (ret < 0) + return ret; + return 0; } static int vdec_pm_get_put(struct venus_inst *inst) @@ -669,7 +671,9 @@ static int vdec_pm_get_put(struct venus_inst *inst) error: mutex_unlock(&core->pm_lock); - return ret < 0 ? ret : 0; + if (ret < 0) + return ret; + return 0; } static void vdec_pm_touch(struct venus_inst *inst) From patchwork Mon Apr 15 19:34:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630640 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 E1267C4345F for ; Mon, 15 Apr 2024 19:38:59 +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=UwngFTCb79vmvxVTXW4RODyFL2STYLb4pSDjNZDAhDQ=; b=lM/2y0JWRmX40D hISh0+Gb9pcWJB6CnGS74eRX37Si7OombWu1PSA25KIM/bMObWDmXzOBWnKSRZtQHn57ksjCxxxQ2 Jab70860v5JYe6Y9KZyb9A32VXnsHKAD5Cj9k6mZSkB0H+7Yc4bIuI4ig8I0+sw9SrPlzprisA1pl zMAK/GcRDHODUe3IRb+yYY+4TfvQPscziFL+TBhg12TsSkupbFABT230gvqta5xLmD6UW2pSjYuvD R1swOkslOcAx6MTz6xodVkmgCPFXfXgIH9rnoPav4aIWYBeEOOY7ByBXZMNQUz6xtu2PDmwRw0K9J V7NqQir3RNpLnO9AmjhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSAB-00000009eX2-2gb9; Mon, 15 Apr 2024 19:38:47 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6d-00000009cLu-05q5 for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:35:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=iMZCcGT0at/n2sdsTlaxf6HXRDJtJnjvmf8GQe8Iq6Q=; b=iCfFJND7G0CX7598omwNzfmmxp xMJqC83eKjZjgpVNABuT/lWlv27mCKb0IO1f1QjgFGtRkYFs2A3XqY3PBaVVBmruv5Qqdqm5lF3GX jgmlh8HJg5gZbL08PMIaad/Bh0/qQntQ4QuHXzrFvFtNcPUZY4oCIdSaqF3fxCNxYxldAGLJLeve4 FG40r6Obmj26knJnBcrGExRvdxHssMN7wba4AL+HToClC8tF+n52y+gFcz9Ma8c1WUhkl/vlc64Sz cpKWBKQi6ZPPlpcLGncBZKy86kGoKhYUpZrhCeXlhwPOiAnWFkeq4VbX4TCgRERDsJqVWeagKD+NA GCf9294w==; Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6W-0000000AimY-2RPM for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:05 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-78edc0f9636so160355385a.2 for ; Mon, 15 Apr 2024 12:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209698; x=1713814498; 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=iMZCcGT0at/n2sdsTlaxf6HXRDJtJnjvmf8GQe8Iq6Q=; b=fFf25N1WQyBeYVWem1bBuZV5YhE24VG3SIcnOLE6O6DcePV1ZigeJWhQIDuu8baOrh P4DMd5ab0dDRk68aZmItvF6wm6ZYDJF4YdQSifDbf3s6yvO9Ji8InOPMy61ZWT9AnXDh RBDsfq6xuSe25uQz6KhM+KV34bPz2XicQv8JU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209698; x=1713814498; 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=iMZCcGT0at/n2sdsTlaxf6HXRDJtJnjvmf8GQe8Iq6Q=; b=GaV0VZt8ZXHNV1ffBH1AjY/m6u8Tj6CEBGaSUS9zITDfWF/FSOlLvc1p/6xl3GX+iN mJBqfhJBce+XP0IOrlJZfqwEx9AYbGEX6xh2iAEubHxoZ+EL8biUx8qTyAWl2GhQ1StA bejYXAA4Mk51cdaG6eZBuFNAtU3qoZOYDJXUDh1JrtZC6qiK8uIz2imrZf8nKSC7pZmV vEWEgMUQnesLE4Hshtzw6c6IkDC6woZ6Bl1j5s9leIPvz3KZk5k0/ZU0errDR9pbe20f ImSqmkDDzt9rfJoLf6S2m/wAL4IKdJA38dxUAwK65+EroY+j+u7eVsjpmkUksVeKPVw8 RQ4A== X-Forwarded-Encrypted: i=1; AJvYcCXs2QjL76wFuyRWKHE8YHwmN8D04VvkFpgxJzTP69dYnd/McHkUzSbakxg9jDvWn7Vn1tqVp70NX2F/svnci496/GCzHZ/0Ag64zPJXhpdTBTUo4K0= X-Gm-Message-State: AOJu0YwKnu/sIAGDtHv0rQMU3oy5JOkpIH62f+Up+vvWyU34q+8FKmyQ +uLl9gOrKnKCuaq8EeXsiGQsQbbdKVayS55Om+1ns1ITh4ESfvrFFX9WXmadQQ== X-Google-Smtp-Source: AGHT+IH3ksUcYlN9cp0k1WPEjfsSCCPteMBHE8e8FR9KC+RBDbDTxTGGbvdceo3EwW9xNOFzS8IB7A== X-Received: by 2002:a05:620a:469f:b0:78d:66b6:a786 with SMTP id bq31-20020a05620a469f00b0078d66b6a786mr14598431qkb.35.1713209698470; Mon, 15 Apr 2024 12:34: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 s26-20020ae9f71a000000b0078d3b54eb76sm6718055qkg.78.2024.04.15.12.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:58 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:44 +0000 Subject: [PATCH 27/35] media: dib0700: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-27-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203501_366021_7A1E31EB X-CRM114-Status: GOOD ( 15.22 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/usb/dvb-usb/dib0700_core.c:67:15-16: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/dvb-usb/dib0700_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c index 1caabb51ea47..b2ad2d0f76f8 100644 --- a/drivers/media/usb/dvb-usb/dib0700_core.c +++ b/drivers/media/usb/dvb-usb/dib0700_core.c @@ -64,7 +64,9 @@ static int dib0700_ctrl_wr(struct dvb_usb_device *d, u8 *tx, u8 txlen) if (status != txlen) deb_data("ep 0 write error (status = %d, len: %d)\n",status,txlen); - return status < 0 ? status : 0; + if (status < 0) + return status; + return 0; } /* expecting tx buffer: request data[0] ... data[n] (n <= 4) */ From patchwork Mon Apr 15 19:34:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630639 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 3407CC4345F for ; Mon, 15 Apr 2024 19:38:42 +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=LrU4ljCHbArpqu55UEVODni7AnIE5tDbRLFjjQXr48w=; b=j4S+B5kRLGTRTX l735fprhLvO+kM+sj/eHp0dWl39C/482NWp/Fr/ssu2oFbjvUYCJIuInmFbdToqegxE3UPkcXf9y/ lioeHbEiOkf1aq8Ejbi4zPr8B59jgW3kKGzXwETEgFD3WEXPRP/VuPy4MKGxmRslSBt1qJRpCrgFC tjMQ1ariB/G3zsexy0r3WDQB9fIhLHrM12liMJZxeblm0Rr4DuLmTYLRM8JBXF3tNPWz1u/f+LTIe 0bs6bqISdHrjuhYBEW3qg1N9Cm7Itb2D9KB7zp/RUtlQLR5P0xowiNR5wJql3z8J8fN8aRH0BGUI/ Z9afdPaLlQEcTGxb2arA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS9u-00000009eJg-0HPp; Mon, 15 Apr 2024 19:38:30 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6X-00000009cFP-32ih for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:04 +0000 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3c711afcd43so424332b6e.1 for ; Mon, 15 Apr 2024 12:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209699; x=1713814499; 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=Mj+/6N0GPAfvwkpBReOqoC7KAQaGgvQV6dmd/kYlEN8=; b=RBh0Ntht6WrsMyRqOUPWOykWdqUWa0+j63l5NmySLifScFl7ROidepZflIkufZC0cL g1EYXYWP3BPKJMMPAXAkgUYL91CqUwiZks34kAlifthfRW3uu0PMMy3VBp/KiWdNoXW3 doFiYuYiNr/uzU6ALKXgVXkaHubbyFZxN+zRU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209699; x=1713814499; 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=Mj+/6N0GPAfvwkpBReOqoC7KAQaGgvQV6dmd/kYlEN8=; b=vWkiDw8nqE7iY/ts+MW7AGK80q1yKWTs3eZtjaIzR4D+3w744MqHxY9WpgPUTgdnj1 zWMsk9RPCm/UXz0RTViVG5TAg1HcDYiUNSu3bBAQAbItBMJVWcUC0vEREMrOTrf8Uf5s knfCDuZI5gkSit3cbjnPFVrTlyHJXBRqrTbwd6FNCDfI0uQ8OB50+pf4OlhwKZexrzla 3L6se4MZQwuwtCGsSr++HyIRYqvQ/rUTFXae+Z58LxmO9+f3HLBmwk/5/ZVh2BDc8qgT J1I1mjHl0sNIfqNVEJR+wWnQDgBDOe61DueAebzGUkbbmEhwoKRwx+/ENeaamhdMbR46 AuUw== X-Forwarded-Encrypted: i=1; AJvYcCWitHTQ9ZpXeBjuDdaZ43hqohVpuSsbJqPfH72yiJeclbXGzXt+5/KYaQqC236g2l/JCSNcDCugdARx35Ew8RhhgL3bxzeov7r5paW0kVIrsu/2f+4= X-Gm-Message-State: AOJu0Yzm+SGIgxjcTfsR+U+sJW6B+hFjdTItRmC24DX30M2D6Yu9pw6M AvTiZ34+2N1Ojh6SBkD9R9hXll7huUUz/tMD4jjoXFr35D6TnNAR55z+ZErs9w== X-Google-Smtp-Source: AGHT+IFB7ej7jQ6Y7TTKmDCBXS4WSfTxH8KcZpQzoboVm109oqWmXInnRELaaHMlCW17SN5elKNPwg== X-Received: by 2002:a54:480c:0:b0:3c7:c12:e2fb with SMTP id j12-20020a54480c000000b003c70c12e2fbmr5150205oij.56.1713209699409; Mon, 15 Apr 2024 12:34:59 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:59 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:45 +0000 Subject: [PATCH 28/35] media: usb: cx231xx: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-28-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123502_081933_33029D64 X-CRM114-Status: GOOD ( 14.01 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() rivers/media/usb/cx231xx/cx231xx-video.c:1282:12-13: WARNING opportunity for min() drivers/media/usb/cx231xx/cx231xx-video.c:1328:12-13: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/cx231xx/cx231xx-video.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 8f347bbeeb32..bbe207d72427 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -1279,7 +1279,10 @@ int cx231xx_g_register(struct file *file, void *priv, default: return -EINVAL; } - return ret < 0 ? ret : 0; + + if (ret < 0) + return ret; + return 0; } int cx231xx_s_register(struct file *file, void *priv, @@ -1325,7 +1328,10 @@ int cx231xx_s_register(struct file *file, void *priv, default: return -EINVAL; } - return ret < 0 ? ret : 0; + + if (ret < 0) + return ret; + return 0; } #endif From patchwork Mon Apr 15 19:34:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630638 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 C2E02C04FF9 for ; Mon, 15 Apr 2024 19:38:40 +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=FgbAnhJq3yHqLDiATJzdHp8Z0F1LrpW+p+agS19/c7Y=; b=RUzYxV3HrTPFse ZaltT5uLb9beTLjbFCpeKjMFISYTvnTd8FzBiXmGov3MTD2T2Ee/6Hi+8FpnOpxbEZgfCHQOjeEAa KwfKAXamYYnmqCY9kAJ6l0vUBKmQvIkm2a7q1wZl9YVlvmg+9HJiGSATlssN6q5WZ61SYvNJzfh1e ec+FN6Yy9pMiWe87wgJIZaaqviZ1YkKYVBbP7okz65/NykC+tzOdXx2R6HgFzfwfHHiDOeVgJEMAH i20B9MiupsikA2bR980Y6bFzqidHSoxyM7zOr4FnR/EKN7iRWNAjl4nxoURXpwQKnBckSJlE+ZXYP IycTRi6pp/ErUQ+dS8Dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS9o-00000009eF0-0Zwa; Mon, 15 Apr 2024 19:38:24 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6X-00000009cGH-2Was for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:04 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-78d77b309f2so322302885a.2 for ; Mon, 15 Apr 2024 12:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209700; x=1713814500; 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=OhmQYYxWMuudLBjdJjOGHKHYUzO1QQEhFUDY1X02X9Q=; b=HrfTteglxyjYgJrQpM/uK9qRGM3um1b+1G6AO+tbkd4NKk59ohy0rNXHP3UXv8d0NU Ym3CSmNXDvnhPA1UMrpYrOu5LaUTxuwHwvd6w0x4m0xB+Ap+6OhAhj6xusZCxXrInrae T6t6Xg/XF/iGMTS2a4ANPAmstuNwAa7rJUX3I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209700; x=1713814500; 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=OhmQYYxWMuudLBjdJjOGHKHYUzO1QQEhFUDY1X02X9Q=; b=VUIIWNOWPlqPpuTJKKgT6eHPJoGbXivVoLhyx+jWmV/40blrBGJwF0msIEO9A5v3DO OLY2O1T1zNo58p26rrSiV9HMnpEfYUD06OfczQ4Z4U67dOsxoe/WgkSlI9WUx/XuLMWv cPecmE8UUGTZtL4Ui3D53hk+h6538tOAoumYASSNIshHzrfy16pmZ8xbCEu5BJ9CVKPQ RjNbmjXoCKNyoDTs14bkE0ugfcKLxVFvxSmkdWaAj8CrVeLR7shURZ/8JkzYJe50/eNF KLSB5u29PSN8NDb3/Jom3D/LZRK3aMRhKHxncka3IJDeuT3WKhrCkfBf/XQu1uW8Ag8n JQ3w== X-Forwarded-Encrypted: i=1; AJvYcCWfoXd2zo8uA+i9VeLcHzBxIkm9Z15JvZkktrIbaX77rZJr8meCDDNpKgm774lr0cBRGdU9C/TVPQWxVIobeeKw9cOY6+WIGV9mNTL7BEeF+i3wia4= X-Gm-Message-State: AOJu0YwtA3gPgtDAJ2gsOM3XmNEhzJo3H7FC2zHGJZGuogwLkT77EaPk PW0CYuTVpzOkIysiSJ++KQ9GMbUayZYjns8WkEbtLEmWvA5hG946P8K3VVkzIQ== X-Google-Smtp-Source: AGHT+IExc3kiGm+hEFRw+kQDfViul4woHzF6WRs96subTZ4c8qoJuWqvczLaOhJGq/Hyw06BNYyVfg== X-Received: by 2002:a05:620a:3182:b0:78e:dcc4:339e with SMTP id bi2-20020a05620a318200b0078edcc4339emr7592795qkb.11.1713209700585; Mon, 15 Apr 2024 12:35:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:00 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:46 +0000 Subject: [PATCH 29/35] media: i2c: rdacm20: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-29-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123502_125056_BBEB52DB X-CRM114-Status: GOOD ( 15.20 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/i2c/rdacm20.c:363:12-13: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/rdacm20.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c index b4647bda8c21..b40d40b0cdd4 100644 --- a/drivers/media/i2c/rdacm20.c +++ b/drivers/media/i2c/rdacm20.c @@ -360,7 +360,10 @@ static int __ov10635_write(struct rdacm20_device *dev, u16 reg, u8 val) dev_dbg(dev->dev, "%s(0x%04x, 0x%02x)\n", __func__, reg, val); ret = i2c_master_send(dev->sensor, buf, 3); - return ret < 0 ? ret : 0; + + if (ret < 0) + return ret; + return 0; } static int ov10635_write(struct rdacm20_device *dev, u16 reg, u8 val) From patchwork Mon Apr 15 19:34:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630650 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 3D5DFC4345F for ; Mon, 15 Apr 2024 19:40:31 +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=vJ2rBKHL7wOaYncrZIVfTfmKcDA9jKOLyhp/8FUWGkI=; b=lszzjpsUR5khxW mlKkIFGqWjV2e4hBuXrkgr0PqxxIculmPFwYdk0m1yrZfMOg71+pa5un2RFlIRiqqP0RHcDvALXxu rn2zWvoSUGpqBwl9nVuYTOiGH/ni+K//nLqSGz0igS4qzve/M4fbYaJSyNsD4ITH8RwmHDWYb4keP of8gxP6IJzsagVv6po5pgmLXHLQMMqTOxOw6tR2D6Kkg6s38Hxm+A3BpIk/KhPCt47atHmccICVZM oebb1DwH82pqQ+F4LG476Zs73pl4Oydfw4/SM6NJhuG86PaEKDznOKsPRj7ffPzkReTpw129dFY01 sRWjbi/ODeACeP7swdPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBg-00000009fRj-0rdO; Mon, 15 Apr 2024 19:40:20 +0000 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6a-00000009cHb-08BN for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:06 +0000 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-617e6c873f3so39447357b3.2 for ; Mon, 15 Apr 2024 12:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209702; x=1713814502; 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=jt2XKVmYwRsbqiFBuUwX1RfD+QA2xOHKpcd2HjFMj/E=; b=jrF5pB0QD9pdnoxhteeXkSUCvzAOGK/XKQtYCY+JfPJCEUdzyFq5fgpAZhdci9edKT HyaduLAkzCsdYnRAl+VvwOjEHru5r4Yp8wh/xoPjTLfyAz/G5EysIrKgcP7xERG9+vGQ 2PVYwu9b+0yf6nrcXBIY3ZzPB0G55DqnuclM0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209702; x=1713814502; 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=jt2XKVmYwRsbqiFBuUwX1RfD+QA2xOHKpcd2HjFMj/E=; b=SY8ucLKb9LcpiMCs+IrAgVFMFl3Fi6dQt8whpP6151wIzyd8nYFXr408puuA//Bfrc mMzteYuJij2EiG8san6y0U6LJCVegFLEzwW3oF0ktKYuCeKku7CpyIQ5N91C0AkX7vBk wu10GWOa9Nxc47uvsKS5N21/krD1KnV4SsD02KBmrf0oOBUDwxwOn67fX1qE3yQH2QlK Ib+oMxhRYMZi9CUUZZu71raLNH/LinKNBUFHpj7klZUUs1JX5oRlty2mdyH6uLheedJ3 HIB32oZcGd3vcBY/9gr1FyMIajlvMzmfnm5pRmulEGR041k0bMyXYmalZwwCw+4zFSN9 44DA== X-Forwarded-Encrypted: i=1; AJvYcCUYaQQYwpchxD7CLup9DStlsDi7oLqw7FzyhPKjGj0uWjQYsghg9s56NAe3I+QjLNFXzbGE+XdiFlUdwxgS7DZ5iERC+RUGCO1vrNh/rS8Osm4BRtM= X-Gm-Message-State: AOJu0YwlS9rP9/cAK4O9f/I9vIvsNZxic3wEAFBh5pKNBBp2gSWZgXYz sExKDxKYN15a3QYW2x5HF8zvWK2ID0OrZ1+x3DG3nrcDprNSuwNCNL/JQrbTcA== X-Google-Smtp-Source: AGHT+IEHr8lEllDyip6pAkUMGURPdINr08Mt5MZfIhMi3nIR8h+wyIaxQ16q8BBaKyR8INXB42ugWw== X-Received: by 2002:a0d:e292:0:b0:615:2078:9c0b with SMTP id l140-20020a0de292000000b0061520789c0bmr10298321ywe.40.1713209701695; Mon, 15 Apr 2024 12:35:01 -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.35.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:01 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:47 +0000 Subject: [PATCH 30/35] media: i2c: et8ek8: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-30-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123504_240735_3779D183 X-CRM114-Status: GOOD ( 14.94 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/i2c/et8ek8/et8ek8_driver.c:255:13-14: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/et8ek8/et8ek8_driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/et8ek8/et8ek8_driver.c b/drivers/media/i2c/et8ek8/et8ek8_driver.c index e932d25ca7b3..c7984f90ae4d 100644 --- a/drivers/media/i2c/et8ek8/et8ek8_driver.c +++ b/drivers/media/i2c/et8ek8/et8ek8_driver.c @@ -252,7 +252,9 @@ static int et8ek8_i2c_buffered_write_regs(struct i2c_client *client, rval = i2c_transfer(client->adapter, msg, wcnt); - return rval < 0 ? rval : 0; + if (rval < 0) + return rval; + return 0; } /* From patchwork Mon Apr 15 19:34:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630652 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 12A0FC04FF9 for ; Mon, 15 Apr 2024 19:40:37 +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=xLqOWVsBEGLXWoPPEDf88slHHKY2WVsisPN3bbWifg8=; b=M7pvspQOR6Zeot DF3PHxFaoSefnYIW65HNEPOgn6MTTpMeeqOYXkHxuslqitswSu2VqVC5HkgnBRoXqQms1ndT9gF/P tZUClhNttatr2NQi35djmmqtUW99Wfbo2w0GYN0IPPY7DXMz/JwEnhWT1EYkPIXMOiHt+OoNlzT+U 4rNiuz/gIAj/yl0IKIAftgxWNQax3wQXSU7xGBlZCsUHCdG/ZOXlLrhTKPUp8/t6vZu2jcC3PyV+/ fJQkAhBotvihZ5OngJpVbnIYXjbgzHRPXUb5o0AAwfjE+tWpzG7j9QZQDHH4+XdZo1Yec7DFoQNP1 g0M2HVBTm94eaZyJL+dQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBm-00000009fVk-1cfZ; Mon, 15 Apr 2024 19:40:26 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6v-00000009cWm-2aUH for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:35:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=HU2Q8r5u9tJlP6QMXdfGI/fLu0DCpsTU5mW0ctKluKw=; b=KkzaUIiiGAe2uwh6tdZtZWFaad TSH086aztdCwBe6qoP+gw0WYrn6xSwMzPoaqop31NfNvvxb1Lo1X7UhW6ky/sv5r1zbF0/K6wSMW2 gi5LRqMPP854MCW+06/kb+3NGKUrQoXs+zemC08ExM7eF4EIyLb3ByvlUE5JI807krLmSi6siVijK 3+dzgfr/vY0J4dWFwDh6b/6v00qQNADe04l8/SLPCkpzjoLJtwugM2H01nMsDek/KimnoNLgYkg4K HpzEbJHUrukhoDMBPAdSmR4C5Iy8GY0GSBCCdbaxBpInBJgPXhY8LO9b1MfpxVW7UUneyQEbmO4RV UCBfxK2Q==; Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6h-0000000AioN-3wrC for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:20 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6eb86aeeb2cso485235a34.3 for ; Mon, 15 Apr 2024 12:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209702; x=1713814502; 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=HU2Q8r5u9tJlP6QMXdfGI/fLu0DCpsTU5mW0ctKluKw=; b=CGm89d9lGE2hd3YcKB+F2MDzgh45Sh9YdO4jlYrRyy2N4/cqLI7zR9K8XyyLnvFlpD x5Qc8PUexAWGDfuW/yH/uzcFIF+Ur7kS1eVCZOJytN4kB4qZaWT3cW6ZyxQuwKcGAUZT u5WOY/d8w2Bp3RgMEc0ADTRAAUMBc/Z7rbbRE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209702; x=1713814502; 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=HU2Q8r5u9tJlP6QMXdfGI/fLu0DCpsTU5mW0ctKluKw=; b=xC5dESaCvXU6sEooxuzSJva9be80i6hu7wMVma+ZWnQUZbs+lcyBVk7FhxdtaJvffT NbpvSTDsWYa8o/MSRqf+1Q5JypUuM/zYXt5M0r0Ngjvi1dsFVSIrbjk+kSHS0uQxBDYD AmohXikm5PUDbGtdLugIRTkhiRSAMxf2OJebuV1QhjvnPi2M86CSNQgkH5fOsuQOemZJ oyiZVtJ+KN4rHh2T8xJ6IhfCohrvKq0QxC/Bmgg0Cazl49op0GVOjyIS1DngRQwEbWKV AX8L6OJyh/AAeIdekPlmmbwcLwwD/fg3tWOA/5tVpjqNKYekVzvZDWxah6RxHDwe9fEo FFKw== X-Forwarded-Encrypted: i=1; AJvYcCXqGnw7/F12FTEe8Ov/bbtwGrMws5i5tWTldckvct1Ffi2vAgcustSPd7yyazH/yM6UVBXz8DjffbH8DS8zLcRfizQ/FRKGxNL4NI3kVEK6X8WCdsk= X-Gm-Message-State: AOJu0YyffJs7BKZKl8TYixwDqJxY2TZP5vBoCQpE8NoDqj6jlsFMdbYb X4yeA6iPnPt+DWh3KwbkdHt61wDf0l9lWPdN97evuabAaAo4Wch7gHAHuYWi/A== X-Google-Smtp-Source: AGHT+IFpNLbWkYy4T2kNtWWO3Krrkln4WZhxhxOvSx17rkc4ihK9bZ3DdjfUrMbHC9Tqsq3KJ+SA1g== X-Received: by 2002:a9d:6a15:0:b0:6eb:7c52:ed04 with SMTP id g21-20020a9d6a15000000b006eb7c52ed04mr5573331otn.5.1713209702690; Mon, 15 Apr 2024 12:35:02 -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.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:02 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:48 +0000 Subject: [PATCH 31/35] media: cx231xx: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-31-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203514_572762_0F99533A X-CRM114-Status: GOOD ( 13.98 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/usb/cx231xx/cx231xx-i2c.c:353:15-16: WARNING opportunity for min() drivers/media/usb/cx231xx/cx231xx-i2c.c:262:15-16: WARNING opportunity for min() drivers/media/usb/cx231xx/cx231xx-i2c.c:326:15-16: WARNING opportunity for min() drivers/media/usb/cx231xx/cx231xx-i2c.c:176:15-16: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/cx231xx/cx231xx-i2c.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c index c6659253c6fb..28de72856c90 100644 --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c @@ -173,7 +173,9 @@ static int cx231xx_i2c_send_bytes(struct i2c_adapter *i2c_adap, status = dev->cx231xx_send_usb_command(bus, &req_data); } - return status < 0 ? status : 0; + if (status < 0) + return status; + return 0; } /* @@ -259,7 +261,9 @@ static int cx231xx_i2c_recv_bytes(struct i2c_adapter *i2c_adap, status = dev->cx231xx_send_usb_command(bus, &req_data); } - return status < 0 ? status : 0; + if (status < 0) + return status; + return 0; } /* @@ -323,7 +327,9 @@ static int cx231xx_i2c_recv_bytes_with_saddr(struct i2c_adapter *i2c_adap, /* usb send command */ status = dev->cx231xx_send_usb_command(bus, &req_data); - return status < 0 ? status : 0; + if (status < 0) + return status; + return 0; } /* @@ -350,7 +356,9 @@ static int cx231xx_i2c_check_for_device(struct i2c_adapter *i2c_adap, /* usb send command */ status = dev->cx231xx_send_usb_command(bus, &req_data); - return status < 0 ? status : 0; + if (status < 0) + return status; + return 0; } /* From patchwork Mon Apr 15 19:34:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630653 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 A8D90C4345F for ; Mon, 15 Apr 2024 19:40:42 +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=PivJFNR7bx4Yy2s/OxtVelI4dKzwU5bf5TZdr+ZiUSE=; b=jFvkWbFQubA6VN qUFEzML6m8g1Z3iTcxZm1yNrRruP4k/2vowU8AK9u5CQBeCob9Aq6bfHrrG3h5bXN6kmw6PniNnc1 vmKhKuXPxfdJWqh+SmQ72F83o2E7Algsh/2MsyrmTNGnlHr1CvpZTGqrVfeide2m2ftWcwXUyhkgr OB8LgxDv7fzftQIUNCNPnGpgUM+bwJBomtIPsypmzfkKDTaoIzcE9EgOqYscpksoLgT+NkKwuFXBr V1+0I5Gu2RZD1ioz0ul/+AxwzPK5kz3bbuJCo+AuwmBBqBQMDZrrSINzJOoIUBE5gDLqPLkGk0PEu 8HKU+eMPLn1ne0Stgsiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBp-00000009fYH-47NE; Mon, 15 Apr 2024 19:40:30 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6v-00000009cWw-45L8 for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:35:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=hZ69zvEi+2hVMHqGREi0s+o1FDmo1qxeLo8vD8Yn8BA=; b=IgPk+PkukNzqswJQmwUU+/wJGO 6/4A0C0U7mTxTDduV8QgKc5Drfvwds5t2kW/dNBfEco8T1kjkpR5//slgCKwFtzheuTIJ9R4sHCFC 3u4zxDIy7Yo5w3XphYNpJxtmM/+9yu+WdcNa4j6DMDGAZPqngbyDgxrt0bC90cV6ozcfB6bHigmKP RWA1eCAOkSIGXCaKHEKSI0xROk9eTpbNpxBuuU6l5v64IhvIML0EZjxi4zyrUsc8jPKb7J3sr8xRK KRtGpHJ6vQuRyKOCfkP1PYZ3/8/+kbu0o4XGQD2/JUiZxaone0/JoTAhrbEaZGv12LDJkAXjzRQee /Kb1vhUg==; Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6h-0000000Aioe-3wyR for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:22 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6ea2ac4607aso1923541a34.3 for ; Mon, 15 Apr 2024 12:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209704; x=1713814504; 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=hZ69zvEi+2hVMHqGREi0s+o1FDmo1qxeLo8vD8Yn8BA=; b=cit+tk2/J2n6zBP+FQNE5WxeOgDftV6EpUjAEFANXtfIQdUDIxXsVmP4Rb7ooo3Zgm CKJZFuob8a5GvUZQrC0mL//yZOIGGt3u7FHcOQ3jCpxHZzhGsZ/Io+DRaiaqGwEGf4sx q0zMiaVKN/fCNvDsJ4JWe183rXnUYBpCMP/04= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209704; x=1713814504; 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=hZ69zvEi+2hVMHqGREi0s+o1FDmo1qxeLo8vD8Yn8BA=; b=aZqW9MGjeAC4GgO1y2G62vazdcHao7vBfebjEHMQGTqiAnjGFz2m5ZzBfUjdYz4nPR jCUnVthxiSpWEeILJg5smINCEZVmnbXwc/1NwzPN6/ylDEZBRQAMYNzSizN1bQ8FW6PC d+aDjfJu0paH5TMYBFL4BcZrAKNJ+yRqapH3c3pYBKBWtDG8XLiUuofAqhe4RVH57CbQ AHeimtht5OyD2hCVb8D0ndkAmjP38WfHL9v4HjFnJBA+ccXZYTTFLKUMIYnpqRuo9PxU Ev3ckblDGRX/Z/v9s0p+Mk/KOuStZbSq3E7nKYVdAWPhypRAgkVFW9tYcdDDbedoNZPX bXHQ== X-Forwarded-Encrypted: i=1; AJvYcCXPZWhLVnsM7EyZOGjnPPO58wfBLUzH1Q9gqQKUn2mAY2vAAOaCHHZnhYC0DhOlaYhv0O90HgHreBWsxnOTEocC+EGNaAgb4J2et10MeORfMgc+bC4= X-Gm-Message-State: AOJu0YyWKr1ft5HkYeNcq0aMdj475dxSHi3GCqbyIz46BzDGSRpP3vSg UcXpjXigH+WT+gpbn5nkK8FhzytQ9CdpLUFu19vd8MWMDkkqK0MTEnIip/YZxQ== X-Google-Smtp-Source: AGHT+IGR6r574HxBWsbrxXxGaHrf3NXllaDQAZexGaElZz4TGdMFy5/7Wsa4Z+FqqK7nCIYg/Ya87w== X-Received: by 2002:a9d:77cf:0:b0:6eb:68b7:581f with SMTP id w15-20020a9d77cf000000b006eb68b7581fmr7839393otl.22.1713209703885; Mon, 15 Apr 2024 12:35:03 -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.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:03 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:49 +0000 Subject: [PATCH 32/35] media: si4713: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-32-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203515_142779_9D4EBE1E X-CRM114-Status: GOOD ( 13.96 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/radio/si4713/radio-usb-si4713.c:309:15-16: WARNING opportunity for min() drivers/media/radio/si4713/radio-usb-si4713.c:360:15-16: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/radio/si4713/radio-usb-si4713.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index 2cf36c8abdde..0ad1bfe09004 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c @@ -306,7 +306,9 @@ static int send_command(struct si4713_usb_device *radio, u8 *payload, char *data 0x09, 0x21, 0x033f, 0, radio->buffer, BUFFER_LENGTH, USB_TIMEOUT); - return retval < 0 ? retval : 0; + if (retval < 0) + return retval; + return 0; } static int si4713_i2c_read(struct si4713_usb_device *radio, char *data, int len) @@ -357,7 +359,9 @@ static int si4713_i2c_write(struct si4713_usb_device *radio, char *data, int len data, len); } - return retval < 0 ? retval : 0; + if (retval < 0) + return retval; + return 0; } static int si4713_transfer(struct i2c_adapter *i2c_adapter, From patchwork Mon Apr 15 19:34:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630641 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 212CBC4345F for ; Mon, 15 Apr 2024 19:39:16 +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=yBZ9QcRyMnolYW/O+oTjg/Wsx/DH+WfMZx26cf65ZSI=; b=J6rFf1GGqy7VxQ vcaZNqcK6JtHb4M5OsdsEPjxKmcqEgN0U2/Ig7gsrBZNPgTVYwVYpSg6zQusM5zahEANLxjEAjtTc Nnv2LNUZvcGscQUhisXSh44X2Xfex1Xv5veeTEcowfYIs7vLq6STCul4b3MJLmdwav/aJIY+KpYLH cy98Soqyyj8xqz4mdS3gFZ3APtKI/0QtvqLsakUiu6hiD7NI66/OzSPwZSuhWzc2iLYn4oqyyJ662 43kPmldEDj75hIe8NmZZSkBPhvgOSCUGYhP5R3EgX0FmxAXA3dCCir8TrvSSE+gdnDjkE+Sw95FtH xnCBrxUA03aeGE8Fx/AQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSAR-00000009ehn-3NZe; Mon, 15 Apr 2024 19:39:03 +0000 Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6d-00000009cKt-0yv6 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:11 +0000 Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-61816fc256dso31279327b3.0 for ; Mon, 15 Apr 2024 12:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209705; x=1713814505; 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=6KP0c5kcroy4r+J8V6+b8GPdTtYSSQc0uibLBJF+m54=; b=EzCB5VL+5fQDFhYpw7PBZn+FgZ8OcFREQdWnOGxRk92zUzfw+ehVtf20z9FxC1QAKr 23YMJOjnsSCWga8tmUBEXKZtt1NlbbIXpRcxQBLl+GyK/xJydNHBr8mxnxFhx3QQPReB MdbG91f4NuCQwjOwrTmFceim5JRPxyEepvK0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209705; x=1713814505; 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=6KP0c5kcroy4r+J8V6+b8GPdTtYSSQc0uibLBJF+m54=; b=XTOGarp6DnlbLzgf/gDXi3BS3aHImemAAinh6SfuoKaw57AVBp5ddcxKF7SC/S+NDu 2S/zT3VEGHtkSM8vZ8QOvXMCso7msrY2E0OlqE/5yDGjBVxjOxJzqY89WE6crDcRNzTf 2USruJs13NnaO7yqm8JdFpyfaIxN+z6YjY1K0vteDERbtMFYwVURdgiu6EyEAcsJF+n6 f2DuwoexmEpeFrp0Ysk9adf/e2gRyS3ezBzWqjATWMOrhLen0JrjrlCo+haSIttKOrW0 bLGNX7FWMUXUlx7PeT0dMSrRqQZfJTCTuQwgt9f63nDm2mQQ9vTpOjRfC2bkaVih2Ity Y4Dw== X-Forwarded-Encrypted: i=1; AJvYcCXVszYsPzh+vetD0kxn6edbJptS7BWRgP+54SKxcsJwFN6Eh2JXYpulsKUxqZQmQDO4FlN2V4klU729P8Fnlxz3pC0tVo31pAYZwS4C2D9t4k0FXps= X-Gm-Message-State: AOJu0Yx2m004MqFJ1cg11Vi8NUbF9z884Jo91ufgItOj9aDBchajXXQP U9J/bw/l6+cBX/nVev5QBXJ5jRHgT35wSQsnMwXdRygyhyGqAUAnUoXXRxfsww== X-Google-Smtp-Source: AGHT+IFGGKloXi4LQc1kB9HoB/VhdVmfNZmSGv5YL+7VwXl3CHp5amZHgBcaP1BDvt5Qqswtqu1lLA== X-Received: by 2002:a0d:cd01:0:b0:618:875e:2bc1 with SMTP id p1-20020a0dcd01000000b00618875e2bc1mr8807707ywd.21.1713209704967; Mon, 15 Apr 2024 12:35:04 -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.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:04 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:50 +0000 Subject: [PATCH 33/35] media: ttpci: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-33-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123507_445985_6FDEF38B X-CRM114-Status: GOOD ( 15.38 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/pci/ttpci/budget-core.c:280:15-16: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/pci/ttpci/budget-core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/ttpci/budget-core.c b/drivers/media/pci/ttpci/budget-core.c index 25f44c3eebf3..2d85ae1ef50b 100644 --- a/drivers/media/pci/ttpci/budget-core.c +++ b/drivers/media/pci/ttpci/budget-core.c @@ -277,7 +277,10 @@ static int ttpci_budget_debiwrite_nolock(struct budget *budget, u32 config, saa7146_write(saa, MC2, (2 << 16) | 2); result = saa7146_wait_for_debi_done(saa, nobusyloop); - return result < 0 ? result : 0; + + if (result < 0) + return result; + return 0; } int ttpci_budget_debiwrite(struct budget *budget, u32 config, int addr, From patchwork Mon Apr 15 19:34:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630649 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 E32DAC4345F for ; Mon, 15 Apr 2024 19:40:25 +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=F3T00s0c3E8yCzLaC7D0N6abIo73G8c88d76C+T9aDw=; b=amq0QUFtzUna2P UtDVCCtqE+kR8NMGj6jpSZatpU5a3rpIQBX2hKCKSy8FRSAoHZNeVfhO32LibLxZdw3k92EqyTo4A OF1bQirWELwM3g20QMv3nGJGoRdyUtla9bY9msDLzD+fn4Xt2Iy/5tVCQqOJxyhtEW7tO/wh9W0bW kkEtaC+xg0rEPtIKCSF5eKADrsJohFzMB8YJjLMFHwvSGRzzz84UiuBam+VhLdUXwRkTVTJsgVkgr BnITmK8HTAw4kGyDADLnfQp+yD9yuTB36h2A67Vx6hnR5RT+mXZYDk/eDBdj+zup1RE+W5Iiae6NL fvRxxjsAQreEOKdZzgmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBa-00000009fOu-403o; Mon, 15 Apr 2024 19:40:14 +0000 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6d-00000009cMT-2zSq for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:11 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-78edc49861aso135693285a.3 for ; Mon, 15 Apr 2024 12:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209706; x=1713814506; 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=deJ10dD0+0Xsb8NjdDYAyKNbuwQhOs8Vh4XFupDcv7A=; b=h8wFj3jb29+Z8voofQz3QZpMZO4iGn6VnJx+wuD6bFmMops7kgmZA7hLMw8IIRbPNP hfAlPbWD7ES0Jfc27E6j2sipdaXs8F1sx14WFvamqOp/JV/ushwAwgzP1UX//iFg655W JHhAACRZ8dh6ef9dsoaoN7OnKnIk7V+qRkSXM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209706; x=1713814506; 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=deJ10dD0+0Xsb8NjdDYAyKNbuwQhOs8Vh4XFupDcv7A=; b=RdpXJ/l/lnwrl0jW9mZAs+eOMULUEQ6Ycl6E/z0sKwkCLmzygI9jM9AkUGwnmXHCZg ak3yogH0By+HbKMVuGwCRLCidOEQaRBwryXzt7RG81RNkdZiBqons6XNQUxWGaXk+YIM BsUnJIYw2+CsB91mpt1xsTB/vZG4tPTNEcpKLj23Z6ott/6Km9YxNUC1Lmuagf0PRqrK VJmEdkb6bW4bZ4iNChdlg8U138qVNxWe9XUkOb0cvDhJYAadoSoXYla4J5DGuck6dG/z gBFj+AvjMsmIPRG1Fn8bMKzWqlW3o8q7dAuzQLeKtTVGc7mH6aAom3zxbh+Hl1Wtuh24 Z9MA== X-Forwarded-Encrypted: i=1; AJvYcCXXtzhVnqg6UZXALm9k5SnuvCNY5QrzvZtVWqiLdFI0Idc+SlOiD4+Po5hM2DJSgY57hLIRhA6OOmkLo4T3KyiybnbhHi6S+Cx4bEF8xs7uTatiZkg= X-Gm-Message-State: AOJu0YyugUP1iP7BZKJULBg1s/3ubrdNHF5dljETwl6hAkjuzL+tVdmy dBonYDmLv8tSMdON+RXOUhstToRhR/B2G5mkyXYgkDhNSgcF2ERysZQ1OO581A== X-Google-Smtp-Source: AGHT+IER1oNXbfvuBYkiNGhDuuE0aNBQlaGZ+2a+oyzSSefdjaOmTqtivonyQ4TeCmkM1b+mS1nfvQ== X-Received: by 2002:a05:620a:29d1:b0:78e:ef0a:387d with SMTP id s17-20020a05620a29d100b0078eef0a387dmr2507242qkp.56.1713209706006; Mon, 15 Apr 2024 12:35:06 -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.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:05 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:51 +0000 Subject: [PATCH 34/35] media: hdpvr: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-34-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123508_088752_7DE4ED1D X-CRM114-Status: GOOD ( 14.35 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/usb/hdpvr/hdpvr-control.c:41:12-13: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/usb/hdpvr/hdpvr-control.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/hdpvr/hdpvr-control.c b/drivers/media/usb/hdpvr/hdpvr-control.c index 37c53ab85b30..a1bb0231540c 100644 --- a/drivers/media/usb/hdpvr/hdpvr-control.c +++ b/drivers/media/usb/hdpvr/hdpvr-control.c @@ -38,7 +38,9 @@ int hdpvr_config_call(struct hdpvr_device *dev, uint value, u8 valbuf) "config call request for value 0x%x returned %d\n", value, ret); - return ret < 0 ? ret : 0; + if (ret < 0) + return ret; + return 0; } int get_video_info(struct hdpvr_device *dev, struct hdpvr_video_info *vidinf) From patchwork Mon Apr 15 19:34:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630651 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 067FCC4345F for ; Mon, 15 Apr 2024 19:40:36 +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=IRpOmmzt6R4RvEFzlNJnTbrXWMBrtij6I9y6l/H4SA4=; b=rQpviwAeALHpjE TQ4fvu3ycAca/zQtZe2p5AZVMRprvFTM2bvv8iQA+3WHolqdHWote27ph8hypyiDbMO0tz1LnQc98 rRLeYh4e7Eh66Su797CVMX4SPEZshiE6UKSg42ZwuOsPqw0s2J5NgpuBU0/TFT+5O9MVnPQkL+CiM TGllsJmcfbdse+eN5EJlQr/1nHYlEeVSLqa2+QwnROjMoQlzmOciaMRXD97k/8JWZb/IBJ8D0L4yy sEjZTSBXJr7yLBWGg0lbGHvGB2KKIZlFzi6yMUEbW/T1/Kev2SWfNr6EC66EWP0HY4K2ivqYapZV2 Vu6Y2BY2ogTNaH16QBgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwSBi-00000009fTb-3DRG; Mon, 15 Apr 2024 19:40:22 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6e-00000009cNU-0LRJ for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:12 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-78a26aaefc8so206592585a.1 for ; Mon, 15 Apr 2024 12:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209707; x=1713814507; 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=+lJf0+XIBDdSVuJAMeJcbyaAa+r8UncIi6K0ZFQWngw=; b=eOtpnsN1BmS0ptye7ZrzGFp1mY1gnkV7ucOrhv8mMrMv8MwvZMa0dHHg1FERLYCyaU MOuWJ9yS0pcHz0B+jhxZAbBWvOmdRmXXYyYpfpm5PKXAjSKhqVop7/oNQDOKSeh68q9R HQY7dQ2TsRpOB/RRGTXW2sejn7l6wEnO7b2mA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209707; x=1713814507; 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=+lJf0+XIBDdSVuJAMeJcbyaAa+r8UncIi6K0ZFQWngw=; b=MZA5As9uLKbaKyy4Fzx3fLVp9bIuyXAPkCY9iauqhvOzJAfLrF3w6qrWAkMSGNWPPX hS+i4S6Yu82buThYVQHFeo4TWjczDLlLrfNdfY+Re50MPaC2pQLStvNNQoEGo5S9CPCy WpGY8kFs+ySy3lXZjSFqMRQg98tEU4RuqDZFaSwE+pGtGL1l39mEkXN5I/mx/Y1JSO0k BZa+UTewIQ5bVYyzPqP2qNG6BosEN4GjkNGadMW2ct/wVe4ixg8UmFLeoNkDMWTkciRx zjY8WY1g0kIu6xcWeVl8kX7SMbaVX90ae1JVAL6ubjjTWX8s9UgXQcQAcG3EdPE980cj hI+w== X-Forwarded-Encrypted: i=1; AJvYcCUPTjJshtFnxaWxPGKId7WTV7r1hXrgccZl+XlnrEs6ZI2oYYCBkG7aATq/67bjH9uY1SXAniSymvwoA0iott9kc9MBqGJdw+LPNaVa5MT2hH1sp9k= X-Gm-Message-State: AOJu0YzhICNZAWBIxgy3qPWqyCLsitbIXyEofgFM9fqpu1FoIo7PuGtW hfVoGNUciTJXLLKPcZfe3WJ5/Jwu99g1H4kkn5Ih1L2NHl8pJwWkEIvRdJhmIw== X-Google-Smtp-Source: AGHT+IHZ1e+rN5kElZ/+CBGmltPllmsoOBrN7bu5f4/61aiFTpQ8yq022XA0QecM/v+OB1heBU4SXQ== X-Received: by 2002:a05:620a:400a:b0:78e:ca18:4093 with SMTP id h10-20020a05620a400a00b0078eca184093mr13235627qko.60.1713209707046; Mon, 15 Apr 2024 12:35:07 -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.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:35:06 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:52 +0000 Subject: [PATCH 35/35] media: venus: Refator return path MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-35-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?Ni?= =?utf-8?q?klas_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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_123508_357453_6F64C90C X-CRM114-Status: GOOD ( 14.01 ) 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 This is a nop, but let cocci now that this is not a good candidate for min() drivers/media/platform/qcom/venus/venc.c:611:12-13: WARNING opportunity for min() drivers/media/platform/qcom/venus/venc.c:651:12-13: WARNING opportunity for min() drivers/media/platform/qcom/venus/venc.c:629:12-13: WARNING opportunity for min() Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/venc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index de06e1712d09..285bc1b4d888 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -608,7 +608,9 @@ static int venc_pm_get(struct venus_inst *inst) ret = pm_runtime_resume_and_get(dev); mutex_unlock(&core->pm_lock); - return ret < 0 ? ret : 0; + if (ret < 0) + return ret; + return 0; } static int venc_pm_put(struct venus_inst *inst, bool autosuspend) @@ -626,7 +628,9 @@ static int venc_pm_put(struct venus_inst *inst, bool autosuspend) mutex_unlock(&core->pm_lock); - return ret < 0 ? ret : 0; + if (ret < 0) + return ret; + return 0; } static int venc_pm_get_put(struct venus_inst *inst) @@ -648,7 +652,9 @@ static int venc_pm_get_put(struct venus_inst *inst) error: mutex_unlock(&core->pm_lock); - return ret < 0 ? ret : 0; + if (ret < 0) + return ret; + return 0; } static void venc_pm_touch(struct venus_inst *inst)