From 297b60346df8beafee954a0fd7c2d64f33f3b9bc Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Sat, 11 May 2024 01:44:05 +0000
Subject: [PATCH] rtl8211F_led_control

---
 kernel/drivers/dma-buf/sync_file.c |   53 ++++++-----------------------------------------------
 1 files changed, 6 insertions(+), 47 deletions(-)

diff --git a/kernel/drivers/dma-buf/sync_file.c b/kernel/drivers/dma-buf/sync_file.c
index 051621f..f0c8229 100644
--- a/kernel/drivers/dma-buf/sync_file.c
+++ b/kernel/drivers/dma-buf/sync_file.c
@@ -1,17 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * drivers/dma-buf/sync_file.c
  *
  * Copyright (C) 2012 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
  */
 
 #include <linux/export.h>
@@ -102,39 +93,6 @@
 }
 
 /**
- * sync_file_get - returns the sync_file structure related to an fd
- * @fd:	[in]	fd associated with the sync_file to be returned
- *
- * On success, returns the sync_file structure associated with an fd; uses
- * file's refcounting done by fget to increase refcount. returns NULL
- * otherwise.
- */
-struct sync_file *sync_file_get(int fd)
-{
-	return sync_file_fdget(fd);
-}
-EXPORT_SYMBOL(sync_file_get);
-
-/**
- * sync_file_put - decreases refcount of the sync_file
- * @sync_file:	[in]	sync_file to reduce refcount of
- *
- * Uses file's refcounting done implicitly by fput().
- *
- * If, as a result of this call, the refcount becomes 0, the 'release' file
- * operation related to this fd is called. It calls &sync_file_ops.release vfunc
- * in turn.
- */
-void sync_file_put(struct sync_file *sync_file)
-{
-	if (WARN_ON(!sync_file || !sync_file->file))
-		return;
-
-	fput(sync_file->file);
-}
-EXPORT_SYMBOL(sync_file_put);
-
-/**
  * sync_file_get_fence - get the fence related to the sync_file fd
  * @fd:		sync_file fd to get the fence from
  *
@@ -177,7 +135,7 @@
 	} else {
 		struct dma_fence *fence = sync_file->fence;
 
-		snprintf(buf, len, "%s-%s%llu-%d",
+		snprintf(buf, len, "%s-%s%llu-%lld",
 			 fence->ops->get_driver_name(fence),
 			 fence->ops->get_timeline_name(fence),
 			 fence->context,
@@ -291,7 +249,8 @@
 
 			i_b++;
 		} else {
-			if (pt_a->seqno - pt_b->seqno <= INT_MAX)
+			if (__dma_fence_is_later(pt_a->seqno, pt_b->seqno,
+						 pt_a->ops))
 				add_fence(fences, &i, pt_a);
 			else
 				add_fence(fences, &i, pt_b);
@@ -461,7 +420,7 @@
 	 * info->num_fences.
 	 */
 	if (!info.num_fences) {
-		info.status = dma_fence_is_signaled(sync_file->fence);
+		info.status = dma_fence_get_status(sync_file->fence);
 		goto no_fences;
 	} else {
 		info.status = 1;
@@ -522,5 +481,5 @@
 	.release = sync_file_release,
 	.poll = sync_file_poll,
 	.unlocked_ioctl = sync_file_ioctl,
-	.compat_ioctl = sync_file_ioctl,
+	.compat_ioctl = compat_ptr_ioctl,
 };

--
Gitblit v1.6.2