All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Greg KH <greg@kroah.com>
Cc: Garrit Franke <garritfranke@gmail.com>, kernelnewbies@kernelnewbies.org
Subject: Re: What's tha KOBJ_MAX action used for?
Date: Mon, 13 Jul 2020 22:15:23 -0400	[thread overview]
Message-ID: <431434.1594692923@turing-police> (raw)
In-Reply-To: <20200713123523.GB3092589@kroah.com>


[-- Attachment #1.1: Type: text/plain, Size: 840 bytes --]

On Mon, 13 Jul 2020 14:35:23 +0200, Greg KH said:
> On Mon, Jul 13, 2020 at 01:17:25PM +0200, Garrit Franke wrote:
> > Hi all,
> >
> > I was wondering, what the KOBJ_MAX action in the kobject.h file does.
> > It is self explainatory what KOBJ_ADD, KOBJ_REMOVE etc. are used for, but KOBJ_MAX puzzles me.

> > Can it maybe even be removed?
>
> Maybe it can, try it and see!

I suspect that this line:
        for (action = 0; action < ARRAY_SIZE(kobject_actions); action++) {
in lib/kobject_uenvent.c:kobject_action_type()  combined with the fact that
kobject_actions[] does *not* actually match the enum regardless of the comment
above it, result in it being superfluous.

Figuring out why is left as an exercise for the student.

Oh, and if I had a dollar for every time I've been surprised by creative abuse of
the cpp ## operator... :)


[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2020-07-14  2:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 11:17 What's tha KOBJ_MAX action used for? Garrit Franke
2020-07-13 12:35 ` Greg KH
2020-07-14  2:15   ` Valdis Klētnieks [this message]
2020-07-14 14:36     ` Garrit Franke
2020-07-14 16:12       ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=431434.1594692923@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=garritfranke@gmail.com \
    --cc=greg@kroah.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.