On Tue, Oct 10, 2017 at 07:14:53PM +0000, mario.limoncie...@dell.com wrote:
> > -----Original Message-----
> > From: Pali Rohár [mailto:pali.ro...@gmail.com]
> > Sent: Tuesday, October 10, 2017 11:01 AM
> > To: Limonciello, Mario <mario_limoncie...@dell.com>
> > Cc: dvh...@infradead.org; Andy Shevchenko <andy.shevche...@gmail.com>;
> > LKML <linux-kernel@vger.kernel.org>; platform-driver-...@vger.kernel.org;
> > Andy Lutomirski <l...@kernel.org>; quasi...@google.com; r...@rjwysocki.net;
> > mj...@google.com; h...@lst.de; Greg KH <g...@kroah.com>
> > Subject: Re: [PATCH v6 09/14] platform/x86: dell-smbios: Introduce 
> > dispatcher for
> > SMM calls
> > 
> > On Monday 09 October 2017 17:51:47 Mario Limonciello wrote:
> > >  static void dell_rfkill_query(struct rfkill *rfkill, void *data)
> > >  {
> > > - struct calling_interface_buffer *buffer;
> > >   int radio = ((unsigned long)data & 0xF);
> > >   int hwswitch;
> > >   int status;
> > >   int ret;
> > >
> > > - buffer = dell_smbios_get_buffer();
> > > -
> > > - dell_smbios_send_request(17, 11);
> > > - ret = buffer->output[0];
> > > + ret = dell_send_request(17, 11, 0, 0, 0, 0);
> > 
> > Basically I do not like function which takes ten numeric parameters.
> > Before in this code there was just function with 2 parameters, now there
> > are lot of zero parameters, without information what which parameter
> > means...
> > 
> 
> In an earlier patch Darren wanted to keep dell_send_request around and
> remove code that was duplicated multiple times to clear buffer, set arguments 
> etc,
> can you please comment on what exactly you would prefer?

There was a lot of boilerplate, and I think I suggested keeping the same
interface of dell_send_request(class, select) (with 2 arguments) rather than
replacing it with 3 or 4 lines of allocating and populating the buffer with the
same values.

I see you've updated this in v7 with two calls. I'd call that a reasonable
compromise.

> 
> It's very obvious if you look at the dell_send_request function what is 
> happening.

There have been numerous analysis indicating that the more arguments a function
has, the more likely bugs are to be found in those functions. 6 is a lot.

-- 
Darren Hart
VMware Open Source Technology Center

Reply via email to