All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Todd Poynor <toddpoynor@gmail.com>
Cc: Rob Springer <rspringer@google.com>,
	John Joseph <jnjoseph@google.com>,
	Ben Chan <benchan@chromium.org>,
	devel@driverdev.osuosl.org, Todd Poynor <toddpoynor@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/10] staging: gasket: save struct device for a gasket device
Date: Fri, 27 Jul 2018 17:08:55 +0200	[thread overview]
Message-ID: <20180727150855.GB3713@kroah.com> (raw)
In-Reply-To: <20180727030737.231268-2-toddpoynor@gmail.com>

On Thu, Jul 26, 2018 at 08:07:28PM -0700, Todd Poynor wrote:
> From: Todd Poynor <toddpoynor@google.com>
> 
> Save the struct device pointer to a gasket device in gasket's metadata,
> to facilitate use of standard logging calls and in anticipation of
> non-PCI gasket devices in the future.
> 
> Signed-off-by: Todd Poynor <toddpoynor@google.com>
> ---
>  drivers/staging/gasket/gasket_core.c | 5 +++--
>  drivers/staging/gasket/gasket_core.h | 3 +++
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
> index 732218773c3c6..e8f3b021c20d1 100644
> --- a/drivers/staging/gasket/gasket_core.c
> +++ b/drivers/staging/gasket/gasket_core.c
> @@ -450,6 +450,7 @@ static int gasket_alloc_dev(
>  	gasket_dev->internal_desc = internal_desc;
>  	gasket_dev->dev_idx = dev_idx;
>  	snprintf(gasket_dev->kobj_name, GASKET_NAME_MAX, "%s", kobj_name);
> +	gasket_dev->dev = parent;

Normally when saving off a pointer to an object that you reference later
on, and that you rely on, you need to grab a reference to it, otherwise
it may disappear at any point in time.

However this whole "wrap the pci layer" nonsense is a total mess with
the lifetime rules of devices, so it's probably the least of your
worries....

As long as you know you will have to fix that crud up, and what you are
doing here will bite you if you do not do it right, that's fine with
me...

thanks,

greg k-h

  reply	other threads:[~2018-07-27 15:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27  3:07 [PATCH 00/10] staging: gasket: logging cleanups Todd Poynor
2018-07-27  3:07 ` [PATCH 01/10] staging: gasket: save struct device for a gasket device Todd Poynor
2018-07-27 15:08   ` Greg Kroah-Hartman [this message]
2018-07-27 17:02     ` Todd Poynor
2018-07-27  3:07 ` [PATCH 02/10] staging: gasket: core: convert to standard logging Todd Poynor
2018-07-27  3:07 ` [PATCH 03/10] staging: gasket: interrupt: " Todd Poynor
2018-07-27  3:07 ` [PATCH 04/10] staging: gasket: ioctl: " Todd Poynor
2018-07-27  3:07 ` [PATCH 05/10] staging: gasket: page table: " Todd Poynor
2018-07-27  3:07 ` [PATCH 06/10] staging: gasket: sysfs: " Todd Poynor
2018-07-27 15:07   ` Greg Kroah-Hartman
2018-07-27 17:00     ` Todd Poynor
2018-07-27  3:07 ` [PATCH 07/10] staging: gasket: apex: " Todd Poynor
2018-07-27  3:07 ` [PATCH 08/10] staging: gasket: remove gasket logging header Todd Poynor
2018-07-27  3:07 ` [PATCH 09/10] staging: gasket: TODO: remove entry for convert to standard logging Todd Poynor
2018-07-27  3:07 ` [PATCH 10/10] staging: gasket: don't print device addresses as kernel pointers Todd Poynor

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=20180727150855.GB3713@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=benchan@chromium.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=jnjoseph@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rspringer@google.com \
    --cc=toddpoynor@gmail.com \
    --cc=toddpoynor@google.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 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.