Thread (17 messages) flat view 17 messages, 5 authors, 2012-12-03

Re: Optics (SFP) monitoring on ixgbe and igbe

From: Aurélien <hidden>
Date: 2012-11-18 21:36:21

Hi Ben,

I've rewritten things according to your remarks.

On Fri, Nov 16, 2012 at 8:38 PM, Ben Hutchings
[off-list ref] wrote:
This is silly; log10() and <math.h> are part of standard C and -lm is
standard on Unix.  Just use <math.h> and -lm unconditionally.
Ok, I wasn't sure.
Please merge this with the existing -m option and update the
documentation to say that this covers diagnostics where available.  You
could add a long option alias like --dump-module or --module-info that
covers the two types of information.
Done that, the current output of -m has been modified so that
everything lines up correctly.
The --module-info option alias has been added.
All the above offsets need parentheses around their definitions.
[…]
This is commented as an offset in the A2 'EEPROM' but the offsets
actually used include the 0x100 offset from the start of the
concatenated 'EEPROM'.
A new SFF_A2_BASE has been added, and the OFFSET_TO macros are now
using that, so I removed the 0x100 from all the offsets, and they are
now indeed A2-relative.
Why are all the literals explicitly float and not double?
It was a keyboard/chair interface problem, now fixed :)
Please follow kernel coding style for spacing.  checkpatch.pl will show
you what should be changed.
Ran a checkpatch, and fixed everything that should be fixed.
This seems awfuly complicated; why not:

#define OFFSET_TO_TEMP(offset) (((s16)OFFSET_TO_U16(offset)) * 10 / 256)

But why round to tenths of a degree here and then round again to whole
degrees celsius/fahrenheit when printing?
I did not think a simple cast would work, but it seems to give the
right value. I also implemented externally calibrated optics in this
new version, so I now do the whole formatting in the printing, and
store the raw value in the struct.

It should be better now.

Best regards,
-- 
Aurélien Guillaume

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help