public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Olaf Dietsche <olaf+list.linux-kernel@olafdietsche.de>
To: Martin Stoilov <mstoilov@odesys.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kobject_add unreachable code
Date: Fri, 29 Dec 2006 14:50:44 +0100	[thread overview]
Message-ID: <87k60azu8b.fsf@goat.bogus.local> (raw)
In-Reply-To: <4594BA09.1080509@odesys.com> (Martin Stoilov's message of "Thu, 28 Dec 2006 22:47:37 -0800")

Martin Stoilov <mstoilov@odesys.com> writes:

> The following code in kobject_add
>     if (!kobj->k_name)
>         kobj->k_name = kobj->name;
>     if (!kobj->k_name) {
>         pr_debug("kobject attempted to be registered with no name!\n");
>         WARN_ON(1);
>         return -EINVAL;
>     }
>
> doesn't look right to me. The second 'if' statement looks useless after
> the assignment in the first one. May be it was meant to be like:
> if (!*kobj->k_name)

The second test is true, if kobj->name is NULL as well.

Regards, Olaf.

  reply	other threads:[~2006-12-29 13:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-29  6:47 kobject_add unreachable code Martin Stoilov
2006-12-29 13:50 ` Olaf Dietsche [this message]
2006-12-29 17:15   ` Martin Stoilov
2006-12-29 17:36     ` Martin Stoilov
2006-12-29 17:45       ` Jan Engelhardt
2006-12-29 20:49       ` Olaf Dietsche

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=87k60azu8b.fsf@goat.bogus.local \
    --to=olaf+list.linux-kernel@olafdietsche.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mstoilov@odesys.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox