Hirosh Dabui wrote: > On 01/26/2011 07:14 AM, Jon Povey wrote: >> [email protected] wrote:
>> >>> The bug implied the use of macros to access the relevant hardware >>> register e.g. the driver code used the macro like this: >>> 'gpio_reg_clear_bit(®->data_out, gpio)' >>> >>> But it has to be used like this: >>> 'gpio_reg_clear_bit(reg->data_out, gpio)'. >>> >> Could the macro be made into an inline function so it can do >> type-checking to avoid/catch this in future? > > Hello Jon, > > if you do inline from it, it will not crash, the behaviour is the > same. Also i have not seen a compiler warning.. The point is, if you make it an inline function instead of a macro, the compiler can check that you pass the appropriate type instead of a pointer to it. So it would give compiler warnings if you pass the wrong thing, where at the moment it silently allows a bug. -- Jon Povey [email protected] Racelogic is a limited company registered in England. Registered number 2743719 . Registered Office Unit 10, Swan Business Centre, Osier Way, Buckingham, Bucks, MK18 1TB . The information contained in this electronic mail transmission is intended by Racelogic Ltd for the use of the named individual or entity to which it is directed and may contain information that is confidential or privileged. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email so that the sender's address records can be corrected. The views expressed by the sender of this communication do not necessarily represent those of Racelogic Ltd. Please note that Racelogic reserves the right to monitor e-mail communications passing through its network _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
