All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhongping Tan (谭中平)" <Zhongping.Tan@spreadtrum.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Orson Zhai (翟京)" <Orson.Zhai@spreadtrum.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: RE: 答复: [RFC PATCH] char: misc: Init misc->list in a safe way
Date: Tue, 27 Jun 2017 02:02:13 +0000	[thread overview]
Message-ID: <8f919e212d5149e286422d58a5732356@SHMBX02.spreadtrum.com> (raw)
In-Reply-To: <CAK8P3a33eAeavbupgh488p7JQdayJ3VLENJOeLgbmZY1mSXjFQ@mail.gmail.com>

Ok, firstly we need to discuss the list usage, for list head we need do initialization, but for list node we don't need initialization at all. And for misc_list head, we use LIST_HEAD to define and initialize it. So I don't know why we put INIT_LIST_HEAD(&misc->list) in function misc_register, any bugs when without it?

-----Original Message-----
From: arndbergmann@gmail.com [mailto:arndbergmann@gmail.com] On Behalf Of Arnd Bergmann
Sent: Monday, June 26, 2017 10:10 PM
To: Zhongping Tan (谭中平)
Cc: Orson Zhai (翟京); Greg Kroah-Hartman; Linux Kernel Mailing List
Subject: Re: 答复: [RFC PATCH] char: misc: Init misc->list in a safe way

On Mon, Jun 26, 2017 at 4:00 PM, Zhongping Tan (谭中平)
<Zhongping.Tan@spreadtrum.com> wrote:
> hi Arnd:
> Another way to describe this question,  misc_register shouldn't modify 
> the member of the miscdevice especially when return error. Let the caller to ensure the list have been initialized, or when return error, please don't  initialize the list.

Why not? The caller should only initialize a couple of fields in the structure (name, minor, fops, ...) not never even look at the list entry, which is really internal to the misc_register()/misc_unregister().

       Arnd

  reply	other threads:[~2017-06-27  2:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26  9:31 [RFC PATCH] char: misc: Init misc->list in a safe way Orson Zhai
2017-06-26 10:02 ` Arnd Bergmann
2017-06-26 11:48   ` Zhongping Tan (谭中平)
2017-06-26 12:28     ` Arnd Bergmann
     [not found]       ` <ca76fa84d77449bf84c2f3ddf29048a0@SHMBX02.spreadtrum.com>
2017-06-26 14:10         ` 答复: " Arnd Bergmann
2017-06-27  2:02           ` Zhongping Tan (谭中平) [this message]
2017-06-27  6:29             ` Greg Kroah-Hartman
2017-06-28  1:54               ` Orson Zhai
2017-06-28  5:18                 ` Greg Kroah-Hartman
2017-06-28 10:34                   ` Arnd Bergmann
2017-06-28 11:21                     ` Greg Kroah-Hartman
2017-06-29  6:54                       ` Chunyan Zhang
2017-06-29  7:03                         ` Greg Kroah-Hartman
2017-06-29  7:30                           ` Chunyan Zhang

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=8f919e212d5149e286422d58a5732356@SHMBX02.spreadtrum.com \
    --to=zhongping.tan@spreadtrum.com \
    --cc=Orson.Zhai@spreadtrum.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.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 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.