Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1511583pxb; Thu, 4 Nov 2021 03:46:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwJrA5BOdEBwYkvTW96gxdxAa9T8j/UHAdBWkYXvgMB0NM4IfUm4p3DvXruQ7jRc77SbHM X-Received: by 2002:a5d:8c8b:: with SMTP id g11mr27146091ion.116.1636022769198; Thu, 04 Nov 2021 03:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636022769; cv=none; d=google.com; s=arc-20160816; b=pwPDriD4iY44ScTSTxwifrknVlLW5NeGtLHS6faBdYRgjo92RCiOoQmxsfZ5JAUnav xCSomWwXo/yoMlqEb/QwXy4AOfaA6rvqTsBUTLIZE+rLAT4P3uqz7++Cqb5LKhkfBN4u 89OPKZkJt0xgq9TwmmFT/wKqL4/m+u18Vn7E0pwW4269Mhpr+KYmwUF1B8h/O7e+j7Ex qfzs77R8ubkHOuboAiLeRW/rS2489M5d76oaWlHBZkmfHa9Int/pmwGGLbm+TLMRjcso T5YhlyyzuzCoc7Y5H5AUXRz268T4cuTBpi6+ePUbB+OVEFbd2ZUhvVGYjuzZJZ6mc/rQ WJNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xkDBHnMYJ6iDT5g1nlO8at1+WyWlzlz85OsTSxEVvzM=; b=hKI15ks12B7MDI4Tr/N7xCz0wxIA87I9CoU+g5jQ2j3yrmFwmLVZEy+v/+a34hyO6l g/BsV7dXnH6aOKtOnBe1gj4tKBipKPMez5Pe7nL6S65KZLSCHoDfSDP0mfGXL9fZ8OUA oPw1K0/0Llk21TF5mH00JbwCPN04GU9OO0ykczG7J3pC0XBzlRR5e99HGcuv80Yre8jp 9EJhuLvqbwzxH2D9lYOHREKw9BQkuoMl40hUAm5sEK1wVNFCnkCtX9g9TAkKGEEjWcYS DO+CsspYS0UmHKd/rFfhuhCnFxytlYHkWxzflUAz5K9/M+kU8HG4DYtk0lKltijtleKa 96hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AlI02xwY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w22si6811247ior.71.2021.11.04.03.45.55; Thu, 04 Nov 2021 03:46:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AlI02xwY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230509AbhKDKqv (ORCPT + 99 others); Thu, 4 Nov 2021 06:46:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbhKDKqu (ORCPT ); Thu, 4 Nov 2021 06:46:50 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA3CC061714; Thu, 4 Nov 2021 03:44:12 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id b15so469942edd.7; Thu, 04 Nov 2021 03:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xkDBHnMYJ6iDT5g1nlO8at1+WyWlzlz85OsTSxEVvzM=; b=AlI02xwYo8DFhlhGbqyW2zNsV2RGiNjJlStiRhG3QdMwFW7ySI/1CNNoMR9FR9wJyt URVjE0yxnWYSVUhFsUZqy7T3GtCJKUUHdUW/hH/tzYjfdFC6ms9WYiJhCBdHSIoMAvvy 2z0EYn4aPfTS9TVxvuFSNP5v5IQJoDyIPd9OOyb7t+LKGsY8FvoJbdEw9G0PIVTheT6v BhpE+pqmte+5QVa5ht8G0lw1t5jeWlyVO/Rx//Z/KncMlzz5HGAxwI5f7dMwiFVXlqwH 0LczcH7OQGIiBxa7Ujwokzuhijdod2n8s63LK4+7TIsfx9ll3Hr6UdFTVIeaMFzJ+qqG p8zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xkDBHnMYJ6iDT5g1nlO8at1+WyWlzlz85OsTSxEVvzM=; b=iD6dwhEh8DfpcyvaM+5IdeKv/CmHsY7DpGXV7OR+rs50d/Uiq6H1zu4fG3W0CnJP0r GbD2nV92qZUrZjCgvwvxPDqT3gUZfxaiFuvMieWpHNJ5uhv5/DWUvqOAhEcWvptNC3K8 H7FarYr4zYCKQZfudyyvdIDL9SYUy0HxCKdJFfhLyhBwif9pOOvj8LPcPbdu0NnaGEhd KzRM1tmDfrlzT381ViDgUMfV9d/LscOADvOjumDrVhExR6ZVY1zTpY6cwH49079FQfly YMz4SBjCJN+g4KF+ALQBZt1tVOYqRrOB+16b5Az21LcmusVSVGmI1K7A47a/vvhxhUWj +D+Q== X-Gm-Message-State: AOAM531aDFVQrBzQ8JyrK7Lc+IJyUOWgBrKaWGvdq6I6awRqtuMK/GHf ztesD0ykebmwhCQB3ClFkJWy+cj058s3RTrn7Wc= X-Received: by 2002:a17:906:d553:: with SMTP id cr19mr59904770ejc.128.1636022651440; Thu, 04 Nov 2021 03:44:11 -0700 (PDT) MIME-Version: 1.0 References: <20211103083337.387083-1-yang.guang5@zte.com.cn> In-Reply-To: <20211103083337.387083-1-yang.guang5@zte.com.cn> From: Andy Shevchenko Date: Thu, 4 Nov 2021 12:43:23 +0200 Message-ID: Subject: Re: [PATCH] media: use swap() to make code cleaner To: davidcomponentone@gmail.com Cc: Mauro Carvalho Chehab , Hans Verkuil , Arnd Bergmann , Laurent Pinchart , Julia Lawall , Yang Guang , Linux Media Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 3, 2021 at 10:34 AM wrote: > Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid > opencoding it. Same comments as per all your valuable contributions: just think more about the code that you are dealing with! > if (dev->fmt->uvswap) { > - tmp = base2; > - base2 = base3; > - base3 = tmp; > + swap(base2, base3); > } Have you run checkpatch? What did it say? -- With Best Regards, Andy Shevchenko