Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1384790
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/7] debugobjects: make fixup functions return bool instead of int |
| Date | 2016-04-22 10:40 +0200 |
| Message-ID | <rqEN4-7vo-19@gated-at.bofh.it> (permalink) |
| References | <rqEtI-7kx-5@gated-at.bofh.it> <rqEtI-7kx-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, 22 Apr 2016, changbin.du@intel.com wrote: > From: "Du, Changbin" <changbin.du@intel.com> > > The object debugging infrastructure core provides some fixup callbacks > for the subsystem who use it. These callbacks are called from the debug > code whenever a problem in debug_object_init is detected. And > debugobjects core suppose them returns 1 when the fixup was successful, > otherwise 0. So the return type is boolean. > > A bad thing is that debug_object_fixup use the return value for > arithmetic operation. It confused me that what is the reall return What's bad about that? The fact that it's used for arithmethic operation or that it confused you? > Reading over the whole code, I found some place do use the return value > incorrectly(see next patch). So why use bool type instead? Patches which fix a problem need to come first not in the middle of a revamp series. > + bool (*fixup_init)(void *addr, enum debug_obj_state state); > + bool (*fixup_activate)(void *addr, enum debug_obj_state state); > + bool (*fixup_destroy)(void *addr, enum debug_obj_state state); > + bool (*fixup_free)(void *addr, enum debug_obj_state state); > + bool (*fixup_assert_init)(void *addr, enum debug_obj_state state); So this change will introduce a gazillion of compile warnings because the callbacks in the various usage sites are still having 'int' return type. Thanks, tglx
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/7] debugobjects: make fixup functions return bool instead of int changbin.du@intel.com - 2016-04-22 10:20 +0200
Re: [PATCH 1/7] debugobjects: make fixup functions return bool instead of int Thomas Gleixner <tglx@linutronix.de> - 2016-04-22 10:40 +0200
RE: [PATCH 1/7] debugobjects: make fixup functions return bool instead of int "Du, Changbin" <changbin.du@intel.com> - 2016-04-22 11:00 +0200
RE: [PATCH 1/7] debugobjects: make fixup functions return bool instead of int Thomas Gleixner <tglx@linutronix.de> - 2016-04-22 11:20 +0200
csiph-web