From patchwork Tue Mar 24 23:16:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Vesely X-Patchwork-Id: 6086851 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1385FBF90F for ; Tue, 24 Mar 2015 23:16:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C19E20263 for ; Tue, 24 Mar 2015 23:16:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1D9012024F for ; Tue, 24 Mar 2015 23:16:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D221B6E7AC; Tue, 24 Mar 2015 16:16:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-f50.google.com (mail-qg0-f50.google.com [209.85.192.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 742086E7AC for ; Tue, 24 Mar 2015 16:16:45 -0700 (PDT) Received: by qgfa8 with SMTP id a8so14780651qgf.0 for ; Tue, 24 Mar 2015 16:16:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=SJrXwHKPQsQ18FXfkAHUBXGsUoZKJ+LbSd0xwGXoff8=; b=eleVDkgMJMIILyhtvbAv71/1VoAL7JpsXvWHEgmYXOp4TO0WJOPdMans66NdRpQhse QYFUNhm9F6pveWmlkZvr+uXrpJNKzIHKwa4jmlSzvL+S1n9tB51antViVRzHWOtBR9kr /5x7Y3wqeYsBiiLTw52LV5zlLnvQwrlbG2uYFnHoUwkX9Cw0qJlAErEdIadb1OhfzkMZ icJfnOkUxVaYtsepgteL7ODq7Xns8eTVtBKtnbCunI3MRLgh/KfPlSVYXdyNrrLI+pKA BBKqn10CQRhHSJ3ImM6s9b8SQr5NpJ9PX0teWGJZQMRGYPiYbkluuYRc03QjVkID9IPU zlkw== X-Gm-Message-State: ALoCoQm12yQ/wvKGaql7uiOEiLrzXDGtzm9eDr5YYvzJoV7/Ta7taUIvaNKDVyHKNFyoC5n0y2US X-Received: by 10.55.27.37 with SMTP id b37mr13917514qkb.73.1427239004931; Tue, 24 Mar 2015 16:16:44 -0700 (PDT) Received: from adriatix.rutgers.edu ([198.151.130.140]) by mx.google.com with ESMTPSA id x10sm530703qha.2.2015.03.24.16.16.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 16:16:44 -0700 (PDT) From: Jan Vesely To: dri-devel@lists.freedesktop.org, Emil Velikov , "Matthew W. S. Bell" , =?UTF-8?q?Kristian=20H=C3=B8gsberg?= , =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Subject: [PATCH libdrm v3 1/3] drmSL: Fix neighbor lookup Date: Tue, 24 Mar 2015 19:16:43 -0400 Message-Id: <1427239003-25438-1-git-send-email-jan.vesely@rutgers.edu> X-Mailer: git-send-email 2.1.0 In-Reply-To: <550EDC2B.7080603@gmail.com> References: <550EDC2B.7080603@gmail.com> 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Commit e4a519635f75bde38aeb5b09f2ff4efbf73453e9: Tidy up compile warnings by cleaning up types. removed call to SLLocate which gutted the function of all functionality. This patch restores the original behavior, with an additional fix that zeros the update array in case SLLocate bails early. v2: zero the update array instead of checking the return value. SLLocate returns NULL both on failure and if the element is greater than everything in the list v3: Improve commit message Signed-off-by: Jan Vesely Acked-by: Emil Velikov --- sorry for spamming, just realized it might be a good idea co CC the original author and committer. This was broken since 2.4.18 (2010). I guess it's safe to say that nobody uses it. What are the policies on removing parts of API? xf86drmSL.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xf86drmSL.c b/xf86drmSL.c index acddb54..cf588ac 100644 --- a/xf86drmSL.c +++ b/xf86drmSL.c @@ -264,12 +264,14 @@ int drmSLLookupNeighbors(void *l, unsigned long key, unsigned long *next_key, void **next_value) { SkipListPtr list = (SkipListPtr)l; - SLEntryPtr update[SL_MAX_LEVEL + 1]; + SLEntryPtr update[SL_MAX_LEVEL + 1] = {0}; int retcode = 0; + SLLocate(list, key, update); + *prev_key = *next_key = key; *prev_value = *next_value = NULL; - + if (update[0]) { *prev_key = update[0]->key; *prev_value = update[0]->value;