Re: [PATCHv1] driver: misc: add Intel Stratix10 service layer driver

From: Greg KH
Date: Thu Jan 25 2018 - 11:58:24 EST


On Thu, Jan 25, 2018 at 10:39:04AM -0600, richard.gong@xxxxxxxxxxxxxxx wrote:
> +static LIST_HEAD(svc_cons);
> +static LIST_HEAD(svc_private_mem);
> +static DEFINE_MUTEX(svc_mutex);
> +
> +svc_invoke_fn *invoke_fn;

A global variable for a single .c file? No.

> +
> +struct intel_svc_chan *request_svc_channel_byname(
> + struct intel_svc_client *client, const char *name)
> +{
> + struct device *dev = client->dev;
> + struct intel_svc_controller *controller;
> + struct intel_svc_chan *chan;
> + unsigned long flag;
> + int i;
> +
> + chan = ERR_PTR(-EPROBE_DEFER);
> + controller = list_first_entry(&svc_cons,
> + struct intel_svc_controller, node);
> + for (i = 0; i < SVC_MAX_CHANNEL; i++) {
> + if (!strcmp(controller->chans[i].name, name)) {
> + chan = &controller->chans[i];
> + break;
> + }
> + }
> +
> + if (chan->scl || !try_module_get(controller->dev->driver->owner)) {
> + dev_dbg(dev, "%s: svc not free\n", __func__);
> + return ERR_PTR(-EBUSY);
> + }
> +
> + spin_lock_irqsave(&chan->lock, flag);
> + chan->scl = client;
> + spin_unlock_irqrestore(&chan->lock, flag);
> +
> + return chan;
> +}
> +EXPORT_SYMBOL_GPL(request_svc_channel_byname);

Exporting functions with no users? No.

Please fix up and make this stand-alone. Or, if you are going to have
framework that others use, then submit those others at the same time.

I'm stopping reviewing here, sorry.

Please fix up and resend.

Also, please get some signed-off-by: from some internal Intel people.
Don't rely on me to do this type of work when you have lots of good
people inside that could have told you all of this already. Without
other developer's sign-offs, I'm not going to look at future
submissions, sorry.

thanks,

greg k-h