Re: [PATCH V2 1/9] jump_label: Add for_each_label_entry helper

From: Borislav Petkov
Date: Tue Dec 18 2018 - 16:19:34 EST


On Tue, Dec 18, 2018 at 05:46:30PM +0100, Daniel Bristot de Oliveira wrote:
> This patch adds the helper:
> for_each_label_entry(key, entry, stop)
>
> For the "for each jump label entry" for defined as:
> for (; (entry < stop) && (jump_entry_key(entry) == key); entry++)
>
> Simplifying the reading and usage.

Please avoid writing "This patch" in a commit message and also what it
does - that should be obvious. Instead say something like:

"Add a helper macro to make jump entry iteration code more readable."

or so.

But then, IINM, this macro is being used only once. Isn't that a bit too
much? I mean, you could just as well do:

# iterate over each jump entry
for (; (entry < stop) && (jump_entry_key(entry) == key); entry++) {

and have it even more readable without introducing macro which is not
going to be used elsewhere. Or is it going to...?

Thx.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.