Subject: Re: [PATCH 02/27] HFI: Add HFI adapter control structure

From: Ben Hutchings <[email-masked]>
Date: Wed, 02 Mar 2011 22:44:30 +0000

On Wed, 2011-03-02 at 14:21 -0800, Stephen Hemminger wrote:
> On Wed,  2 Mar 2011 16:09:48 -0500
> [email-masked] wrote:
> 
> > diff --git a/drivers/net/hfi/core/Makefile b/drivers/net/hfi/core/Makefile
> > index 80790c6..6fe4e60 100644
> > --- a/drivers/net/hfi/core/Makefile
> > +++ b/drivers/net/hfi/core/Makefile
> > @@ -1,5 +1,6 @@
> >  #
> >  # Makefile for the HFI device driver for IBM eServer System p
> >  #
> > -hfi_core-objs:=	hfidd_init.o
> > +hfi_core-objs:=	hfidd_adpt.o \
> > +		hfidd_init.o
> >  obj-$(CONFIG_HFI) += hfi_core.o
> > diff --git a/drivers/net/hfi/core/hfidd_adpt.c b/drivers/net/hfi/core/hfidd_adpt.c
> > new file mode 100644
> > index 0000000..d64fa38
> > --- /dev/null
> > +++ b/drivers/net/hfi/core/hfidd_adpt.c
[...]
> > +void hfidd_free_adapter(struct hfidd_acs *p_acs)
> > +{
> > +	kfree(p_acs);
> > +	p_acs = NULL;
> > +	return;
> > +}
> 
> If these were not in a separate file the could be marked as static.

I assume they're intending to add some more interesting code here in the
next installment.

> Doing a return; on last line of a void function is considered poor
> style since it is unnecessary.

Assigning to a local variable just before returning is also silly.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.