A tale of two data-corruption bugs
A tale of two data-corruption bugs
Posted May 25, 2015 17:09 UTC (Mon) by josh (subscriber, #17465)In reply to: A tale of two data-corruption bugs by xtifr
Parent article: A tale of two data-corruption bugs
Nope. This is exactly why the Linux kernel has a stated policy of not caring about out-of-tree drivers. Just change the macro to a function, convert all callers in the kernel, and delete the old macro.
> A more reasonable approach might be to create an new static inline with a new name (e.g. sector_divide)
Agreed, changing the name makes it easier to detect callers and avoid reintroducing new callers with that expectation (such as from patches in flight).
> and then either keep the current name for a macro that calls the inline and then does the extra assignment, or add a new macro with an all-caps name, and make the current name into a macro that uses #error to inform people that their code needs to be updated.
No macro needs to exist, nor does the kernel keep around compatibility interfaces that nothing in the kernel uses. Also, macros can't call #error, but there's a simpler solution to produce a compiler error for code that needs updating: just delete the macro, and attempted callers will get a compile time error saying sector_div does not exist.
