driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Christian Gromm <christian.gromm@microchip.com>
Cc: driverdev-devel@linuxdriverproject.org
Subject: Re: [PATCH RFC v3 6/9] staging: most: change storage class of struct mostcore
Date: Wed, 15 Jan 2020 13:19:29 +0100	[thread overview]
Message-ID: <20200115121929.GC3394319@kroah.com> (raw)
In-Reply-To: <1579017478-3339-7-git-send-email-christian.gromm@microchip.com>

On Tue, Jan 14, 2020 at 04:57:55PM +0100, Christian Gromm wrote:
> This patch allocated the mostcore structure dynamically and releases
> the memory in the dedicated release function.
> 
> Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
> ---
> v3:
> 	This patch has been added to the series.
> 
>  drivers/staging/most/core.c | 110 ++++++++++++++++++++++++--------------------
>  1 file changed, 59 insertions(+), 51 deletions(-)
> 
> diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
> index 4f60c09..92303d0 100644
> --- a/drivers/staging/most/core.c
> +++ b/drivers/staging/most/core.c
> @@ -33,9 +33,10 @@ static struct mostcore {
>  	struct device_driver drv;
>  	struct bus_type bus;
>  	struct list_head comp_list;
> -} mc;
> +} *mc;

Why do you need one single global variable for all of this?  Shouldn't
there be one per "bus controller" that you have in the system?  No other
driver/bus subsystem has a single global state for everything, why is
this unique?

It's good you are making this dynamic, but I would go further and not
make there be one at all, this state should be per-bus.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2020-01-15 12:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 15:57 [PATCH RFC v3 0/9] staging: most: move core module out of staging Christian Gromm
2020-01-14 15:57 ` [PATCH RFC v3 1/9] staging: most: core: fix date in file comment Christian Gromm
2020-01-14 15:57 ` [PATCH RFC v3 2/9] staging: most: core: use dev_* function for logging Christian Gromm
2020-01-14 15:57 ` [PATCH RFC v3 3/9] staging: most: core: remove noisy log messages Christian Gromm
2020-01-14 15:57 ` [PATCH RFC v3 4/9] staging: most: move interface dev to private section Christian Gromm
2020-01-15 12:17   ` Greg KH
2020-01-15 16:04     ` Christian.Gromm
2020-01-14 15:57 ` [PATCH RFC v3 5/9] staging: most: usb: check for NULL device Christian Gromm
2020-01-15 12:18   ` Greg KH
2020-01-15 15:32     ` Christian.Gromm
2020-01-15 15:37       ` Greg KH
2020-01-14 15:57 ` [PATCH RFC v3 6/9] staging: most: change storage class of struct mostcore Christian Gromm
2020-01-15 12:19   ` Greg KH [this message]
2020-01-14 15:57 ` [PATCH RFC v3 7/9] staging: most: move core files out of the staging area Christian Gromm
2020-01-14 15:57 ` [PATCH RFC v3 8/9] staging: most: Documentation: update ABI description Christian Gromm
2020-01-14 15:57 ` [PATCH RFC v3 9/9] staging: most: Documentation: move ABI description files out of staging area Christian Gromm
2020-01-15 12:20 ` [PATCH RFC v3 0/9] staging: most: move core module out of staging Greg KH

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=20200115121929.GC3394319@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=christian.gromm@microchip.com \
    --cc=driverdev-devel@linuxdriverproject.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;
as well as URLs for NNTP newsgroup(s).