[libvirt] [PATCH v3 4/5] util: Improve CPU frequency parsing

Bjoern Walk bwalk at linux.vnet.ibm.com
Thu Dec 14 14:23:27 UTC 2017


Andrea Bolognani <abologna at redhat.com> [2017-12-14, 03:01PM +0100]:
> On Thu, 2017-12-14 at 14:55 +0100, Bjoern Walk wrote:
> > > + * Returns: 0 when the string has been parsed successfully and the CPU
> > > + *          frequency has been stored in @mhz, >0 when the string has not
> > 
> > Maybe, >0 when the line prefix does not match exactly?
> 
> Documentation goes out of sync with reality quickly enough when
> the language used is purposefully vague ;)
> 
> > > +    /* Skip the colon. If anything but a colon is found, then we're
> > > +     * not looking at the right string and we should move on */
> > > +    if (*str != ':')
> > > +        return 1;
> > > +    str++;
> > 
> > You could do *str++ != ':' and save one line.
> 
> I'd rather not. Lines are cheap :)
> 

Yeah, this was just nit-picking.

Looks like I forgot my rb, so

Reviewed-by: Bjoern Walk <bwalk at linux.vnet.ibm.com>

> -- 
> Andrea Bolognani / Red Hat / Virtualization
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 

-- 
IBM Systems
Linux on z Systems & Virtualization Development
------------------------------------------------------------------------
IBM Deutschland
Schönaicher Str. 220
71032 Böblingen
Phone: +49 7031 16 1819
E-Mail: bwalk at de.ibm.com
------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 906 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20171214/d618ab75/attachment-0001.sig>


More information about the libvir-list mailing list