From patchwork Fri Mar 1 00:43:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 15182 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 956BB23E1A for ; Fri, 1 Mar 2013 00:44:22 +0000 (UTC) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by fiordland.canonical.com (Postfix) with ESMTP id 3B28FA1935F for ; Fri, 1 Mar 2013 00:44:22 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id pb11so2391175veb.19 for ; Thu, 28 Feb 2013 16:44:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=Cc3bOPQYLsJZs/vnnP+IsVZ7HasNaZky7df+kTLS6vA=; b=VuLx2+GZz7Z6L1VlppumKemZp6gMWV2hsgJD/S+JhKQD+w5fcBuB/qsAG6H9gnm0FH 3Oa1qUxrHs0lnkdPpZ5kEweInlYReUao50i8ku2IbkKg/uUufjkOL3X9A5iB9KNCCnWz H9Ya8vAK5UA5mZo1qebE9983SpZ34LnkiZdisHRWugFv0kxNFRlyIrrGHkkPYSywLbLS IFHlwkrZt3nHwb44l+sdpyb6ewS4HFG4rn9F4crMzB/kA+h6jBw+1NqlFq9lvrTlU1+q uQFhIzak2yESUecSV/ZRyWUiZrZ8VHV5ECD/ELpIDW0jz20n3hXGQM3bguAO1PAGfLSA Ba5Q== X-Received: by 10.52.18.148 with SMTP id w20mr2946417vdd.8.1362098661774; Thu, 28 Feb 2013 16:44:21 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp673veb; Thu, 28 Feb 2013 16:44:21 -0800 (PST) X-Received: by 10.68.230.225 with SMTP id tb1mr11950712pbc.86.1362098661239; Thu, 28 Feb 2013 16:44:21 -0800 (PST) Received: from mail-da0-f50.google.com (mail-da0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id qx5si10274533pbc.174.2013.02.28.16.44.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:44:21 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) smtp.mail=john.stultz@linaro.org Received: by mail-da0-f50.google.com with SMTP id h15so1094359dan.23 for ; Thu, 28 Feb 2013 16:44:20 -0800 (PST) X-Received: by 10.68.218.166 with SMTP id ph6mr12201012pbc.33.1362098660817; Thu, 28 Feb 2013 16:44:20 -0800 (PST) Received: from localhost.localdomain (c-24-21-54-107.hsd1.or.comcast.net. [24.21.54.107]) by mx.google.com with ESMTPS id dx17sm10914892pac.17.2013.02.28.16.44.19 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:44:20 -0800 (PST) From: John Stultz To: lkml Cc: Erik Gilling , Maarten Lankhorst , Daniel Vetter , Rob Clark , Sumit Semwal , Greg KH , dri-devel@lists.freedesktop.org, Android Kernel Team , John Stultz Subject: [PATCH 26/30] staging: sw_sync: Convert to use new value_str debug ops Date: Thu, 28 Feb 2013 16:43:22 -0800 Message-Id: <1362098606-26469-27-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> References: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> X-Gm-Message-State: ALoCoQm496vZrXj4inhKJ7Fe56roEzoLn2AlSTfRs4cFWQQeFKYwNjrZ47jBy0uPoAbb8Lg2LESy From: Erik Gilling Switch from print_obj/print_pt to the new timeline_value_str and pt_value_str ops. Cc: Maarten Lankhorst Cc: Erik Gilling Cc: Daniel Vetter Cc: Rob Clark Cc: Sumit Semwal Cc: Greg KH Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team Signed-off-by: Erik Gilling [jstultz: Add commit message] Signed-off-by: John Stultz --- drivers/staging/android/sw_sync.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index d768893..68025a5 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -72,23 +72,6 @@ static int sw_sync_pt_compare(struct sync_pt *a, struct sync_pt *b) return sw_sync_cmp(pt_a->value, pt_b->value); } -static void sw_sync_print_obj(struct seq_file *s, - struct sync_timeline *sync_timeline) -{ - struct sw_sync_timeline *obj = (struct sw_sync_timeline *)sync_timeline; - - seq_printf(s, "%d", obj->value); -} - -static void sw_sync_print_pt(struct seq_file *s, struct sync_pt *sync_pt) -{ - struct sw_sync_pt *pt = (struct sw_sync_pt *)sync_pt; - struct sw_sync_timeline *obj = - (struct sw_sync_timeline *)sync_pt->parent; - - seq_printf(s, "%d / %d", pt->value, obj->value); -} - static int sw_sync_fill_driver_data(struct sync_pt *sync_pt, void *data, int size) { @@ -102,14 +85,29 @@ static int sw_sync_fill_driver_data(struct sync_pt *sync_pt, return sizeof(pt->value); } +static void sw_sync_timeline_value_str(struct sync_timeline *sync_timeline, + char *str, int size) +{ + struct sw_sync_timeline *timeline = + (struct sw_sync_timeline *)sync_timeline; + snprintf(str, size, "%d", timeline->value); +} + +static void sw_sync_pt_value_str(struct sync_pt *sync_pt, + char *str, int size) +{ + struct sw_sync_pt *pt = (struct sw_sync_pt *)sync_pt; + snprintf(str, size, "%d", pt->value); +} + struct sync_timeline_ops sw_sync_timeline_ops = { .driver_name = "sw_sync", .dup = sw_sync_pt_dup, .has_signaled = sw_sync_pt_has_signaled, .compare = sw_sync_pt_compare, - .print_obj = sw_sync_print_obj, - .print_pt = sw_sync_print_pt, .fill_driver_data = sw_sync_fill_driver_data, + .timeline_value_str = sw_sync_timeline_value_str, + .pt_value_str = sw_sync_pt_value_str, };