public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Peng Hao <peng.hao2@zte.com.cn>
Cc: arnd@arndb.de, andy.shevchenko@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6]  misc/pvpanic: Add pvpanic driver framework
Date: Tue, 22 Jan 2019 10:37:32 +0100	[thread overview]
Message-ID: <20190122093732.GA29657@kroah.com> (raw)
In-Reply-To: <1548098711-52497-2-git-send-email-peng.hao2@zte.com.cn>

On Tue, Jan 22, 2019 at 03:25:07AM +0800, Peng Hao wrote:
> Add pvpanic driver framework.
> 

You need a lot more description of what you did here than this, as I can
not understand from this text, what the patch does, or more importantly,
why it is doing this, at all.



> Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
> ---
>  drivers/misc/pvpanic/pvpanic.c | 171 ++++++++++-------------------------------
>  1 file changed, 39 insertions(+), 132 deletions(-)
> 
> diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c
> index 595ac06..6380540 100644
> --- a/drivers/misc/pvpanic/pvpanic.c
> +++ b/drivers/misc/pvpanic/pvpanic.c
> @@ -8,15 +8,20 @@
>  
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>  
> -#include <linux/acpi.h>
> +#include <linux/io.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> -#include <linux/of.h>
> -#include <linux/of_address.h>
>  #include <linux/platform_device.h>
>  #include <linux/types.h>
>  
> -static void __iomem *base;
> +static struct {
> +	struct platform_device *pdev;
> +	void __iomem *base;
> +	bool is_ioport;
> +} pvpanic_data = {
> +	.pdev = NULL,
> +	.is_ioport = false,

You do not need to initialize variables to 0 specifically like this.

> +};
>  
>  #define PVPANIC_PANICKED        (1 << 0)
>  
> @@ -27,7 +32,7 @@
>  static void
>  pvpanic_send_event(unsigned int event)
>  {
> -	iowrite8(event, base);
> +	iowrite8(event, pvpanic_data.base);

Why did you convert a single global variable into a single global
structure?  Why not, if you really need to pass this value around, do
that at the same time as you will end up touching these same functions
again, right?

thanks,

greg k-h

  reply	other threads:[~2019-01-22  9:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21 19:25 [PATCH 1/6] misc/pvpanic : preparing for pvpanic driver framework Peng Hao
2019-01-21 19:25 ` [PATCH 2/6] misc/pvpanic: Add " Peng Hao
2019-01-22  9:37   ` Greg KH [this message]
2019-01-21 19:25 ` [PATCH 3/6] misc/pvpanic: add API for " Peng Hao
2019-01-22  9:38   ` Greg KH
2019-01-21 19:25 ` [PATCH 4/6] misc/pvpanic : add pvpanic acpi driver Peng Hao
2019-01-22  9:40   ` Greg KH
2019-01-21 19:25 ` [PATCH 5/6] misc/pvpanic: add pvpanic mmio driver Peng Hao
2019-01-22  9:40   ` Greg KH
2019-01-21 19:25 ` [PATCH 6/6] misc/pvpanic : add pvpanic pci driver Peng Hao

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=20190122093732.GA29657@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.hao2@zte.com.cn \
    /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