lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180131090758.v6eyj35gymlfyzhk@pali>
Date:   Wed, 31 Jan 2018 10:07:58 +0100
From:   Pali Rohár <pali.rohar@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Mario Limonciello <mario.limonciello@...l.com>,
        Darren Hart <dvhart@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Platform Driver <platform-driver-x86@...r.kernel.org>
Subject: Re: [PATCH] platform/x86: dell-laptop: Allocate buffer on heap
 rather than globally

On Tuesday 30 January 2018 20:14:26 Andy Shevchenko wrote:
> >> -static void dell_set_arguments(u32 arg0, u32 arg1, u32 arg2, u32 arg3)
> >> +static void dell_set_arguments(struct calling_interface_buffer *buffer,
> >> +                            u32 arg0, u32 arg1, u32 arg2, u32 arg3)
> >
> > Hm... this function has too many parameters :-(
> >
> > What about following API?
> >
> > static struct calling_interface_buffer dell_set_arguments(u32 arg0, u32 arg1, u32 arg2, u32 arg3);
> >
> > It would return filled structure (not a pointer !)
> 
> I do not think it's a good idea. Either we allocate request on a heap
> and return a pointer, or we fill the struct with some data on spot.
> 
> To naming:
> 
> for allocation: ..._alloc_request()
> for filling: _fill_request() / _prepare_request()
> 
> or alike.
> 
> _set_arguments() not good enough to me.

Ok. Then we need to stick with 5 arguments... What about name
dell_fill_request()? E.g.

  struct calling_interface_buffer buffer;
  dell_fill_request(&buffer, 0x2, 0, 0, 0);
  ret = dell_send_request(&buffer, CLASS_INFO, SELECT_RFKILL);

-- 
Pali Rohár
pali.rohar@...il.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ