From patchwork Wed Jan 20 17:08:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "StDenis, Tom" X-Patchwork-Id: 8073881 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 92E6B9F818 for ; Wed, 20 Jan 2016 19:40:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF8E320531 for ; Wed, 20 Jan 2016 19:40:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F04112057F for ; Wed, 20 Jan 2016 19:40:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4B9B6E188; Wed, 20 Jan 2016 11:40:44 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 8195 seconds by postgrey-1.34 at gabe; Wed, 20 Jan 2016 11:40:39 PST Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0072.outbound.protection.outlook.com [207.46.100.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id AA1436E188 for ; Wed, 20 Jan 2016 11:40:39 -0800 (PST) Received: from DM2PR12MB0095.namprd12.prod.outlook.com (10.160.99.24) by DM2PR12MB0094.namprd12.prod.outlook.com (10.160.99.23) with Microsoft SMTP Server (TLS) id 15.1.365.19; Wed, 20 Jan 2016 17:08:07 +0000 Received: from DM2PR12MB0095.namprd12.prod.outlook.com ([10.160.99.24]) by DM2PR12MB0095.namprd12.prod.outlook.com ([10.160.99.24]) with mapi id 15.01.0365.024; Wed, 20 Jan 2016 17:08:07 +0000 From: "StDenis, Tom" To: "dri-devel@lists.freedesktop.org" Subject: [PATCH] drm: amdgpu: Clean up function calls Thread-Topic: [PATCH] drm: amdgpu: Clean up function calls Thread-Index: AQHRU6UUXAjYYx1cTUKOev7lUpknYA== Date: Wed, 20 Jan 2016 17:08:06 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tom.StDenis@amd.com; x-originating-ip: [69.156.6.127] x-microsoft-exchange-diagnostics: 1; DM2PR12MB0094; 5:3wkDR9RKQ49EpmgyQqTYJAxY5QGtEyAaijTljJrewOML39oUX7gGFN04n4gtyBl703QxcrCaWK1k69koXw4o3HVMsuY+LUuTKNY4ua00z529hMviSiR8oQ/rMZChqknp7XvdVnKwKOWAFWXxTYDkmQ==; 24:aB4IEMyhmOjtJCEm3VMknTHI9xZZbIOI7CWaJIVrAgbWsxtUdNicINtnOt3/lWTY0UzC/vTh5WREpxH0UG7Bja6xx3ZOv//IL61kGLqZRD8=; 20:6yTccLbXOyAkaNERuAmVtmeapNrywFIKIXHLCpaSMfUE6ODfl13NxBLfmenmW5Hqjd/XGN7BsLcexhwKd6RaDWFYdNMpnvoZFQsB28cGeZQ/qrYrfgT1VaUGKNG+a46YgPIsWpn/5Dq8xNTXkRufVYd7/AHiw5SNP1WQZ6SrTnnnXqHdOxAd29r+5A/Ct336RfsH9LqqwvpuWEYMukxZ7SgPQPzLLJML4YhjAJUWrPL+UdiXsEmHh5fBfjsk1VQa x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR12MB0094; x-ms-office365-filtering-correlation-id: 134d6230-4682-468f-e53a-08d321bc443d x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(102615245)(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001); SRVR:DM2PR12MB0094; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0094; x-forefront-prvs: 0827D7ACB9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(43234003)(99936001)(66066001)(19625215002)(50986999)(33656002)(87936001)(74316001)(101416001)(54356999)(16236675004)(11100500001)(2906002)(450100001)(102836003)(5008740100001)(6116002)(3846002)(586003)(558084003)(40100003)(2351001)(122556002)(2900100001)(19627405001)(5004730100002)(1220700001)(229853001)(77096005)(92566002)(86362001)(81156007)(5890100001)(97736004)(110136002)(5002640100001)(107886002)(5003600100002)(5001960100002)(189998001)(10400500002)(2501003)(106356001)(105586002)(99286002)(106116001)(76576001)(1096002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0094; H:DM2PR12MB0095.namprd12.prod.outlook.com; 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) spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2016 17:08:06.8409 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0094 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Attached is a simple patch to move a couple of memsets after variable declarations. Tom St Denis From 5a1253dea09a3b182a7ac2abfc8319e961c980f9 Mon Sep 17 00:00:00 2001 From: Tom St Denis Date: Wed, 20 Jan 2016 09:37:36 -0500 Subject: [PATCH] amdgpu: Move memset() after variable declarations To make the code more "C" like move the function calls after the variable declarations. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher --- src/amdgpu_bo_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c index 1329c4c4a225..65f1ac693c2b 100644 --- a/src/amdgpu_bo_helper.c +++ b/src/amdgpu_bo_helper.c @@ -243,9 +243,9 @@ void amdgpu_bo_unref(struct amdgpu_buffer **buffer) int amdgpu_query_bo_size(amdgpu_bo_handle buf_handle, uint32_t *size) { struct amdgpu_bo_info buffer_info; - memset(&buffer_info, 0, sizeof(struct amdgpu_bo_info)); int ret; + memset(&buffer_info, 0, sizeof(struct amdgpu_bo_info)); ret = amdgpu_bo_query_info(buf_handle, &buffer_info); if (ret) *size = 0; @@ -261,9 +261,9 @@ int amdgpu_query_heap_size(amdgpu_device_handle pDev, uint64_t *max_allocation) { struct amdgpu_heap_info heap_info; - memset(&heap_info, 0, sizeof(struct amdgpu_heap_info)); int ret; + memset(&heap_info, 0, sizeof(struct amdgpu_heap_info)); ret = amdgpu_query_heap_info(pDev, heap, 0, &heap_info); if (ret) { *heap_size = 0; -- 2.7.0