I noticed one more minor problem:
On Fri, Jul 31, 2020 at 11:47:25AM +0300, Adrian Pop wrote:
> +static void qsfp_dd_show_sig_optical_pwr(const __u8 *id, __u32 eeprom_len)
> +{
> + static const char * const aw_strings[] = {
> + "%s power high alarm (Channel %d)",
> + "%s power low alarm (Channel %d)",
> + "%s power high warning (Channel %d)",
> + "%s power low warning (Channel %d)"
> + };
> + __u8 module_type = id[QSFP_DD_MODULE_TYPE_OFFSET];
> + char field_desc[QSFP_DD_MAX_DESC_SIZE];
> + struct qsfp_dd_diags sd = { { 0 } };
This causes a compiler warning with recent gcc:
qsfp-dd.c: In function ‘qsfp_dd_show_sig_optical_pwr’:
qsfp-dd.c:438:9: warning: missing initializer for field ‘sfp_temp’ of ‘struct
qsfp_dd_diags’ [-Wmissing-field-initializers]
438 | struct qsfp_dd_diags sd = { { 0 } };
| ^~~~~~~~~~~~~
In file included from qsfp-dd.c:26:
qsfp-dd.h:30:8: note: ‘sfp_temp’ declared here
30 | __s16 sfp_temp[4];
| ^~~~~~~~
An empty initializer like
struct qsfp_dd_diags sd = {};
should be fine (and is already used in many other places).
Michal
signature.asc
Description: PGP signature
