From patchwork Fri Apr 19 09:47:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 790300 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (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 29524823A9 for ; Fri, 19 Apr 2024 09:49:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520174; cv=none; b=peSul14aRnIW2psyifxp1ZcUgvGJpuHCk0aiqSaJgYIuXeVUaDTKo6NfqcSXIeZJpURwnM/3XEvn+SSarFg//advqRALnSBQ/deGprmjbPnmpClnR+JsMQDbXIVB7Kcb7lntNMlbCXoDyaV0UrR9xyPAFnEKuAa7wrTPFAMwSzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520174; c=relaxed/simple; bh=+AXbzIt1DCOyX+j9nTM1S5LGWAW6l5Ne8tHYdxY2P08=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d5bNo1/sGmZP2EhRr4lCli9d5KM30NiwpaI2JvbYvuXBLhcr895lHG5xpCt3eAaCpLWnzXYJE9aoaC5K++emVD6DFAnjEsYvswv/FM5NFiQvYxiUZG0Twyi2c4/ZWDyhD93fGGRfZasFfzsJRZY+A3EW3umWq98DB/34Cjw4AYY= 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=RDXZTLyW; arc=none smtp.client-ip=209.85.222.172 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="RDXZTLyW" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-78f031a4442so119083285a.2 for ; Fri, 19 Apr 2024 02:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520171; x=1714124971; 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=RDXZTLyWM1k8dfz8A7WFBrq7+rQc1zX11Zn60dcP33fCc05oAyeDWx+WhVTNfuyiYq SZf4mw1lAQXWdrsEEtmTze09iT73ZK8HUFB+yyMCM98PKAzQZ9yUBEwnWEYyj7UYt9T8 xA2Rx2ovIzqhYA7DyPbfNIZlLqwxAtlu+p69s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520171; x=1714124971; 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=GE1/oxfJoHYC3OUFo8VxUX/u4JYWx2QPvZQBrTifdUC4rkz/NOcZHAjLTCmcS5+Om5 LP8zq85+UUxZWEZkZiFp49MBlYAqiSqWeRKVCihUlzZiAFfgTPjpZAHHyfjIWQjApgdt 0en4rizYR4yUFeLiY+Vxp8y+K4geLs22Y6sWhL533JsbgZIbZNd6XSpR82mp7lHLfF92 Hi3HOfh/3ULwkCAHFqGZNCJdNSbP1NdpEoHfM/sxAcswz58hdb2nsYfRCCeMaDGIiWZ2 JdB3J9/xeusTpR+oMFfIRstnbokaZmhftaVF8beFmh/cvxzvMtB6Pn72d24sY971kLNd U7Qg== X-Forwarded-Encrypted: i=1; AJvYcCU7uL/Mn0dN4RN6H8g6q48DhH+9yhKRLzkyBcFD/W5k+BmSqv1Yxg1ICJ1cZTIJMQHsC2tSU05MqKfa59Kyalzx3naFEpTzNgMeB3SO1Q== X-Gm-Message-State: AOJu0Yx6i4C0TclckLL08m/t3F2JOGYZ/Ef5Eokixw2wfL1cSzrgto+l hN6OnT/akevU5TPH747TqPEpCSD/J1RmGM2zL8eJh5h1zgP4VBtIXWbts/z8nQ== X-Google-Smtp-Source: AGHT+IGTA8hVputhy9D1xoHe1Hnr3yG2C7dQHpLq8IKH//vLRvJ+A58aCJR9JO6Y/w8HTYrMtJHvqA== X-Received: by 2002:a05:620a:1da6:b0:78d:5065:c5df with SMTP id pj38-20020a05620a1da600b0078d5065c5dfmr1596268qkn.18.1713520171055; Fri, 19 Apr 2024 02:49: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 dt14-20020a05620a478e00b0078d735ca917sm1434532qkb.123.2024.04.19.02.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:30 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:47:56 +0000 Subject: [PATCH v2 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: <20240419-fix-cocci-v2-10-2119e692309c@chromium.org> References: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> In-Reply-To: <20240419-fix-cocci-v2-0-2119e692309c@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;