Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6058867pxb; Mon, 8 Nov 2021 02:27:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQPfZNzlAERRidrTzOGLEjeVPbZ62GWOicZx93PmjFkXQv86sX8osMYTe2vMHcGWp3oRoa X-Received: by 2002:a17:906:5384:: with SMTP id g4mr94911090ejo.27.1636367225243; Mon, 08 Nov 2021 02:27:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636367225; cv=none; d=google.com; s=arc-20160816; b=VjxbEN7OXT1XYkKrxMZThYm+6cjbonFucaBFYH6ItyqhOV1sfr4uxSQfgxrpYy7rTt JeGRh9UrM+AqoRKMYzOszBF317PWrcsXK2rrCW4ZUjJZMoBi8Xzn2wNDBbahbCvTEPdo x8It6dN6xqXwuBnWI9Rr8tHLiiudhYlqHJ4yUIPCd55zW8Hg/1Xnjj8344GETWKBHKuH 51w+3ASt5I+or/1H25Lq5/54SxxjGvAFkPB3TbXue5LmAGSxQN6edAuYm0BojstmTXsP wj6cah05ukmtsxcB6buUn9RuYMPQ1yKJX5PdVazpj3dTVGje3B4NC9CCBh8fxhIhn+4z q4+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=kUolfHZmV7/0vz8TfY+i/uV1QQ2ndW6GKWY0t/hohRo=; b=nclKW653P4ze9C9cvyP9oQOptWRF56UN/rj2gQ/bzqZZDXGQiLQb+cHQQB1cgSi3Mv 9bNaVGKExbfPbwkvq4BQyvQuh1Xzbko9FBPhV6Ge2FhATXWX9ICgp7cE8KPlxIHDgEnJ vj4txIXwITUXgPkoyAEecdxApodNbEuBY0jwj131YAFfvfeUeWXsPFS+wzSFRQJP7PAf ZGIAepvNunGxOKFAKbEX1QyeQH/zOigdzlrAJqJ8yO8HS71OLDKNvgMbi54hPdywu6ey kbHGnaTaR4VEs8mrpKnBY2csR9/WOtgu74lcC3lfUDjmRBCweBEsNZWjidRvsH4tIyMh bTYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b="UXwI/U7Y"; 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=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si19151538edz.312.2021.11.08.02.26.41; Mon, 08 Nov 2021 02:27:05 -0800 (PST) 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=@xs4all.nl header.s=s2 header.b="UXwI/U7Y"; 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=NONE dis=NONE) header.from=xs4all.nl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235808AbhKHJTP (ORCPT + 99 others); Mon, 8 Nov 2021 04:19:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbhKHJTP (ORCPT ); Mon, 8 Nov 2021 04:19:15 -0500 Received: from lb1-smtp-cloud7.xs4all.net (lb1-smtp-cloud7.xs4all.net [IPv6:2001:888:0:108::1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E00F7C061570; Mon, 8 Nov 2021 01:16:30 -0800 (PST) Received: from cust-b5b5937f ([IPv6:fc0c:c16d:66b8:757f:c639:739b:9d66:799d]) by smtp-cloud7.xs4all.net with ESMTPA id k0lNmeg9KFZvck0lQmuMHy; Mon, 08 Nov 2021 10:16:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s2; t=1636362989; bh=kUolfHZmV7/0vz8TfY+i/uV1QQ2ndW6GKWY0t/hohRo=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From: Subject; b=UXwI/U7Ys6CRnLSvPTzSjnFVBavHK1F/kBB3ScYI/uUK0BQhbd/Y5AJjZ4+tlD9kc HKMTO6SF9CJRrer5CPu7+kmz0OFkHCy0vsVsMG13du4Qj3/9O0HhOcjJ0LNM4D5PRC wvPu+q/fkW2zYxauyYkpkohAPZubfNEjHfs6QXrl/NIw5/zvQ5eUjWPzly4cQIcbks FMDBvxC5eygI39i4VtKsRamyp2ZG1PLvj8pL2W+69lpXZOBmGQe266I15C7ogqIS/y FeQtPhHqsbLlA13quHZKVvbUA9jfcRjuQgmEW/Yqm/6Mj2v6G6Mfo54E4C6XMZTigy 3Y23bK6NWRy2w== Subject: Re: [PATCH] media: use swap() to make code cleaner To: Andy Shevchenko , davidcomponentone@gmail.com Cc: Mauro Carvalho Chehab , Arnd Bergmann , Laurent Pinchart , Julia Lawall , Yang Guang , Linux Media Mailing List , Linux Kernel Mailing List References: <20211103083337.387083-1-yang.guang5@zte.com.cn> From: Hans Verkuil Message-ID: <1fb9ff6d-e129-5109-7431-c9da67d04d1f@xs4all.nl> Date: Mon, 8 Nov 2021 10:16:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfLYF73KZX0vKTAc2gzI1+XCo3tLuD0TctFHFjeeSdrQP3lo5M3rhX0rCQw29ldbQ0046dB9gHo68714rXRpMtpTsdxqRFtouWWNCxwMHjEG2m8oU/f4k QUnDsSY1/Wg0wBdQORXDHv5FW7lyBEamTGv5bXdODDhDuLIB+TwwP1LzKmHNxssZgDdGI2+N8zn03wO1lkuTUVuVLizgGLkHDdEeKVvdiLUEnuRLCrvwTNhw L6BB1/kS6iMH383cYoybxSXOSt5M1htUJLYk97L4/0pd4adTWtKV/PYK+zb/X+SSzvjGPRKZtW6Na7z0Koe4lCOsfIUXkVKySPORcMKOSDM1ZrhGCZg2+L20 /54izvY529epH+1GGfW4jvAwC6ympmLFAtziBY2UOjfB+r6W5gAHJR3NdLBsGWjtbM5Z9IJkXheq0cu4NlHM1DtXGhYa5c1Bj4whYW4bGNM7doXnTUyleGlU mGlOBzvZVRZDa5n0SwiFD0KALdPiE8UunLY7vA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/11/2021 11:43, Andy Shevchenko wrote: > 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? > checkpatch says all is fine :-) But yes, the {} can now be dropped. If I apply the patch, then run checkpatch, it will indeed complain about the {}. Regards, Hans