public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Carlos Chinea <carlos.chinea@nokia.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: HSI: hsi: Introducing HSI framework
Date: Mon, 2 Apr 2012 16:41:34 -0700	[thread overview]
Message-ID: <20120402234134.GA18183@kroah.com> (raw)
In-Reply-To: <20120402165607.2B2D47C0069@ra.kernel.org>

On Mon, Apr 02, 2012 at 04:56:07PM +0000, Linux Kernel Mailing List wrote:
> +static void hsi_controller_release(struct device *dev __maybe_unused)
> +{
> +}
> +
> +static void hsi_port_release(struct device *dev __maybe_unused)
> +{
> +}

As per the documentation in the kernel tree, I get to mock you
mercilessly for doing something as foolish as this.  You are not smarter
than the kernel and don't think that you got rid of the kernel warning
properly by doing this.  Do you think that I wrote that code for no good
reason?  The kernel was being nice and telling you what you did wrong,
don't try to fake it out, it's smarter than you are here.

I also get to tell you that you need to fix this up right now, BEFORE
3.4 comes out.

And no, just because you created static struct devices, this is not ok,
DO NOT create static struct devices, that's foolish, and even worse, not
something you should be doing in the first place, create a real
structure, and put a struct device within it please.

And people wonder why kernel maintainers are grumpy.

> +/**
> + * struct hsi_client - HSI client attached to an HSI port
> + * @device: Driver model representation of the device
> + * @tx_cfg: HSI TX configuration
> + * @rx_cfg: HSI RX configuration
> + * @hsi_start_rx: Called after incoming wake line goes high
> + * @hsi_stop_rx: Called after incoming wake line goes low
> + */
> +struct hsi_client {
> +	struct device		device;
> +	struct hsi_config	tx_cfg;
> +	struct hsi_config	rx_cfg;
> +	void			(*hsi_start_rx)(struct hsi_client *cl);
> +	void			(*hsi_stop_rx)(struct hsi_client *cl);
> +	/* private: */
> +	unsigned int		pclaimed:1;
> +	struct list_head	link;
> +};

Why do you need another list_head in here?  What's wrong with using the
device iteration functions that are written for you to use?  Don't put
the structure on yet-another-list, use what is given to you please, as
odds are, you will traverse this list incorrectly (trust me...)

ugh,

greg k-h

       reply	other threads:[~2012-04-02 23:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120402165607.2B2D47C0069@ra.kernel.org>
2012-04-02 23:41 ` Greg KH [this message]
2012-04-03 14:49   ` HSI: hsi: Introducing HSI framework Carlos Chinea
2012-04-03 15:18     ` ext Greg KH
2012-04-03 17:51       ` Carlos Chinea

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=20120402234134.GA18183@kroah.com \
    --to=greg@kroah.com \
    --cc=carlos.chinea@nokia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox