[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240429193921.66648-10-jim.cromie@gmail.com>
Date: Mon, 29 Apr 2024 13:39:15 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...mai.com,
gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
amd-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org
Cc: ukaszb@...omium.org,
linux-doc@...r.kernel.org,
daniel.vetter@...ll.ch,
tvrtko.ursulin@...ux.intel.com,
jani.nikula@...el.com,
ville.syrjala@...ux.intel.com,
seanpaul@...omium.org,
robdclark@...il.com,
groeck@...gle.com,
yanivt@...gle.com,
bleung@...gle.com,
Jim Cromie <jim.cromie@...il.com>
Subject: [PATCH v8 29/35] dyndbg: add __counted_by annotations
Tell the compiler about our vectors (array,length), in 2 places:
h: struct _ddebug_info, which keeps refs to the __dyndbg_* ELF/DATA
sections, these are all vectors with a length.
c: struct ddebug_table, which has sub-refs into _ddebug_info.*
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
include/linux/dynamic_debug.h | 6 +++---
lib/dynamic_debug.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index 090fe9554db7..c54d2a4e1d48 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -146,9 +146,9 @@ struct ddebug_class_user {
/* encapsulate linker provided built-in (or module) dyndbg data */
struct _ddebug_info {
- struct _ddebug *descs;
- struct ddebug_class_map *classes;
- struct ddebug_class_user *class_users;
+ struct _ddebug *descs __counted_by(num_descs);
+ struct ddebug_class_map *classes __counted_by(num_classes);
+ struct ddebug_class_user *class_users __counted_by(num_class_users);
unsigned int num_descs;
unsigned int num_classes;
unsigned int num_class_users;
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 625838bd74aa..390a35508fb6 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -49,9 +49,9 @@ extern struct ddebug_class_user __stop___dyndbg_class_users[];
struct ddebug_table {
struct list_head link;
const char *mod_name;
- struct _ddebug *ddebugs;
- struct ddebug_class_map *classes;
- struct ddebug_class_user *class_users;
+ struct _ddebug *ddebugs __counted_by(num_ddebugs);
+ struct ddebug_class_map *classes __counted_by(num_classes);
+ struct ddebug_class_user *class_users __counted_by(num_class_users);
unsigned int num_ddebugs, num_classes, num_class_users;
};
--
2.44.0
Powered by blists - more mailing lists