Linux-i3c Archive on lore.kernel.org
 help / color / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Vitor Soares <Vitor.Soares@synopsys.com>
Cc: Joao.Pinto@synopsys.com, arnd@arndb.de, wsa@the-dreams.de,
	bbrezillon@kernel.org, linux-kernel@vger.kernel.org,
	broonie@kernel.org, linux-i3c@lists.infradead.org
Subject: Re: [RFC 5/5] i3c: add i3cdev module to expose i3c dev in /dev
Date: Thu, 12 Dec 2019 15:46:27 +0100
Message-ID: <20191212144627.GC1668196@kroah.com> (raw)
In-Reply-To: <f9f20eaf900ed5629dd3d824bc1e90c7e6b4a371.1575977795.git.vitor.soares@synopsys.com>

On Tue, Dec 10, 2019 at 04:37:33PM +0100, Vitor Soares wrote:
> +static struct i3cdev_data *i3cdev_get_by_minor(unsigned int minor)

Why?  Why not just embed the structure in the cdev if you really need
it?

> +static struct i3cdev_data *get_free_i3cdev(struct i3c_device *i3c)
> +{
> +	struct i3cdev_data *i3cdev;
> +	unsigned long minor;
> +
> +	minor = find_first_zero_bit(minors, N_I3C_MINORS);

No locking, fun!!!

:(

Why not use an idr instead, that is what it is there for.  Don't try to
roll your own.

thanks,

greg k-h

_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

      parent reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 15:37 [RFC 0/5] Introduce i3c device userspace interface Vitor Soares
2019-12-10 15:37 ` [RFC 1/5] i3c: master: export i3c_masterdev_type Vitor Soares
2019-12-10 15:37 ` [RFC 2/5] i3c: master: export i3c_bus_type symbol Vitor Soares
2019-12-10 15:37 ` [RFC 3/5] i3c: device: expose transfer strutures to uapi Vitor Soares
2019-12-12 14:42   ` Greg KH
2019-12-12 14:48     ` Vitor Soares
2019-12-10 15:37 ` [RFC 4/5] i3c: master: add i3c_for_each_dev helper Vitor Soares
2019-12-10 15:37 ` [RFC 5/5] i3c: add i3cdev module to expose i3c dev in /dev Vitor Soares
2019-12-10 17:51   ` Arnd Bergmann
2019-12-10 19:15     ` Vitor Soares
2019-12-10 19:37       ` Arnd Bergmann
2019-12-11 15:07         ` Vitor Soares
2019-12-11 15:33           ` Arnd Bergmann
2019-12-20 12:39     ` Vitor Soares
2019-12-12 14:44   ` Greg KH
2019-12-12 14:56     ` Vitor Soares
2019-12-12 16:00       ` Greg KH
2019-12-12 17:25         ` Vitor Soares
2019-12-12 17:32           ` Greg KH
2019-12-12 14:46   ` Greg KH [this message]

Reply instructions:

You may reply publically 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=20191212144627.GC1668196@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Joao.Pinto@synopsys.com \
    --cc=Vitor.Soares@synopsys.com \
    --cc=arnd@arndb.de \
    --cc=bbrezillon@kernel.org \
    --cc=broonie@kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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

Linux-i3c Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-i3c/0 linux-i3c/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-i3c linux-i3c/ https://lore.kernel.org/linux-i3c \
		linux-i3c@lists.infradead.org
	public-inbox-index linux-i3c

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-i3c


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git