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] [day] [month] [year] [list]
Message-ID: <CY5PR11MB6366C939F72EC1D38372612DED029@CY5PR11MB6366.namprd11.prod.outlook.com>
Date:   Sun, 13 Nov 2022 07:05:10 +0000
From:   "Usyskin, Alexander" <alexander.usyskin@...el.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:     Jani Nikula <jani.nikula@...ux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        "Vivi, Rodrigo" <rodrigo.vivi@...el.com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        "Tvrtko Ursulin" <tvrtko.ursulin@...ux.intel.com>,
        "Winkler, Tomas" <tomas.winkler@...el.com>,
        "Lubart, Vitaly" <vitaly.lubart@...el.com>,
        "intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] mei: add timeout to send

> > diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c
> > index 71fbf0bc8453..3174cad8a5cc 100644
> > --- a/drivers/misc/mei/bus-fixup.c
> > +++ b/drivers/misc/mei/bus-fixup.c
> > @@ -128,7 +128,7 @@ static int mei_osver(struct mei_cl_device *cldev)
> >  	os_ver = (struct mei_os_ver *)fwcaps->data;
> >  	os_ver->os_type = OSTYPE_LINUX;
> >
> > -	return __mei_cl_send(cldev->cl, buf, size, 0, mode);
> > +	return __mei_cl_send(cldev->cl, buf, size, 0, mode, 0);
> 
> Ick, adding another parameter to a function is not helpful here, what
> does 0 mean unless you look it up?
> 
> > --- a/drivers/misc/mei/bus.c
> > +++ b/drivers/misc/mei/bus.c
> > @@ -29,11 +29,12 @@
> >   * @length: buffer length
> >   * @vtag: virtual tag
> >   * @mode: sending mode
> > + * @timeout: send timeout for blocking writes, 0 for infinite timeout
> 
> What units are these in?  Jiffies?  seconds?  hours?  Don't make us
> guess :(
> 

Sure, will add mention of msec here.

> Why not write a function that is mei_cl_send_timeout() that has the new
> option?  That way it's obvious that the other ones are blocking, right?
> 

Yes, renaming extended __mei_cl_send with __mei_cl_send_timeout and
making __mei_cl_send as wrapper to __mei_cl_send_timeout will make code lot cleaner
and fix the not understandable 0 from the first comment.
Thanks for a good tip!

> thanks,
> 
> greg k-h


-- 
Thanks,
Sasha


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ