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;