From patchwork Mon May 2 15:23:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8993671 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 275429F1C1 for ; Mon, 2 May 2016 16:16:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 227232024C for ; Mon, 2 May 2016 16:16:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3398220222 for ; Mon, 2 May 2016 16:16:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A1716E60F; Mon, 2 May 2016 16:16:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f196.google.com (mail-yw0-f196.google.com [209.85.161.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C45E6E60F for ; Mon, 2 May 2016 16:16:29 +0000 (UTC) Received: by mail-yw0-f196.google.com with SMTP id v81so20407137ywa.2 for ; Mon, 02 May 2016 09:16:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z9FvdK8J9zROrgraTiEt+Qo+BcZfXE9O7/lrt1+dI60=; b=Z+2WmHRYQz0F6K2XX7qB8dIIDBspfaKtHCbYg73NJaVhYn12qoX46B2FprstoH1Prw 5ayo3ejoJ6C7fk4C05fBeKOl8mIHU7itA0mSwftPpcYGLzEuB9qgRlODG24gNYvi/ivh G+59Q47+Uj90K9OIhx8LJ+RkRRuLT26u/zrBxceAnCOCCkIrq726vTfi4bXjoQKxVwa0 sAhLq8Gu+jgF4jB0KYaCs/VmoyGXTnFby7UWUvp6u6RdagOhNxi+rqEIor2S+bVxkqEm 4O89sK6JA+rte3sK4Ed56QCSw/fTXeiKfF/9Ij0TMTJ2Wm1GsQ2Ujnl0pGqYF7pRJcqb XozQ== X-Gm-Message-State: AOPr4FXwSP2z+zZJqcEBkE+Q9GiQcihIEMdLveTt2tqFpkt/FhGgjibXI5wvWM/LjXjG5Q== X-Received: by 10.129.56.196 with SMTP id f187mr19324505ywa.111.1462202625860; Mon, 02 May 2016 08:23:45 -0700 (PDT) Received: from jade.localdomain ([201.82.24.203]) by smtp.gmail.com with ESMTPSA id c196sm15502466ywb.24.2016.05.02.08.23.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 May 2016 08:23:45 -0700 (PDT) From: Gustavo Padovan To: Greg Kroah-Hartman Subject: [PATCH 04/13] staging/android: remove sw_sync_timeline and sw_sync_pt Date: Mon, 2 May 2016 12:23:12 -0300 Message-Id: <1462202601-6742-5-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1462202601-6742-1-git-send-email-gustavo@padovan.org> References: <1462202601-6742-1-git-send-email-gustavo@padovan.org> Cc: devel@driverdev.osuosl.org, Daniel Stone , Daniel Vetter , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Gustavo Padovan , John Harrison 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=-5.2 required=5.0 tests=BAYES_00, 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 From: Gustavo Padovan As we moved value storage to sync_timeline and fence those two structs became useless and can be removed now. Signed-off-by: Gustavo Padovan --- drivers/staging/android/sw_sync.c | 24 +++++++----------------- drivers/staging/android/sw_sync.h | 24 ++++++------------------ drivers/staging/android/sync_debug.c | 12 ++++++------ 3 files changed, 19 insertions(+), 41 deletions(-) diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index c5e92c6..461dbd9 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -25,31 +25,21 @@ #include "sw_sync.h" -struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value) +struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value) { - struct sw_sync_pt *pt; - - pt = (struct sw_sync_pt *) - sync_pt_create(&obj->obj, sizeof(struct sw_sync_pt), value); - - pt->value = value; - - return (struct fence *)pt; + return sync_pt_create(obj, sizeof(struct fence), value); } EXPORT_SYMBOL(sw_sync_pt_create); -struct sw_sync_timeline *sw_sync_timeline_create(const char *name) +struct sync_timeline *sw_sync_timeline_create(const char *name) { - struct sw_sync_timeline *obj = (struct sw_sync_timeline *) - sync_timeline_create(sizeof(struct sw_sync_timeline), - "sw_sync", name); - - return obj; + return sync_timeline_create(sizeof(struct sync_timeline), + "sw_sync", name); } EXPORT_SYMBOL(sw_sync_timeline_create); -void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc) +void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc) { - sync_timeline_signal(&obj->obj, inc); + sync_timeline_signal(obj, inc); } EXPORT_SYMBOL(sw_sync_timeline_inc); diff --git a/drivers/staging/android/sw_sync.h b/drivers/staging/android/sw_sync.h index e18667b..9f26c62 100644 --- a/drivers/staging/android/sw_sync.h +++ b/drivers/staging/android/sw_sync.h @@ -22,34 +22,22 @@ #include "sync.h" #include "uapi/sw_sync.h" -struct sw_sync_timeline { - struct sync_timeline obj; - - u32 value; -}; - -struct sw_sync_pt { - struct fence pt; - - u32 value; -}; - #if IS_ENABLED(CONFIG_SW_SYNC) -struct sw_sync_timeline *sw_sync_timeline_create(const char *name); -void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc); +struct sync_timeline *sw_sync_timeline_create(const char *name); +void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc); -struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value); +struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value); #else -static inline struct sw_sync_timeline *sw_sync_timeline_create(const char *name) +static inline struct sync_timeline *sw_sync_timeline_create(const char *name) { return NULL; } -static inline void sw_sync_timeline_inc(struct sw_sync_timeline *obj, u32 inc) +static inline void sw_sync_timeline_inc(struct sync_timeline *obj, u32 inc) { } -static inline struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, +static inline struct fence *sw_sync_pt_create(struct sync_timeline *obj, u32 value) { return NULL; diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index e5634f2..e207a4d 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -209,7 +209,7 @@ static const struct file_operations sync_info_debugfs_fops = { /* opening sw_sync create a new sync obj */ static int sw_sync_debugfs_open(struct inode *inode, struct file *file) { - struct sw_sync_timeline *obj; + struct sync_timeline *obj; char task_comm[TASK_COMM_LEN]; get_task_comm(task_comm, current); @@ -225,13 +225,13 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file) static int sw_sync_debugfs_release(struct inode *inode, struct file *file) { - struct sw_sync_timeline *obj = file->private_data; + struct sync_timeline *obj = file->private_data; - sync_timeline_destroy(&obj->obj); + sync_timeline_destroy(obj); return 0; } -static long sw_sync_ioctl_create_fence(struct sw_sync_timeline *obj, +static long sw_sync_ioctl_create_fence(struct sync_timeline *obj, unsigned long arg) { int fd = get_unused_fd_flags(O_CLOEXEC); @@ -277,7 +277,7 @@ err: return err; } -static long sw_sync_ioctl_inc(struct sw_sync_timeline *obj, unsigned long arg) +static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg) { u32 value; @@ -292,7 +292,7 @@ static long sw_sync_ioctl_inc(struct sw_sync_timeline *obj, unsigned long arg) static long sw_sync_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - struct sw_sync_timeline *obj = file->private_data; + struct sync_timeline *obj = file->private_data; switch (cmd) { case SW_SYNC_IOC_CREATE_FENCE: