Yes! This is the way to go.
If you get messages from the kernel - then __FILE__ and __LINE__ is the easiest way to get people grok the source.
People interested in looking up numbers on a list are probably building their own kernel anyway.
Using __FILE__ and __LINE__ will make sure the references are updated with changes to the kernel.
(and the source is the real documentation anyway :-)
Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds