hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/arm/bifrost/tl/mali_kbase_tl_serialize.h
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
33 *
4
- * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -32,12 +32,12 @@
3232 /**
3333 * kbasep_serialize_bytes - serialize bytes to the message buffer
3434 *
35
- * Serialize bytes as is using memcpy()
36
- *
3735 * @buffer: Message buffer
3836 * @pos: Message buffer offset
3937 * @bytes: Bytes to serialize
4038 * @len: Length of bytes array
39
+ *
40
+ * Serialize bytes as if using memcpy().
4141 *
4242 * Return: updated position in the buffer
4343 */
....@@ -58,13 +58,13 @@
5858 /**
5959 * kbasep_serialize_string - serialize string to the message buffer
6060 *
61
- * String is serialized as 4 bytes for string size,
62
- * then string content and then null terminator.
63
- *
6461 * @buffer: Message buffer
6562 * @pos: Message buffer offset
6663 * @string: String to serialize
6764 * @max_write_size: Number of bytes that can be stored in buffer
65
+ *
66
+ * String is serialized as 4 bytes for string size,
67
+ * then string content and then null terminator.
6868 *
6969 * Return: updated position in the buffer
7070 */
....@@ -84,7 +84,7 @@
8484 KBASE_DEBUG_ASSERT(max_write_size >= sizeof(string_len) + sizeof(char));
8585 max_write_size -= sizeof(string_len);
8686
87
- string_len = strlcpy(
87
+ string_len = strscpy(
8888 &buffer[pos + sizeof(string_len)],
8989 string,
9090 max_write_size);
....@@ -102,11 +102,11 @@
102102 /**
103103 * kbasep_serialize_timestamp - serialize timestamp to the message buffer
104104 *
105
- * Get current timestamp using kbasep_get_timestamp()
106
- * and serialize it as 64 bit unsigned integer.
107
- *
108105 * @buffer: Message buffer
109106 * @pos: Message buffer offset
107
+ *
108
+ * Get current timestamp using kbasep_get_timestamp()
109
+ * and serialize it as 64 bit unsigned integer.
110110 *
111111 * Return: updated position in the buffer
112112 */
....@@ -121,4 +121,3 @@
121121 &timestamp, sizeof(timestamp));
122122 }
123123 #endif /* _KBASE_TL_SERIALIZE_H */
124
-