[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <X6p7+nXa/H4uqj0+@kroah.com>
Date: Tue, 10 Nov 2020 12:39:38 +0100
From: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
To: Peter Chen <peter.chen@....com>
Cc: Pawel Laszczak <pawell@...ence.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"balbi@...nel.org" <balbi@...nel.org>,
"colin.king@...onical.com" <colin.king@...onical.com>,
"rogerq@...com" <rogerq@...com>, Rahul Kumar <kurahul@...ence.com>,
"nsekhar@...com" <nsekhar@...com>
Subject: Re: [PATCH v2 03/10] usb: cdns3: Moves reusable code to separate
module
On Tue, Nov 10, 2020 at 11:21:22AM +0000, Peter Chen wrote:
> On 20-11-10 09:20:54, Pawel Laszczak wrote:
> > Hi,
> >
> > >>
> > >> int cdns3_hw_role_switch(struct cdns3 *cdns);
> > >> -int cdns3_init(struct cdns3 *cdns);
> > >> -int cdns3_remove(struct cdns3 *cdns);
> > >> +extern int cdns3_init(struct cdns3 *cdns);
> > >> +extern int cdns3_remove(struct cdns3 *cdns);
> > >
> > >Why add "extern" here and below?
> > >
> >
> > These functions are the API between cdnsp and cdns3 modules.
> > It's looks like a common approach in kernel.
> > Many or even most of API function in kernel has "extern".
> >
>
> Even you have not written "extern" keyword, the "extern" is
> added implicitly by compiler. Usually, we use "extern" for variable
> or the function is defined at assembly. You could see some
> "extern" keyword use cases at include/linux/device.h.
We are moving away from using this keyword for functions now, if at all
possible please. Only use it for variables, I think checkpatch now
catches it as well.
thanks,
greg k-h
Powered by blists - more mailing lists