2019-05-29 16:57:50 -07:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-12 15:14:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-19 14:13:16 +03:00
|
|
|
|
|
|
|
|
|
ubifs: correct UBIFS_DFS_DIR_LEN macro definition and improve code clarity
The UBIFS_DFS_DIR_LEN macro, which defines the maximum length of the UBIFS
debugfs directory name, has an incorrect formula and misleading comments.
The current formula is (3 + 1 + 2*2 + 1), which assumes that both UBI device
number and volume ID are limited to 2 characters. However, UBI device number
ranges from 0 to 31 (2 characters), and volume ID ranges from 0 to 127 (up
to 3 characters).
Although the current code works due to the cancellation of mathematical
errors (9 + 1 = 10, which matches the correct UBIFS_DFS_DIR_LEN value), it
can lead to confusion and potential issues in the future.
This patch aims to improve the code clarity and maintainability by making
the following changes:
1. Corrects the UBIFS_DFS_DIR_LEN macro definition to (3 + 1 + 2 + 3 + 1),
accommodating the maximum lengths of both UBI device number and volume ID,
plus the separators and null terminator.
2. Updates the snprintf calls to use UBIFS_DFS_DIR_LEN instead of
UBIFS_DFS_DIR_LEN + 1, removing the unnecessary +1.
3. Modifies the error checks to compare against UBIFS_DFS_DIR_LEN using >=
instead of >, aligning with the corrected macro definition.
4. Removes the redundant +1 in the dfs_dir_name array definitions in ubi.h
and debug.h.
While these changes do not affect the runtime behavior, they make the code
more readable, maintainable, and less prone to future errors.
v2->v3:
- Removes the duplicated UBIFS_DFS_DIR_LEN and UBIFS_DFS_DIR_NAME macro
definitions in ubifs.h, as they are already defined in debug.h.
Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2024-04-18 15:07:04 +08:00
|
|
|
|
|
|
|
|
|
2011-05-19 14:13:16 +03:00
|
|
|
|
|
|
|
|
|
ubifs: correct UBIFS_DFS_DIR_LEN macro definition and improve code clarity
The UBIFS_DFS_DIR_LEN macro, which defines the maximum length of the UBIFS
debugfs directory name, has an incorrect formula and misleading comments.
The current formula is (3 + 1 + 2*2 + 1), which assumes that both UBI device
number and volume ID are limited to 2 characters. However, UBI device number
ranges from 0 to 31 (2 characters), and volume ID ranges from 0 to 127 (up
to 3 characters).
Although the current code works due to the cancellation of mathematical
errors (9 + 1 = 10, which matches the correct UBIFS_DFS_DIR_LEN value), it
can lead to confusion and potential issues in the future.
This patch aims to improve the code clarity and maintainability by making
the following changes:
1. Corrects the UBIFS_DFS_DIR_LEN macro definition to (3 + 1 + 2 + 3 + 1),
accommodating the maximum lengths of both UBI device number and volume ID,
plus the separators and null terminator.
2. Updates the snprintf calls to use UBIFS_DFS_DIR_LEN instead of
UBIFS_DFS_DIR_LEN + 1, removing the unnecessary +1.
3. Modifies the error checks to compare against UBIFS_DFS_DIR_LEN using >=
instead of >, aligning with the corrected macro definition.
4. Removes the redundant +1 in the dfs_dir_name array definitions in ubi.h
and debug.h.
While these changes do not affect the runtime behavior, they make the code
more readable, maintainable, and less prone to future errors.
v2->v3:
- Removes the duplicated UBIFS_DFS_DIR_LEN and UBIFS_DFS_DIR_NAME macro
definitions in ubifs.h, as they are already defined in debug.h.
Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2024-04-18 15:07:04 +08:00
|
|
|
|
2011-05-19 14:13:16 +03:00
|
|
|
|
2008-10-17 13:31:39 +03:00
|
|
|
|
2026-07-29 10:20:42 -07:00
|
|
|
|
2008-10-17 13:31:39 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-31 18:16:34 +03:00
|
|
|
|
2011-06-03 15:10:33 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-31 18:16:34 +03:00
|
|
|
|
2008-10-17 13:31:39 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-23 14:54:59 +02:00
|
|
|
|
|
|
|
|
|
2008-10-23 11:49:28 +03:00
|
|
|
|
2009-01-23 14:54:59 +02:00
|
|
|
|
2011-03-29 18:36:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-23 14:54:59 +02:00
|
|
|
|
2011-05-31 18:16:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-17 14:07:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-31 18:16:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-14 14:19:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-17 13:31:39 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-31 18:16:34 +03:00
|
|
|
|
2011-06-03 15:10:33 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-31 18:16:34 +03:00
|
|
|
|
2008-10-17 13:31:39 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-23 11:49:28 +03:00
|
|
|
|
2009-01-23 14:54:59 +02:00
|
|
|
|
2011-03-29 18:36:21 +03:00
|
|
|
|
2009-01-23 14:54:59 +02:00
|
|
|
|
2011-03-29 18:36:21 +03:00
|
|
|
|
2009-01-23 14:54:59 +02:00
|
|
|
|
2011-05-31 18:16:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ubifs: correct UBIFS_DFS_DIR_LEN macro definition and improve code clarity
The UBIFS_DFS_DIR_LEN macro, which defines the maximum length of the UBIFS
debugfs directory name, has an incorrect formula and misleading comments.
The current formula is (3 + 1 + 2*2 + 1), which assumes that both UBI device
number and volume ID are limited to 2 characters. However, UBI device number
ranges from 0 to 31 (2 characters), and volume ID ranges from 0 to 127 (up
to 3 characters).
Although the current code works due to the cancellation of mathematical
errors (9 + 1 = 10, which matches the correct UBIFS_DFS_DIR_LEN value), it
can lead to confusion and potential issues in the future.
This patch aims to improve the code clarity and maintainability by making
the following changes:
1. Corrects the UBIFS_DFS_DIR_LEN macro definition to (3 + 1 + 2 + 3 + 1),
accommodating the maximum lengths of both UBI device number and volume ID,
plus the separators and null terminator.
2. Updates the snprintf calls to use UBIFS_DFS_DIR_LEN instead of
UBIFS_DFS_DIR_LEN + 1, removing the unnecessary +1.
3. Modifies the error checks to compare against UBIFS_DFS_DIR_LEN using >=
instead of >, aligning with the corrected macro definition.
4. Removes the redundant +1 in the dfs_dir_name array definitions in ubi.h
and debug.h.
While these changes do not affect the runtime behavior, they make the code
more readable, maintainable, and less prone to future errors.
v2->v3:
- Removes the duplicated UBIFS_DFS_DIR_LEN and UBIFS_DFS_DIR_NAME macro
definitions in ubifs.h, as they are already defined in debug.h.
Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2024-04-18 15:07:04 +08:00
|
|
|
|
2009-01-23 14:54:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-31 18:16:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-14 14:19:46 +03:00
|
|
|
|
2008-10-17 13:31:39 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-06-01 17:43:43 +03:00
|
|
|
|
2026-07-29 10:20:42 -07:00
|
|
|
|
2011-06-01 17:43:43 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-12 13:01:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-12 13:01:57 +02:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2018-07-12 13:01:58 +02:00
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-12 13:01:58 +02:00
|
|
|
|
2018-07-12 13:01:57 +02:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-11 15:13:27 +02:00
|
|
|
|
2012-08-22 16:37:13 +03:00
|
|
|
|
|
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2012-08-21 21:50:58 +03:00
|
|
|
|
2012-01-13 12:33:53 +02:00
|
|
|
|
|
|
|
|
|
2012-08-22 16:37:13 +03:00
|
|
|
|
|
|
|
|
|
2012-01-13 12:33:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2012-01-13 12:33:53 +02:00
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2012-01-13 12:33:53 +02:00
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2012-01-13 12:33:53 +02:00
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-05-17 15:15:30 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-06-01 17:43:43 +03:00
|
|
|
|
2011-06-03 08:31:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-01 17:43:43 +03:00
|
|
|
|
2011-06-03 08:31:29 +03:00
|
|
|
|
2011-06-03 08:53:35 +03:00
|
|
|
|
2011-06-03 08:31:29 +03:00
|
|
|
|
2011-06-01 17:43:43 +03:00
|
|
|
|
2011-06-03 08:31:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-01 17:43:43 +03:00
|
|
|
|
2011-06-03 08:31:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-01 17:43:43 +03:00
|
|
|
|
2011-06-03 08:31:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-01 17:43:43 +03:00
|
|
|
|
2011-06-03 08:31:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-01 17:43:43 +03:00
|
|
|
|
2011-06-03 08:31:29 +03:00
|
|
|
|
2011-06-03 13:45:09 +03:00
|
|
|
|
|
|
|
|
|
2011-06-03 15:10:33 +03:00
|
|
|
|
2011-06-03 13:45:09 +03:00
|
|
|
|
2011-06-03 08:31:29 +03:00
|
|
|
|
2008-10-17 13:31:39 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-15 15:03:51 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
|
|
|
|
|
2012-01-13 12:33:53 +02:00
|
|
|
|
|
|
|
|
|
2012-05-16 19:15:56 +03:00
|
|
|
|
2020-06-16 15:11:42 +08:00
|
|
|
|
|
|
|
|
|
2012-05-16 19:15:56 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-23 14:54:59 +02:00
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-12 18:13:31 +03:00
|
|
|
|
|
|
|
|
|
2011-05-31 18:14:38 +03:00
|
|
|
|
2011-05-25 17:38:29 +03:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-08-27 16:34:19 +03:00
|
|
|
|
|
|
|
|
|
2010-08-07 10:06:11 +03:00
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2011-06-03 14:51:41 +03:00
|
|
|
|
2012-05-14 17:55:51 +02:00
|
|
|
|
|
|
|
|
|
2011-06-03 14:51:41 +03:00
|
|
|
|
2012-05-14 17:55:51 +02:00
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|
2008-10-23 11:49:28 +03:00
|
|
|
|
2019-06-12 17:21:20 +02:00
|
|
|
|
2008-10-23 11:49:28 +03:00
|
|
|
|
2019-06-12 17:21:20 +02:00
|
|
|
|
2008-10-23 11:49:28 +03:00
|
|
|
|
|
|
|
|
|
2008-07-14 19:08:37 +03:00
|
|
|
|