From 03f215b3741db11f7f48fd3eeb40f5f627bef66f Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Sat, 14 Sep 2024 16:42:04 +0800 Subject: [PATCH] nuttx/atomic.h:fix Fixed the pragma of ATOMIC_VAR_INIT in clang Error: vfs/fs_epoll.c:126:3: error: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Werror,-Wdeprecated-pragma] ATOMIC_VAR_INIT(1), /* i_crefs */ ^ /Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdatomic.h:54:41: note: macro marked 'deprecated' here ^ 1 error generated. make[1]: *** [fs_epoll.o] Error 1 Error: socket/socket.c:78:3: error: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Werror,-Wdeprecated-pragma] ATOMIC_VAR_INIT(1), /* i_crefs */ Signed-off-by: chenrun1 --- crypto/cryptodev.c | 2 +- fs/notify/inotify.c | 2 +- fs/socket/socket.c | 2 +- fs/vfs/fs_dir.c | 2 +- fs/vfs/fs_epoll.c | 2 +- fs/vfs/fs_eventfd.c | 2 +- fs/vfs/fs_signalfd.c | 2 +- fs/vfs/fs_timerfd.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crypto/cryptodev.c b/crypto/cryptodev.c index 1e545de8f3..2e6adcf09e 100644 --- a/crypto/cryptodev.c +++ b/crypto/cryptodev.c @@ -154,7 +154,7 @@ static const struct file_operations g_cryptoops = static struct inode g_cryptoinode = { - .i_crefs = ATOMIC_VAR_INIT(1), + .i_crefs = 1, .u.i_ops = &g_cryptofops }; diff --git a/fs/notify/inotify.c b/fs/notify/inotify.c index 3f95180fd4..5b22cfd8e3 100644 --- a/fs/notify/inotify.c +++ b/fs/notify/inotify.c @@ -131,7 +131,7 @@ static struct inode g_inotify_inode = NULL, NULL, NULL, - ATOMIC_VAR_INIT(1), + 1, FSNODEFLAG_TYPE_DRIVER, { &g_inotify_fops diff --git a/fs/socket/socket.c b/fs/socket/socket.c index 47fcf35bfa..3675988e7a 100644 --- a/fs/socket/socket.c +++ b/fs/socket/socket.c @@ -75,7 +75,7 @@ static struct inode g_sock_inode = NULL, /* i_parent */ NULL, /* i_peer */ NULL, /* i_child */ - ATOMIC_VAR_INIT(1), /* i_crefs */ + 1, /* i_crefs */ FSNODEFLAG_TYPE_SOCKET, /* i_flags */ { &g_sock_fileops /* u */ diff --git a/fs/vfs/fs_dir.c b/fs/vfs/fs_dir.c index a59a8578fb..a33c8e0f3b 100644 --- a/fs/vfs/fs_dir.c +++ b/fs/vfs/fs_dir.c @@ -80,7 +80,7 @@ static struct inode g_dir_inode = NULL, NULL, NULL, - ATOMIC_VAR_INIT(1), + 1, 0, { &g_dir_fileops }, }; diff --git a/fs/vfs/fs_epoll.c b/fs/vfs/fs_epoll.c index f53a002f21..cf612b0a0a 100644 --- a/fs/vfs/fs_epoll.c +++ b/fs/vfs/fs_epoll.c @@ -123,7 +123,7 @@ static struct inode g_epoll_inode = NULL, /* i_parent */ NULL, /* i_peer */ NULL, /* i_child */ - ATOMIC_VAR_INIT(1), /* i_crefs */ + 1, /* i_crefs */ FSNODEFLAG_TYPE_DRIVER, /* i_flags */ { &g_epoll_ops /* u */ diff --git a/fs/vfs/fs_eventfd.c b/fs/vfs/fs_eventfd.c index 5bbd2286ed..d89abf1ded 100644 --- a/fs/vfs/fs_eventfd.c +++ b/fs/vfs/fs_eventfd.c @@ -112,7 +112,7 @@ static struct inode g_eventfd_inode = NULL, /* i_parent */ NULL, /* i_peer */ NULL, /* i_child */ - ATOMIC_VAR_INIT(1), /* i_crefs */ + 1, /* i_crefs */ FSNODEFLAG_TYPE_DRIVER, /* i_flags */ { &g_eventfd_fops /* u */ diff --git a/fs/vfs/fs_signalfd.c b/fs/vfs/fs_signalfd.c index cdd006ca1a..64f9cd61b3 100644 --- a/fs/vfs/fs_signalfd.c +++ b/fs/vfs/fs_signalfd.c @@ -89,7 +89,7 @@ static struct inode g_signalfd_inode = NULL, /* i_parent */ NULL, /* i_peer */ NULL, /* i_child */ - ATOMIC_VAR_INIT(1), /* i_crefs */ + 1, /* i_crefs */ FSNODEFLAG_TYPE_DRIVER, /* i_flags */ { &g_signalfd_fileops /* u */ diff --git a/fs/vfs/fs_timerfd.c b/fs/vfs/fs_timerfd.c index a2b939ef57..3b550d16be 100644 --- a/fs/vfs/fs_timerfd.c +++ b/fs/vfs/fs_timerfd.c @@ -123,7 +123,7 @@ static struct inode g_timerfd_inode = NULL, /* i_parent */ NULL, /* i_peer */ NULL, /* i_child */ - ATOMIC_VAR_INIT(1), /* i_crefs */ + 1, /* i_crefs */ FSNODEFLAG_TYPE_DRIVER, /* i_flags */ { &g_timerfd_fops /* u */