Never put anything in a BUG_ON that would lead to incorrect code if BUG_ON were modified to be a no-op. So, in BUG_ON(expression) expression should never have side-effects. Some modules have traditionally put all the EXPORT_SYMBOL()'s together in a single file. But lately people seem to prefer to locate them in the same place as the function definition; this has the benefit that you're less likely to allow the function and the export to get out of sync.