lkml.org 
[lkml]   [2017]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 09/14] platform/x86: dell-smbios: Introduce dispatcher for SMM calls
On Tue, Oct 10, 2017 at 07:14:53PM +0000, Mario.Limonciello@dell.com wrote:
> > -----Original Message-----
> > From: Pali Rohár [mailto:pali.rohar@gmail.com]
> > Sent: Tuesday, October 10, 2017 11:01 AM
> > To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> > Cc: dvhart@infradead.org; Andy Shevchenko <andy.shevchenko@gmail.com>;
> > LKML <linux-kernel@vger.kernel.org>; platform-driver-x86@vger.kernel.org;
> > Andy Lutomirski <luto@kernel.org>; quasisec@google.com; rjw@rjwysocki.net;
> > mjg59@google.com; hch@lst.de; Greg KH <greg@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

\
 
 \ /
  Last update: 2017-10-13 01:31    [W:0.090 / U:1.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site