From patchwork Mon Apr 29 15:04: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: 13647108 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DF4F86640 for ; Mon, 29 Apr 2024 15:04:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714403097; cv=none; b=D0C97CnU2h/7NrXI1AQ0KxTFr3MymmsW7l2oKtm9KblFNWyNqQ5J+ffY7Z5uYDuQ+ERVnzgITjRpZR6RobCXQ3k6ChgXHekuon3yOhoa+lIBOd44lYEJbXpwhx4QWLHKhCQm/aiNfzpxtYTLKpb0TaXgArtuLp17eWBNfzMIy7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714403097; c=relaxed/simple; bh=+AXbzIt1DCOyX+j9nTM1S5LGWAW6l5Ne8tHYdxY2P08=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T4mBTmx9djiUXivvoPVHo8GpfxcdwC0InuI0j8IDN0oakP5lO1QQJJv3LpCQb9kLaD5ZeE4oiqMuf01dtQWZNAq6HEVgY3N+qutZHO85Luo4t1kSeNU0SeB9L6wuBnF25XSUdgOMjBgH9kIRbUaOHFKc1yrLdbWTgJgmJqogj0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=BIAxj/zw; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BIAxj/zw" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-78edc3e80e6so362018985a.2 for ; Mon, 29 Apr 2024 08:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714403094; x=1715007894; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=I5MK517M661jXeUTMXVPJlov9z4l8/dISyr2IlNuzMY=; b=BIAxj/zw4RFm71Y8xK9EA4WdP73OlLbn/YYMPCt45a3qsROesH8V93UILh1SXZDkxe Jn28aJYn68lwplw6t4ndzgKJhRznPsRhzafl7XDysx0VMeSgx5ilckl/GlXSans+O8F7 WDPzw3ViJoJwQWXczB5zZTkUPWXG2oHXiZOxY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714403094; x=1715007894; 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=I5MK517M661jXeUTMXVPJlov9z4l8/dISyr2IlNuzMY=; b=i3tRe+R+eUb4Dq/maXpBARekfLiGXt/GvQ2egVmw0E3NeJXcX6gjOw/X8p9rE0q8WX 8tNMB3OKzRfkOoobXWXvOlywvWciLFY2s0FdcYbbAmmTC06vBoxgeN8KfniDFwgtKV9j sibFXtKYm+D19+E03aQoUULa7p4OR/ClCjdqqUQJAyJw6mFmJQ4dU4AZWoB3kMAK6dhz ZAb6qMPIERKLXDKhAdbquTqKrjBSdXOysDiNmmft5V53xPim6Punj151/MvFjeUwHC5Y k4Z+3m4jfHlzMZovBKwfsHZq5d1Ap1hjKCNE3XIq+sEPSPqzRpJafknF4B7oSaT9lTKh RRgA== X-Forwarded-Encrypted: i=1; AJvYcCVrT4LC1qeFsTuJqeQJIStCeeo6u4XlCYA3bFC1D0/+0UJFkM5PGcNSdbEGstXZm5piysSz2plgUgRo24bY97gtoublQz4/qmu9xLilXg== X-Gm-Message-State: AOJu0YyAhzv85zhhLTSLOeuA4AsPlwe+sXtt5u2RXY5APfqcKjt+RqsF zfoFq/1Jy5m1CS6x9TeGplvPDE5CoOr1kAgKPt59O/doL5MoRY6w11pWbJpcEw== X-Google-Smtp-Source: AGHT+IHd6ddxHUwcI+GO63TKnOLl3i4M+Xxc5o4/p3XMVcglh0UUR3rtSUQc8AjhdVbPbvMA6ElG+g== X-Received: by 2002:a37:de19:0:b0:790:9eb8:b6ec with SMTP id h25-20020a37de19000000b007909eb8b6ecmr9509923qkj.30.1714403093917; Mon, 29 Apr 2024 08:04: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 p7-20020a05620a056700b0078d3b9139edsm10568591qkp.97.2024.04.29.08.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:04:53 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 29 Apr 2024 15:04:49 +0000 Subject: [PATCH v3 10/26] staging: media: tegra-video: Use swap macro Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240429-fix-cocci-v3-10-3c4865f5a4b0@chromium.org> References: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> In-Reply-To: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , Hugues Fruchet , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Paul Kocialkowski , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Sakari Ailus , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , Matthias Brugger , AngeloGioacchino Del Regno , Hans Verkuil , Sergey Kozlov , Abylay Ospan , Ezequiel Garcia , Dmitry Osipenko , Benjamin Mugnier , Sylvain Petinot , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.12.4 Makes the code simpler and cocci happier: drivers/staging/media/tegra-video/tegra20.c:324:44-45: WARNING opportunity for swap() Reviewed-by: Luca Ceresoli Signed-off-by: Ricardo Ribalda --- 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;