Re: linux kernel coding style and checkpatch.pl script

2020-03-26 Thread Konstantin Andreev
Valdis Klētnieks, 26 Mar 2020 07:13 MSK: Don't split literal strings, it means that grepping the source tree for "already registered" fails. Making grep for a string work is more important than shutting up checkpatch. On Thu, Mar 26, 2020 at 02:36:23PM +0300, Konstantin Andreev w

Re: linux kernel coding style and checkpatch.pl script

2020-03-26 Thread Konstantin Andreev
Valdis Klētnieks, 26 Mar 2020 07:13 MSK: To borrow from Pirates of the Carribean, "They're not exactly rules, they're more like... suggestions..." Don't split literal strings, it means that grepping the source tree for "already registered" fails. Making grep for a string work is more

Re: How to get the preprocessor output as part of the compilation process?

2019-12-10 Thread Konstantin Andreev
or indirectly, there's already specialized tools for doing that sort of thing, such as 'cxref'. Konstantin Andreev, 09 Dec 2019 13:10 MSK: The universal approach that always works in this and many similar cases is just to replace the instrumented binary by your interception shell script. E.g

Re: How to get the preprocessor output as part of the compilation process?

2019-12-09 Thread Konstantin Andreev
Hi, Frank. The universal approach that always works in this and many similar cases is just to replace the instrumented binary by your interception shell script. E.g. rename gcc to gcc.hide (generally, moving into another location may not work) and setup 'gcc' script that does what you want:

Re: Switch a fd between blocking and non-blocking mode?

2019-11-13 Thread Konstantin Andreev
filesystem in the kernel tree. ->check_flags() is used by nfs only, and just checks the flags, as it's name suggests. Regards, Konstantin Andreev Jeffrey Walton, 12 Nov 2019 02:21 MSK: I have one more question related to my problem of my program losing data. I want to ensure I'm not using an

Re: Are there global constructors in the Linux kernel?

2019-10-09 Thread Konstantin Andreev
Hi, Cristian. There are, a kinda of ... kernel/taskstats.c: | late_initcall(taskstats_init); kernel/rcu/update.c: | early_initcall(check_cpu_stall_init); There is a whole set of macros STAGE_initcall() in include/linux/init.h Arguments to these macros invokations are accounted and called by

Re[3]: internal / external include files

2019-07-24 Thread Konstantin Andreev
Hi, Martin. The [$KERNEL_ROOT/include/uapi/linux/stddef.h] you are talking about is just a few lines: | #include | | #ifndef __always_inline | #define __always_inline inline | #endif it turns into | #ifndef __always_inline | #define __always_inline inline | #endif after [make

How does [=rcu_dereference_protected(ptr, 1)] differ from simple [=ptr]?

2019-05-15 Thread Konstantin Andreev
Hi, according to the documentation, [rcu_dereference_protected( ptr, condition )] is the "update-side primitive" that reads the ptr, "allowing the code to verify that the required locks really are held". Given that, I expect that literal `1' as `condition' would imply just "reading the ptr".