Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1309749

Re: [PATCH v2 2/2] dell-wmi: Process only one event on devices with interface version 0

From Darren Hart <dvhart@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] dell-wmi: Process only one event on devices with interface version 0
Date 2016-01-15 00:10 +0100
Message-ID <qQZbI-5Fp-9@gated-at.bofh.it> (permalink)
References <qJlsJ-3li-7@gated-at.bofh.it> <qNkRt-vJ-19@gated-at.bofh.it> <qQ59w-8S-33@gated-at.bofh.it> <qQbeX-4fh-17@gated-at.bofh.it> <qQdA6-5WY-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jan 12, 2016 at 09:12:46PM +0100, Michał Kępień wrote:
> > > Wouldn't it be a bit more clear if we clamped buffer_size before
> > > setting buffer_end?  E.g. like this:
> > > 
> > > 	if (buffer_size == 0)
> > > 		return;
> > > 
> > > 	if (dell_wmi_interface_version == 0 &&
> > > 	    buffer_size > buffer_entry[0] + 1)
> > > 		buffer_size = buffer_entry[0] + 1;
> > > 
> > > 	buffer_end = buffer_entry + buffer_size;
> > 
> > Before return adds correct cleanup part and code will be same as my 
> > original patch.
> > 
> > So if more people think that your code is cleaner I'm OK with replacing 
> > it.
> 
> Both solutions are fine and I realize I'm a bit late to the party as you
> posted the original patch almost 3 weeks ago, so I don't want to delay
> it any longer.  I think it's just a matter of deciding whether to
> enforce the buffer size limit using buffer_size or buffer_end.  As the
> first option involves a little bit less writing, I thought I'd suggest
> it.
> 
> > > One more minor nit: you should probably decide between "first" and
> > > "one" as the phrase "only first one event" (found both in the commit
> > > message and in the code comment) sounds incorrect to me.
> > 
> > Feel free to correct commit message, I'm not very good in english...
> > 
> > It should mean something like this... in buffer received by bios can be 
> > more events. That while loop iterate over events. And this my patch on 
> > machines with wmi version 0 will process only *one* event. And that 
> > event is *first* in buffer.
> 
> Don't worry, I understood your intentions from the commit message, so I
> don't think it's worth posting a v3 only to correct minor stylistic
> errors.
> 
> -- 
> Best regards,
> Michał Kępień

I've cleaned up that bit.

-- 
Darren Hart
Intel Open Source Technology Center

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] Fixes for dell-wmi Pali Rohár <pali.rohar@gmail.com> - 2016-01-04 22:30 +0100
  [PATCH v2 1/2] dell-wmi: Check if Dell WMI descriptor structure is valid Pali Rohár <pali.rohar@gmail.com> - 2016-01-04 22:30 +0100
  [PATCH v2 2/2] dell-wmi: Process only one event on devices with interface version 0 Pali Rohár <pali.rohar@gmail.com> - 2016-01-04 22:30 +0100
    Re: [PATCH v2 2/2] dell-wmi: Process only one event on devices with  interface version 0 Michał Kępień <kernel@kempniu.pl> - 2016-01-12 12:20 +0100
      Re: [PATCH v2 2/2] dell-wmi: Process only one event on devices with interface version 0 Pali Rohár <pali.rohar@gmail.com> - 2016-01-12 18:50 +0100
        Re: [PATCH v2 2/2] dell-wmi: Process only one event on devices with  interface version 0 Michał Kępień <kernel@kempniu.pl> - 2016-01-12 21:20 +0100
          Re: [PATCH v2 2/2] dell-wmi: Process only one event on devices with  interface version 0 Darren Hart <dvhart@infradead.org> - 2016-01-15 00:10 +0100
  Re: [PATCH v2 0/2] Fixes for dell-wmi Darren Hart <dvhart@infradead.org> - 2016-01-11 20:30 +0100
    Re: [PATCH v2 0/2] Fixes for dell-wmi Gabriele Mazzotta <gabriele.mzt@gmail.com> - 2016-01-12 01:40 +0100

csiph-web