logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0004-Use-__func__-instead-of-obsolete-and-non-standard-__.patch (26177B)


  1. From 611323e80bc8db627f44af6e767a738c1b5c9651 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 21 Jan 2023 17:12:32 -0800
  4. Subject: [PATCH] Use __func__ instead of obsolete and non-standard
  5. __FUNCTION__
  6. ---
  7. include/os/freebsd/spl/sys/debug.h | 34 +++++++++++++-------------
  8. include/os/linux/spl/sys/debug.h | 34 +++++++++++++-------------
  9. lib/libspl/include/assert.h | 36 ++++++++++++++--------------
  10. module/os/freebsd/zfs/crypto_os.c | 8 +++----
  11. module/os/freebsd/zfs/zfs_vfsops.c | 4 ++--
  12. module/os/freebsd/zfs/zfs_vnops_os.c | 2 +-
  13. module/os/freebsd/zfs/zio_crypt.c | 6 ++---
  14. tests/zfs-tests/cmd/idmap_util.c | 2 +-
  15. 8 files changed, 63 insertions(+), 63 deletions(-)
  16. diff --git a/include/os/freebsd/spl/sys/debug.h b/include/os/freebsd/spl/sys/debug.h
  17. index fd22e6b00..c570088d9 100644
  18. --- a/include/os/freebsd/spl/sys/debug.h
  19. +++ b/include/os/freebsd/spl/sys/debug.h
  20. @@ -97,16 +97,16 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  21. #endif
  22. #define PANIC(fmt, a...) \
  23. - spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
  24. + spl_panic(__FILE__, __func__, __LINE__, fmt, ## a)
  25. #define VERIFY(cond) \
  26. (void) (unlikely(!(cond)) && \
  27. spl_assert("VERIFY(" #cond ") failed\n", \
  28. - __FILE__, __FUNCTION__, __LINE__))
  29. + __FILE__, __func__, __LINE__))
  30. #define VERIFYF(cond, str, ...) do { \
  31. if (unlikely(!(cond))) \
  32. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  33. + spl_panic(__FILE__, __func__, __LINE__, \
  34. "VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\
  35. } while (0)
  36. @@ -114,7 +114,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  37. const boolean_t _verify3_left = (boolean_t)(LEFT); \
  38. const boolean_t _verify3_right = (boolean_t)(RIGHT); \
  39. if (unlikely(!(_verify3_left OP _verify3_right))) \
  40. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  41. + spl_panic(__FILE__, __func__, __LINE__, \
  42. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  43. "failed (%d " #OP " %d)\n", \
  44. (boolean_t)_verify3_left, \
  45. @@ -125,7 +125,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  46. const int64_t _verify3_left = (int64_t)(LEFT); \
  47. const int64_t _verify3_right = (int64_t)(RIGHT); \
  48. if (unlikely(!(_verify3_left OP _verify3_right))) \
  49. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  50. + spl_panic(__FILE__, __func__, __LINE__, \
  51. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  52. "failed (%lld " #OP " %lld)\n", \
  53. (long long)_verify3_left, \
  54. @@ -136,7 +136,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  55. const uint64_t _verify3_left = (uint64_t)(LEFT); \
  56. const uint64_t _verify3_right = (uint64_t)(RIGHT); \
  57. if (unlikely(!(_verify3_left OP _verify3_right))) \
  58. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  59. + spl_panic(__FILE__, __func__, __LINE__, \
  60. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  61. "failed (%llu " #OP " %llu)\n", \
  62. (unsigned long long)_verify3_left, \
  63. @@ -147,7 +147,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  64. const uintptr_t _verify3_left = (uintptr_t)(LEFT); \
  65. const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
  66. if (unlikely(!(_verify3_left OP _verify3_right))) \
  67. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  68. + spl_panic(__FILE__, __func__, __LINE__, \
  69. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  70. "failed (%px " #OP " %px)\n", \
  71. (void *)_verify3_left, \
  72. @@ -157,7 +157,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  73. #define VERIFY0(RIGHT) do { \
  74. const int64_t _verify0_right = (int64_t)(RIGHT); \
  75. if (unlikely(!(0 == _verify0_right))) \
  76. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  77. + spl_panic(__FILE__, __func__, __LINE__, \
  78. "VERIFY0(" #RIGHT ") " \
  79. "failed (0 == %lld)\n", \
  80. (long long)_verify0_right); \
  81. @@ -166,7 +166,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  82. #define VERIFY0P(RIGHT) do { \
  83. const uintptr_t _verify0_right = (uintptr_t)(RIGHT); \
  84. if (unlikely(!(0 == _verify0_right))) \
  85. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  86. + spl_panic(__FILE__, __func__, __LINE__, \
  87. "VERIFY0P(" #RIGHT ") " \
  88. "failed (NULL == %px)\n", \
  89. (void *)_verify0_right); \
  90. @@ -184,7 +184,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  91. const boolean_t _verify3_left = (boolean_t)(LEFT); \
  92. const boolean_t _verify3_right = (boolean_t)(RIGHT); \
  93. if (unlikely(!(_verify3_left OP _verify3_right))) \
  94. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  95. + spl_panic(__FILE__, __func__, __LINE__, \
  96. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  97. "failed (%d " #OP " %d) " STR "\n", \
  98. (boolean_t)(_verify3_left), \
  99. @@ -196,7 +196,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  100. const int64_t _verify3_left = (int64_t)(LEFT); \
  101. const int64_t _verify3_right = (int64_t)(RIGHT); \
  102. if (unlikely(!(_verify3_left OP _verify3_right))) \
  103. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  104. + spl_panic(__FILE__, __func__, __LINE__, \
  105. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  106. "failed (%lld " #OP " %lld) " STR "\n", \
  107. (long long)(_verify3_left), \
  108. @@ -208,7 +208,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  109. const uint64_t _verify3_left = (uint64_t)(LEFT); \
  110. const uint64_t _verify3_right = (uint64_t)(RIGHT); \
  111. if (unlikely(!(_verify3_left OP _verify3_right))) \
  112. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  113. + spl_panic(__FILE__, __func__, __LINE__, \
  114. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  115. "failed (%llu " #OP " %llu) " STR "\n", \
  116. (unsigned long long)(_verify3_left), \
  117. @@ -220,7 +220,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  118. const uintptr_t _verify3_left = (uintptr_t)(LEFT); \
  119. const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
  120. if (unlikely(!(_verify3_left OP _verify3_right))) \
  121. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  122. + spl_panic(__FILE__, __func__, __LINE__, \
  123. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  124. "failed (%px " #OP " %px) " STR "\n", \
  125. (void *) (_verify3_left), \
  126. @@ -232,7 +232,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  127. const uintptr_t _verify3_left = (uintptr_t)(0); \
  128. const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
  129. if (unlikely(!(_verify3_left == _verify3_right))) \
  130. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  131. + spl_panic(__FILE__, __func__, __LINE__, \
  132. "VERIFY0(0 == " #RIGHT ") " \
  133. "failed (0 == %px) " STR "\n", \
  134. (long long) (_verify3_right), \
  135. @@ -243,7 +243,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  136. const int64_t _verify3_left = (int64_t)(0); \
  137. const int64_t _verify3_right = (int64_t)(RIGHT); \
  138. if (unlikely(!(_verify3_left == _verify3_right))) \
  139. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  140. + spl_panic(__FILE__, __func__, __LINE__, \
  141. "VERIFY0(0 == " #RIGHT ") " \
  142. "failed (0 == %lld) " STR "\n", \
  143. (long long) (_verify3_right), \
  144. @@ -253,12 +253,12 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  145. #define VERIFY_IMPLY(A, B) \
  146. ((void)(likely((!(A)) || (B)) || \
  147. spl_assert("(" #A ") implies (" #B ")", \
  148. - __FILE__, __FUNCTION__, __LINE__)))
  149. + __FILE__, __func__, __LINE__)))
  150. #define VERIFY_EQUIV(A, B) \
  151. ((void)(likely(!!(A) == !!(B)) || \
  152. spl_assert("(" #A ") is equivalent to (" #B ")", \
  153. - __FILE__, __FUNCTION__, __LINE__)))
  154. + __FILE__, __func__, __LINE__)))
  155. /*
  156. * Debugging disabled (--disable-debug)
  157. diff --git a/include/os/linux/spl/sys/debug.h b/include/os/linux/spl/sys/debug.h
  158. index 3459d6979..885a2db06 100644
  159. --- a/include/os/linux/spl/sys/debug.h
  160. +++ b/include/os/linux/spl/sys/debug.h
  161. @@ -101,16 +101,16 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  162. #endif
  163. #define PANIC(fmt, a...) \
  164. - spl_panic(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
  165. + spl_panic(__FILE__, __func__, __LINE__, fmt, ## a)
  166. #define VERIFY(cond) \
  167. (void) (unlikely(!(cond)) && \
  168. spl_assert("VERIFY(" #cond ") failed\n", \
  169. - __FILE__, __FUNCTION__, __LINE__))
  170. + __FILE__, __func__, __LINE__))
  171. #define VERIFYF(cond, str, ...) do { \
  172. if (unlikely(!(cond))) \
  173. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  174. + spl_panic(__FILE__, __func__, __LINE__, \
  175. "VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\
  176. } while (0)
  177. @@ -118,7 +118,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  178. const boolean_t _verify3_left = (boolean_t)(LEFT); \
  179. const boolean_t _verify3_right = (boolean_t)(RIGHT); \
  180. if (unlikely(!(_verify3_left OP _verify3_right))) \
  181. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  182. + spl_panic(__FILE__, __func__, __LINE__, \
  183. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  184. "failed (%d " #OP " %d)\n", \
  185. (boolean_t)_verify3_left, \
  186. @@ -129,7 +129,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  187. const int64_t _verify3_left = (int64_t)(LEFT); \
  188. const int64_t _verify3_right = (int64_t)(RIGHT); \
  189. if (unlikely(!(_verify3_left OP _verify3_right))) \
  190. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  191. + spl_panic(__FILE__, __func__, __LINE__, \
  192. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  193. "failed (%lld " #OP " %lld)\n", \
  194. (long long)_verify3_left, \
  195. @@ -140,7 +140,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  196. const uint64_t _verify3_left = (uint64_t)(LEFT); \
  197. const uint64_t _verify3_right = (uint64_t)(RIGHT); \
  198. if (unlikely(!(_verify3_left OP _verify3_right))) \
  199. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  200. + spl_panic(__FILE__, __func__, __LINE__, \
  201. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  202. "failed (%llu " #OP " %llu)\n", \
  203. (unsigned long long)_verify3_left, \
  204. @@ -151,7 +151,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  205. const uintptr_t _verify3_left = (uintptr_t)(LEFT); \
  206. const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
  207. if (unlikely(!(_verify3_left OP _verify3_right))) \
  208. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  209. + spl_panic(__FILE__, __func__, __LINE__, \
  210. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  211. "failed (%px " #OP " %px)\n", \
  212. (void *)_verify3_left, \
  213. @@ -161,7 +161,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  214. #define VERIFY0(RIGHT) do { \
  215. const int64_t _verify0_right = (int64_t)(RIGHT); \
  216. if (unlikely(!(0 == _verify0_right))) \
  217. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  218. + spl_panic(__FILE__, __func__, __LINE__, \
  219. "VERIFY0(" #RIGHT ") " \
  220. "failed (0 == %lld)\n", \
  221. (long long)_verify0_right); \
  222. @@ -170,7 +170,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  223. #define VERIFY0P(RIGHT) do { \
  224. const uintptr_t _verify0_right = (uintptr_t)(RIGHT); \
  225. if (unlikely(!(0 == _verify0_right))) \
  226. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  227. + spl_panic(__FILE__, __func__, __LINE__, \
  228. "VERIFY0P(" #RIGHT ") " \
  229. "failed (NULL == %px)\n", \
  230. (void *)_verify0_right); \
  231. @@ -188,7 +188,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  232. const boolean_t _verify3_left = (boolean_t)(LEFT); \
  233. const boolean_t _verify3_right = (boolean_t)(RIGHT); \
  234. if (unlikely(!(_verify3_left OP _verify3_right))) \
  235. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  236. + spl_panic(__FILE__, __func__, __LINE__, \
  237. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  238. "failed (%d " #OP " %d) " STR "\n", \
  239. (boolean_t)(_verify3_left), \
  240. @@ -200,7 +200,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  241. const int64_t _verify3_left = (int64_t)(LEFT); \
  242. const int64_t _verify3_right = (int64_t)(RIGHT); \
  243. if (unlikely(!(_verify3_left OP _verify3_right))) \
  244. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  245. + spl_panic(__FILE__, __func__, __LINE__, \
  246. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  247. "failed (%lld " #OP " %lld) " STR "\n", \
  248. (long long)(_verify3_left), \
  249. @@ -212,7 +212,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  250. const uint64_t _verify3_left = (uint64_t)(LEFT); \
  251. const uint64_t _verify3_right = (uint64_t)(RIGHT); \
  252. if (unlikely(!(_verify3_left OP _verify3_right))) \
  253. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  254. + spl_panic(__FILE__, __func__, __LINE__, \
  255. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  256. "failed (%llu " #OP " %llu) " STR "\n", \
  257. (unsigned long long)(_verify3_left), \
  258. @@ -224,7 +224,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  259. const uintptr_t _verify3_left = (uintptr_t)(LEFT); \
  260. const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
  261. if (unlikely(!(_verify3_left OP _verify3_right))) \
  262. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  263. + spl_panic(__FILE__, __func__, __LINE__, \
  264. "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
  265. "failed (%px " #OP " %px) " STR "\n", \
  266. (void *) (_verify3_left), \
  267. @@ -236,7 +236,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  268. const uintptr_t _verify3_left = (uintptr_t)(0); \
  269. const uintptr_t _verify3_right = (uintptr_t)(RIGHT); \
  270. if (unlikely(!(_verify3_left == _verify3_right))) \
  271. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  272. + spl_panic(__FILE__, __func__, __LINE__, \
  273. "VERIFY0(0 == " #RIGHT ") " \
  274. "failed (0 == %px) " STR "\n", \
  275. (long long) (_verify3_right), \
  276. @@ -247,7 +247,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  277. const int64_t _verify3_left = (int64_t)(0); \
  278. const int64_t _verify3_right = (int64_t)(RIGHT); \
  279. if (unlikely(!(_verify3_left == _verify3_right))) \
  280. - spl_panic(__FILE__, __FUNCTION__, __LINE__, \
  281. + spl_panic(__FILE__, __func__, __LINE__, \
  282. "VERIFY0(0 == " #RIGHT ") " \
  283. "failed (0 == %lld) " STR "\n", \
  284. (long long) (_verify3_right), \
  285. @@ -257,12 +257,12 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
  286. #define VERIFY_IMPLY(A, B) \
  287. ((void)(likely((!(A)) || (B)) || \
  288. spl_assert("(" #A ") implies (" #B ")", \
  289. - __FILE__, __FUNCTION__, __LINE__)))
  290. + __FILE__, __func__, __LINE__)))
  291. #define VERIFY_EQUIV(A, B) \
  292. ((void)(likely(!!(A) == !!(B)) || \
  293. spl_assert("(" #A ") is equivalent to (" #B ")", \
  294. - __FILE__, __FUNCTION__, __LINE__)))
  295. + __FILE__, __func__, __LINE__)))
  296. /*
  297. * Debugging disabled (--disable-debug)
  298. diff --git a/lib/libspl/include/assert.h b/lib/libspl/include/assert.h
  299. index 155bbab30..ce1b8e486 100644
  300. --- a/lib/libspl/include/assert.h
  301. +++ b/lib/libspl/include/assert.h
  302. @@ -65,30 +65,30 @@ libspl_assert(const char *buf, const char *file, const char *func, int line)
  303. #endif
  304. #define PANIC(fmt, a...) \
  305. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, fmt, ## a)
  306. + libspl_assertf(__FILE__, __func__, __LINE__, fmt, ## a)
  307. #define VERIFY(cond) \
  308. (void) ((!(cond)) && \
  309. - libspl_assert(#cond, __FILE__, __FUNCTION__, __LINE__))
  310. + libspl_assert(#cond, __FILE__, __func__, __LINE__))
  311. #define VERIFYF(cond, STR, ...) \
  312. do { \
  313. if (!(cond)) \
  314. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  315. + libspl_assertf(__FILE__, __func__, __LINE__, \
  316. "%s " STR, #cond, \
  317. __VA_ARGS__); \
  318. } while (0)
  319. #define verify(cond) \
  320. (void) ((!(cond)) && \
  321. - libspl_assert(#cond, __FILE__, __FUNCTION__, __LINE__))
  322. + libspl_assert(#cond, __FILE__, __func__, __LINE__))
  323. #define VERIFY3B(LEFT, OP, RIGHT) \
  324. do { \
  325. const boolean_t __left = (boolean_t)(LEFT); \
  326. const boolean_t __right = (boolean_t)(RIGHT); \
  327. if (!(__left OP __right)) \
  328. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  329. + libspl_assertf(__FILE__, __func__, __LINE__, \
  330. "%s %s %s (0x%llx %s 0x%llx)", #LEFT, #OP, #RIGHT, \
  331. (u_longlong_t)__left, #OP, (u_longlong_t)__right); \
  332. } while (0)
  333. @@ -98,7 +98,7 @@ do { \
  334. const int64_t __left = (int64_t)(LEFT); \
  335. const int64_t __right = (int64_t)(RIGHT); \
  336. if (!(__left OP __right)) \
  337. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  338. + libspl_assertf(__FILE__, __func__, __LINE__, \
  339. "%s %s %s (0x%llx %s 0x%llx)", #LEFT, #OP, #RIGHT, \
  340. (u_longlong_t)__left, #OP, (u_longlong_t)__right); \
  341. } while (0)
  342. @@ -108,7 +108,7 @@ do { \
  343. const uint64_t __left = (uint64_t)(LEFT); \
  344. const uint64_t __right = (uint64_t)(RIGHT); \
  345. if (!(__left OP __right)) \
  346. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  347. + libspl_assertf(__FILE__, __func__, __LINE__, \
  348. "%s %s %s (0x%llx %s 0x%llx)", #LEFT, #OP, #RIGHT, \
  349. (u_longlong_t)__left, #OP, (u_longlong_t)__right); \
  350. } while (0)
  351. @@ -118,7 +118,7 @@ do { \
  352. const uintptr_t __left = (uintptr_t)(LEFT); \
  353. const uintptr_t __right = (uintptr_t)(RIGHT); \
  354. if (!(__left OP __right)) \
  355. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  356. + libspl_assertf(__FILE__, __func__, __LINE__, \
  357. "%s %s %s (%p %s %p)", #LEFT, #OP, #RIGHT, \
  358. (void *)__left, #OP, (void *)__right); \
  359. } while (0)
  360. @@ -127,7 +127,7 @@ do { \
  361. do { \
  362. const uint64_t __left = (uint64_t)(LEFT); \
  363. if (!(__left == 0)) \
  364. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  365. + libspl_assertf(__FILE__, __func__, __LINE__, \
  366. "%s == 0 (0x%llx == 0)", #LEFT, \
  367. (u_longlong_t)__left); \
  368. } while (0)
  369. @@ -136,7 +136,7 @@ do { \
  370. do { \
  371. const uintptr_t __left = (uintptr_t)(LEFT); \
  372. if (!(__left == 0)) \
  373. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  374. + libspl_assertf(__FILE__, __func__, __LINE__, \
  375. "%s == 0 (%p == 0)", #LEFT, \
  376. (void *)__left); \
  377. } while (0)
  378. @@ -152,7 +152,7 @@ do { \
  379. const boolean_t __left = (boolean_t)(LEFT); \
  380. const boolean_t __right = (boolean_t)(RIGHT); \
  381. if (!(__left OP __right)) \
  382. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  383. + libspl_assertf(__FILE__, __func__, __LINE__, \
  384. "%s %s %s (0x%llx %s 0x%llx) " STR, \
  385. #LEFT, #OP, #RIGHT, \
  386. (u_longlong_t)__left, #OP, (u_longlong_t)__right, \
  387. @@ -164,7 +164,7 @@ do { \
  388. const int64_t __left = (int64_t)(LEFT); \
  389. const int64_t __right = (int64_t)(RIGHT); \
  390. if (!(__left OP __right)) \
  391. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  392. + libspl_assertf(__FILE__, __func__, __LINE__, \
  393. "%s %s %s (0x%llx %s 0x%llx) " STR, \
  394. #LEFT, #OP, #RIGHT, \
  395. (u_longlong_t)__left, #OP, (u_longlong_t)__right, \
  396. @@ -176,7 +176,7 @@ do { \
  397. const uint64_t __left = (uint64_t)(LEFT); \
  398. const uint64_t __right = (uint64_t)(RIGHT); \
  399. if (!(__left OP __right)) \
  400. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  401. + libspl_assertf(__FILE__, __func__, __LINE__, \
  402. "%s %s %s (0x%llx %s 0x%llx) " STR, \
  403. #LEFT, #OP, #RIGHT, \
  404. (u_longlong_t)__left, #OP, (u_longlong_t)__right, \
  405. @@ -188,7 +188,7 @@ do { \
  406. const uintptr_t __left = (uintptr_t)(LEFT); \
  407. const uintptr_t __right = (uintptr_t)(RIGHT); \
  408. if (!(__left OP __right)) \
  409. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  410. + libspl_assertf(__FILE__, __func__, __LINE__, \
  411. "%s %s %s (0x%llx %s 0x%llx) " STR, \
  412. #LEFT, #OP, #RIGHT, \
  413. (u_longlong_t)__left, #OP, (u_longlong_t)__right, \
  414. @@ -200,7 +200,7 @@ do { \
  415. do { \
  416. const uint64_t __left = (uint64_t)(LEFT); \
  417. if (!(__left == 0)) \
  418. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  419. + libspl_assertf(__FILE__, __func__, __LINE__, \
  420. "%s == 0 (0x%llx == 0) " STR, #LEFT, \
  421. (u_longlong_t)__left, __VA_ARGS__); \
  422. } while (0)
  423. @@ -209,7 +209,7 @@ do { \
  424. do { \
  425. const uintptr_t __left = (uintptr_t)(LEFT); \
  426. if (!(__left == 0)) \
  427. - libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
  428. + libspl_assertf(__FILE__, __func__, __LINE__, \
  429. "%s == 0 (%p == 0) " STR, #LEFT, \
  430. (u_longlong_t)__left, __VA_ARGS__); \
  431. } while (0)
  432. @@ -262,11 +262,11 @@ do { \
  433. #define IMPLY(A, B) \
  434. ((void)(((!(A)) || (B)) || \
  435. libspl_assert("(" #A ") implies (" #B ")", \
  436. - __FILE__, __FUNCTION__, __LINE__)))
  437. + __FILE__, __func__, __LINE__)))
  438. #define EQUIV(A, B) \
  439. ((void)((!!(A) == !!(B)) || \
  440. libspl_assert("(" #A ") is equivalent to (" #B ")", \
  441. - __FILE__, __FUNCTION__, __LINE__)))
  442. + __FILE__, __func__, __LINE__)))
  443. #endif /* NDEBUG */
  444. diff --git a/module/os/freebsd/zfs/crypto_os.c b/module/os/freebsd/zfs/crypto_os.c
  445. index 4d8493743..d35c101f4 100644
  446. --- a/module/os/freebsd/zfs/crypto_os.c
  447. +++ b/module/os/freebsd/zfs/crypto_os.c
  448. @@ -217,7 +217,7 @@ freebsd_crypt_uio_debug_log(boolean_t encrypt,
  449. printf("%s(%s, %p, { %s, %d, %d, %s }, %p, { %p, %u }, "
  450. "%p, %u, %u)\n",
  451. - __FUNCTION__, encrypt ? "encrypt" : "decrypt", input_sessionp,
  452. + __func__, encrypt ? "encrypt" : "decrypt", input_sessionp,
  453. c_info->ci_algname, c_info->ci_crypt_type,
  454. (unsigned int)c_info->ci_keylen, c_info->ci_name,
  455. data_uio, key->ck_data,
  456. @@ -252,7 +252,7 @@ freebsd_crypt_newsession(freebsd_crypt_session_t *sessp,
  457. #ifdef FCRYPTO_DEBUG
  458. printf("%s(%p, { %s, %d, %d, %s }, { %p, %u })\n",
  459. - __FUNCTION__, sessp,
  460. + __func__, sessp,
  461. c_info->ci_algname, c_info->ci_crypt_type,
  462. (unsigned int)c_info->ci_keylen, c_info->ci_name,
  463. key->ck_data, (unsigned int)key->ck_length);
  464. @@ -317,7 +317,7 @@ freebsd_crypt_newsession(freebsd_crypt_session_t *sessp,
  465. bad:
  466. #ifdef FCRYPTO_DEBUG
  467. if (error)
  468. - printf("%s: returning error %d\n", __FUNCTION__, error);
  469. + printf("%s: returning error %d\n", __func__, error);
  470. #endif
  471. return (error);
  472. }
  473. @@ -373,7 +373,7 @@ freebsd_crypt_uio(boolean_t encrypt,
  474. out:
  475. #ifdef FCRYPTO_DEBUG
  476. if (error)
  477. - printf("%s: returning error %d\n", __FUNCTION__, error);
  478. + printf("%s: returning error %d\n", __func__, error);
  479. #endif
  480. if (input_sessionp == NULL) {
  481. freebsd_crypt_freesession(session);
  482. diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c
  483. index a3fac1636..48e3cba13 100644
  484. --- a/module/os/freebsd/zfs/zfs_vfsops.c
  485. +++ b/module/os/freebsd/zfs/zfs_vfsops.c
  486. @@ -253,7 +253,7 @@ zfs_getquota(zfsvfs_t *zfsvfs, uid_t id, int isgroup, struct dqblk64 *dqp)
  487. if ((error = zap_lookup(zfsvfs->z_os, quotaobj,
  488. buf, sizeof (quota), 1, &quota)) != 0) {
  489. dprintf("%s(%d): quotaobj lookup failed\n",
  490. - __FUNCTION__, __LINE__);
  491. + __func__, __LINE__);
  492. goto done;
  493. }
  494. /*
  495. @@ -264,7 +264,7 @@ zfs_getquota(zfsvfs_t *zfsvfs, uid_t id, int isgroup, struct dqblk64 *dqp)
  496. error = zap_lookup(zfsvfs->z_os, usedobj, buf, sizeof (used), 1, &used);
  497. if (error && error != ENOENT) {
  498. dprintf("%s(%d): usedobj failed; %d\n",
  499. - __FUNCTION__, __LINE__, error);
  500. + __func__, __LINE__, error);
  501. goto done;
  502. }
  503. dqp->dqb_curblocks = btodb(used);
  504. diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c
  505. index 5edd3fcc7..9af121d60 100644
  506. --- a/module/os/freebsd/zfs/zfs_vnops_os.c
  507. +++ b/module/os/freebsd/zfs/zfs_vnops_os.c
  508. @@ -4378,7 +4378,7 @@ zfs_freebsd_read(struct vop_read_args *ap)
  509. printf("%s(%d): Direct I/O read returning EFAULT "
  510. "uio = %p, zfs_uio_offset(uio) = %lu "
  511. "zfs_uio_resid(uio) = %lu\n",
  512. - __FUNCTION__, __LINE__, &uio, zfs_uio_offset(&uio),
  513. + __func__, __LINE__, &uio, zfs_uio_offset(&uio),
  514. zfs_uio_resid(&uio));
  515. #endif
  516. }
  517. diff --git a/module/os/freebsd/zfs/zio_crypt.c b/module/os/freebsd/zfs/zio_crypt.c
  518. index 195ac58f6..b6de57683 100644
  519. --- a/module/os/freebsd/zfs/zio_crypt.c
  520. +++ b/module/os/freebsd/zfs/zio_crypt.c
  521. @@ -409,7 +409,7 @@ zio_do_crypt_uio_opencrypto(boolean_t encrypt, freebsd_crypt_session_t *sess,
  522. if (ret != 0) {
  523. #ifdef FCRYPTO_DEBUG
  524. printf("%s(%d): Returning error %s\n",
  525. - __FUNCTION__, __LINE__, encrypt ? "EIO" : "ECKSUM");
  526. + __func__, __LINE__, encrypt ? "EIO" : "ECKSUM");
  527. #endif
  528. ret = SET_ERROR(encrypt ? EIO : ECKSUM);
  529. }
  530. @@ -1176,7 +1176,7 @@ zio_crypt_do_indirect_mac_checksum_impl(boolean_t generate, void *buf,
  531. if (memcmp(digestbuf, cksum, ZIO_DATA_MAC_LEN) != 0) {
  532. #ifdef FCRYPTO_DEBUG
  533. - printf("%s(%d): Setting ECKSUM\n", __FUNCTION__, __LINE__);
  534. + printf("%s(%d): Setting ECKSUM\n", __func__, __LINE__);
  535. #endif
  536. return (SET_ERROR(ECKSUM));
  537. }
  538. @@ -1693,7 +1693,7 @@ zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key,
  539. #ifdef FCRYPTO_DEBUG
  540. printf("%s(%s, %p, %p, %d, %p, %p, %u, %s, %p, %p, %p)\n",
  541. - __FUNCTION__,
  542. + __func__,
  543. encrypt ? "encrypt" : "decrypt",
  544. key, salt, ot, iv, mac, datalen,
  545. byteswap ? "byteswap" : "native_endian", plainbuf,
  546. diff --git a/tests/zfs-tests/cmd/idmap_util.c b/tests/zfs-tests/cmd/idmap_util.c
  547. index 49483cbaa..5a6cae9eb 100644
  548. --- a/tests/zfs-tests/cmd/idmap_util.c
  549. +++ b/tests/zfs-tests/cmd/idmap_util.c
  550. @@ -155,7 +155,7 @@ log_msg(const char *msg, ...)
  551. #define log_errno(msg, args...) \
  552. do { \
  553. log_msg("%s:%d:%s: [%m] " msg, __FILE__, __LINE__,\
  554. - __FUNCTION__, ##args); \
  555. + __func__, ##args); \
  556. } while (0)
  557. /*
  558. --
  559. 2.44.0