Received: by 10.223.164.202 with SMTP id h10csp971740wrb; Fri, 17 Nov 2017 11:41:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ+g9n+X5HJ/KvqgJLK7BlFxjoRP8KHpscPMK14YhAwm474XQ8rsUXBIIRvPFIDldvnU2s7 X-Received: by 10.84.135.3 with SMTP id 3mr6215040pli.147.1510947666634; Fri, 17 Nov 2017 11:41:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510947666; cv=none; d=google.com; s=arc-20160816; b=sXtdFBkdWBuSg1i3m6NXVpUspio04wkBT4oBl1FHG2NEw2/Z7bqwPA2UjVVgLe4ZHw uQmsEcnY9zGKf1j3yc6fbSFbLU58vA7oQs8rWyBEVvt9u2fNspB3HfkExs+iJV6oCHr8 Ue9Pf8b0ZycuzxnEwjHS9C1dthDF4TBuK0S8Xac9WtN5AIQgCXQI7IZaAJBsplz85X2H 9HLNRjqH8ADDriR0K7mEsW2Ntl4/o1SbcLiPjL/f5L2lucaXFYOUSBArKeKXR/pNRwRo rMTyw0uezGApbXVAmG4a/vZH6qBERc92OB406HyQIQ4PQieTSAODpJMV7OO6wTigxPqP s1eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=74osaR5yp36YfIcQwyt43TFEGZEbUbrI/ymPfvzZ3k4=; b=RhBCtWrizzDkI89RD9PmpIBSqFYUeX2WQCH1aOnI+Gccn2qM/8NlW5cS0/B1J2cWEW GCEvTGkiJnqzeWyKN/G24uo4T9hgiaX8k1JAml6d4rWAUxWuyOYCasNIKs8RM5ANmEio axNbYZBVyzVLVc7hp1QerXSAUU2BCU5kGQVRq40nnXaDpY640ZbDsMUEUgDhKX57yOdb vNkuYWvA2C4EcSjCP+ceV3P0jBhzmNQICB1eNNxh8ZvO8XYZzdU+KjfVvRXpMOimB0yI 71SryX2eNv/ZxZ74C9PkgT5NlCCaI06vRkiPTp/k3TaSPJ2PYnRRlS33bDJ9UIGtcGsT 3BSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=HWTylWwg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si3570338pfd.157.2017.11.17.11.40.53; Fri, 17 Nov 2017 11:41:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=HWTylWwg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965695AbdKQPqJ (ORCPT + 93 others); Fri, 17 Nov 2017 10:46:09 -0500 Received: from mail-by2nam01on0082.outbound.protection.outlook.com ([104.47.34.82]:30240 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965470AbdKQPp5 (ORCPT ); Fri, 17 Nov 2017 10:45:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=74osaR5yp36YfIcQwyt43TFEGZEbUbrI/ymPfvzZ3k4=; b=HWTylWwgLAg/6pIhRZzZccL1cmWLkBuzUit+PwN9t4M+wZRKC5W/rb655P7UkPMaIoDYqjVf/qwuTqQWgkl4coZOnTQzwwtso+E9glf2+1+AI3+AuVgeg8rtC7N4g1zYSP1VorSDRWKzxoOQZZQCvSA4qD/w2QPBTyer+b/0WCU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Harry.Wentland@amd.com; Received: from [10.60.233.33] (165.204.55.251) by DM5PR1201MB2472.namprd12.prod.outlook.com (10.172.86.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.239.5; Fri, 17 Nov 2017 15:45:55 +0000 Subject: Re: [PATCH] drm/amd/display/dc/core/dc_resource: use swap macro in rect_swap_helper To: "Gustavo A. R. Silva" , Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , David Airlie Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20171110223813.GA32508@embeddedor.com> From: Harry Wentland Message-ID: <179346a7-d49d-60cd-9b6d-b7394a770641@amd.com> Date: Fri, 17 Nov 2017 10:45:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171110223813.GA32508@embeddedor.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: CY4PR01CA0003.prod.exchangelabs.com (10.169.249.13) To DM5PR1201MB2472.namprd12.prod.outlook.com (10.172.86.151) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 03e16cc4-18d8-496d-c355-08d52dd24a87 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603258);SRVR:DM5PR1201MB2472; X-Microsoft-Exchange-Diagnostics: 1;DM5PR1201MB2472;3:JnYKy3jHnwdQZLd8pJv5D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scfSzwmlmrPgNxDn07Fo1pTmm3MzD8HcnR7RXXtfTcHOLNaiz33hlpetRXTwKm2xhOeZVToiJVRWp5YpkAi9u4t9Hx8OIM9oFsEH8BpvMKAyJAIPq7lshR2fa7MSwQIjrBig027eJti1bU0Ee/6PLMg1PcxUshT/9m5nRKXxIsBrnjMDcTpV1k4eRDstaP38FR6v2Hb0ggXbLCORUChUfB6h0kBjkHSB0kMuNwUJPyLbbhsw59QRhcmbGsPQgPWTVhu0JJ3E8dqmQ0+FK/YD4M5WbpN09J/GL5Akt3wRkGWXwok90MteMpMjUXBS44TQskfYpn5;4:LCSUyCPh4RCRxrn1eA+xGQufSNQSbfKlx6EQuJehkOTvlBYKtjn34h+R1yY9wGITvQt6lbQZvZUZl8YYt+SzyZXIHlFeAajNFB8c4+pxtLcdNTQp4NytWgHNJK8wO+Zo35I2Uxzqit5HSU6P/YtNWlKr1RX371O6UF7zRow0lPlIZ3tNfy0+H4ZKT6kjiPZfpCwMQrj+Gsj/ku2l3QPvTic4PmkuvAbJpv1At3kqMQJVr07R0QF4g3bFbBqxoC+V3LJ/2bmJLieCwxduaf6kWliB+wegpKP4Zyh7xxPaYo/8VzM2i0J0k3oXkXrIg/4R X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231022)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR1201MB2472;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR1201MB2472; X-Forefront-PRVS: 049486C505 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6049001)(376002)(39860400002)(346002)(199003)(189002)(24454002)(377424004)(86362001)(316002)(53546010)(58126008)(65956001)(2950100002)(66066001)(65806001)(47776003)(16576012)(65826007)(2906002)(53936002)(72206003)(81156014)(6666003)(7736002)(4326008)(81166006)(25786009)(478600001)(6246003)(8676002)(31696002)(97736004)(305945005)(83506002)(50986999)(76176999)(54356999)(23676003)(16526018)(77096006)(6486002)(90366009)(64126003)(68736007)(110136005)(31686004)(36756003)(4001150100001)(101416001)(229853002)(50466002)(6116002)(3846002)(106356001)(105586002)(5660300001)(189998001)(230700001)(8936002)(33646002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR1201MB2472;H:[10.60.233.33];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyMDFNQjI0NzI7MjM6Q05XUDJkalJ0aWpudEY0OC81MWplVGpI?= =?utf-8?B?eWt4WE1Hd05INjZoenRobk9ucHAvYzJROGxNVUpGeS9TM2QrWXY4bmRUUXBP?= =?utf-8?B?OGZyamFveThBM3pwQWl6RUZHcDRDcVBUMlVtb1JTRy9FMW5IbDFLZ3RHZFVG?= =?utf-8?B?Zi9DV1hKV2xmTmdrRFRaQWdJb1B6TCtMbzFZTndrSEpOaTJHNFg4M3IyYzdU?= =?utf-8?B?d2MwR0d2OEdndGllSjVrV3ZPZEd3dGRaZ3k0aUdlcGFVZUQzcVlwazE1UmRV?= =?utf-8?B?RGxoenVqUnJDWFFJMFg3Ym1FTnZEUlFvQjIwRXlyOXV0QThLNTloeENnSlRi?= =?utf-8?B?aFh1cFdxY1FyS0FuNEVsOTNrVStHS1ZEL1Nldmt1K2pzMlh0c3VGOExCRXpL?= =?utf-8?B?SFJSNllQckMvWTNRMXJ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pudsyiDTWsQrPWzx1o4EaE1s7XHPks9V3uPmhQAu21PmfSWmuNhTxv66T05E01Y4TDzWhisbgaGv2oRWyUOj0=;5:DtzttEhpqIkVdG+odTZM/c5xIEgu5qDtBtDrSjurJoHPRr4FYGX7HwyBWlzydmAjFP+MjqmxYEISIUjMihF1eR5mSj/3jysT5y5ot6R3+NeIXqmlTdoiEPzc61vulN8Vc8KO6Uwx+f9n6rvnbPsuQIbrYo6svc4BHydeRBUe69Y=;24:LT1ewobvCGK0PBGzbe14UbauUhsADVn4mi2f65MJRA594Gfn1CCXx3ab1RXmDkLDRB7R9Df//E/qM62szSJ8mn67VMjFAEebp9O5EB04u/Y=;7:aNCWloqXrWSiIzfJjs93iyKAfeb5CRgpnCUlYJe6D3Gd3jbo4qR250BO0bvPoJv9dkn04G4CRSh+6lk9LoTgKpGhOUNZue33Sj96tx4diMQXu8cPZryEGKPbLYszmKjY1ON3X4gMHKE6Js5sGCjqmnoEIrRLOmF3i1/nLPfNvCWyx1ykMbpLdKu7Ms3uVW9IVWol707CSlsjyjqsmupqJhmzGgpLQOpQDEYWDu1kg32E5MEEMuu/o/MNDUX9r3MB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR1201MB2472;20:vU8tKzSprEa/Uu0+tYcgDASsVlCuZi+K5b1IGDTCdGfo2i5HqOMxNC0xac8WQmXlAykXQDJ7y75Ebh3tLGihDOjlsTmhZ/xODCEfjxWDtVllbr9z3Fu059laY69nIuTunTVL2kbClyaTfbGmm4lGTY7drPOYn/JJHAVCA9n9g04si43bPjcAdO8rI2LDnA+OnAqKVuuAgZyf9Y1RRW0jxTpbWNz6C5PnapuNtMwVyyegotBdOVJJNjTfzbT/z10D X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2017 15:45:55.1305 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03e16cc4-18d8-496d-c355-08d52dd24a87 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB2472 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-11-10 05:38 PM, Gustavo A. R. Silva wrote: > Make use of the swap macro instead of _manually_ swapping values > and remove unnecessary variable temp. > > This makes the code easier to read and maintain. > > This code was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Harry Wentland Harry > --- > drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c > index d1cdf9f..ee216f2 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c > @@ -426,15 +426,8 @@ static enum pixel_format convert_pixel_format_to_dalsurface( > > static void rect_swap_helper(struct rect *rect) > { > - uint32_t temp = 0; > - > - temp = rect->height; > - rect->height = rect->width; > - rect->width = temp; > - > - temp = rect->x; > - rect->x = rect->y; > - rect->y = temp; > + swap(rect->height, rect->width); > + swap(rect->x, rect->y); > } > > static void calculate_viewport(struct pipe_ctx *pipe_ctx) > From 1583721567100424003@xxx Fri Nov 10 22:56:22 +0000 2017 X-GM-THRID: 1583721567100424003 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread