lib: Replace open-coded array_n_elements()

Replace it with glib's version, which already exists.

https://bugs.freedesktop.org/show_bug.cgi?id=106280
This commit is contained in:
Bastien Nocera 2018-04-26 17:07:05 +02:00
parent f433a4d67c
commit ff5de4ff03

View file

@ -36,7 +36,7 @@
#include "assembling.h" #include "assembling.h"
#include "drivers/driver_ids.h" #include "drivers/driver_ids.h"
#define array_n_elements(array) (sizeof(array) / sizeof(array[0])) #define array_n_elements(array) G_N_ELEMENTS(array)
#define container_of(ptr, type, member) ({ \ #define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \