From: "Tony Huang 黃懷厚" <tony.huang@sunplus.com>
To: Greg KH <gregkh@linuxfoundation.org>,
Tony Huang <tonyhuang.sunplus@gmail.com>
Cc: "derek.kiernan@xilinx.com" <derek.kiernan@xilinx.com>,
"dragan.cvetic@xilinx.com" <dragan.cvetic@xilinx.com>,
"arnd@arndb.de" <arnd@arndb.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"Wells Lu 呂芳騰" <wells.lu@sunplus.com>
Subject: RE: [PATCH v2 2/2] misc: Add iop driver for Sunplus SP7021
Date: Mon, 6 Dec 2021 03:50:03 +0000 [thread overview]
Message-ID: <4bd765590e3e4a5da2cf79be921bac5b@sphcmbx02.sunplus.com.tw> (raw)
In-Reply-To: <Yanzu7/J75n/OCUY@kroah.com>
Dear Greg KH:
> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Friday, December 3, 2021 6:39 PM
> To: Tony Huang <tonyhuang.sunplus@gmail.com>
> Cc: derek.kiernan@xilinx.com; dragan.cvetic@xilinx.com; arnd@arndb.de;
> linux-kernel@vger.kernel.org; robh+dt@kernel.org; devicetree@vger.kernel.org;
> Wells Lu 呂芳騰 <wells.lu@sunplus.com>; Tony Huang 黃懷厚
> <tony.huang@sunplus.com>
> Subject: Re: [PATCH v2 2/2] misc: Add iop driver for Sunplus SP7021
>
> On Fri, Dec 03, 2021 at 11:48:45AM +0800, Tony Huang wrote:
> > +#define NORMAL_CODE_MAX_SIZE 0X1000
> > +#define STANDBY_CODE_MAX_SIZE 0x4000
> > +unsigned char iop_normal_code[NORMAL_CODE_MAX_SIZE];
> > +unsigned char iop_standby_code[STANDBY_CODE_MAX_SIZE];
>
> Please make your local variables static so that yhou do not polute the kernel's
> global symbol table.
>
I will modify it.
> > +/*
> > +---------------------------------------------------------------------
> > +------------------------- */ resource_size_t SP_IOP_RESERVE_BASE;
> > +resource_size_t SP_IOP_RESERVE_SIZE;
> > +/*
> > +---------------------------------------------------------------------
> > +------------------------- */
>
> Again, static.
>
> And why the odd comment lines?
>
I will remove it.
> And those are not good variable names.
>
> > +struct sp_iop {
> > + struct miscdevice dev; // iop device
> > + struct mutex write_lock;
> > + void __iomem *iop_regs;
> > + void __iomem *pmc_regs;
> > + void __iomem *moon0_regs;
> > + int irq;
> > +};
> >
> +/**************************************************************
> ***
> > + * G L O B A L D A T A
> > +
> ****************************************************************
> **/
>
> Global where? What about the ones above? :)
>
I will remove it.
> > +static struct sp_iop *iop;
>
> Why do you think you only have one device in the system? Please do not use
> a single variable like this. It is easy to make your driver handle an unlimited
> number of devices just as easy as to handle 1 device.
> Please do that instead and hang your device-specific data off of the correct
> data structures that the driver core gives you.
>
I will modify it.
> > +
> > +void iop_normal_mode(void)
>
> Did you run sparse on this code? Please do so.
>
> Also, no need for a .h file for a driver that only has one .c file.
>
I need to keep sunplus_iop.h. Other files will use sp_iop_platform_driver_poweroff(void) in poweroff flow.
> thanks,
>
> greg k-h
next prev parent reply other threads:[~2021-12-06 3:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 3:48 [PATCH v2 0/2] " Tony Huang
2021-12-03 3:48 ` [PATCH v2 1/2] dt-binding: misc: Add iop yaml file " Tony Huang
2021-12-03 3:48 ` [PATCH v2 2/2] misc: Add iop driver " Tony Huang
2021-12-03 9:12 ` kernel test robot
2021-12-03 10:38 ` Greg KH
2021-12-06 3:50 ` Tony Huang 黃懷厚 [this message]
2021-12-06 7:04 ` Greg KH
2021-12-06 15:02 ` Tony Huang 黃懷厚
2021-12-03 10:39 ` Greg KH
2021-12-06 6:48 ` Tony Huang 黃懷厚
2021-12-06 8:06 ` Greg KH
2021-12-06 8:22 ` Tony Huang 黃懷厚
2021-12-06 8:29 ` Greg KH
2021-12-03 10:39 ` Greg KH
2021-12-03 12:17 ` Arnd Bergmann
2021-12-06 3:42 ` Tony Huang 黃懷厚
2021-12-06 8:04 ` Arnd Bergmann
2021-12-06 8:23 ` Tony Huang 黃懷厚
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=4bd765590e3e4a5da2cf79be921bac5b@sphcmbx02.sunplus.com.tw \
--to=tony.huang@sunplus.com \
--cc=arnd@arndb.de \
--cc=derek.kiernan@xilinx.com \
--cc=devicetree@vger.kernel.org \
--cc=dragan.cvetic@xilinx.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=tonyhuang.sunplus@gmail.com \
--cc=wells.lu@sunplus.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®