# Re: \[PATCH\] ethtool: Add QSFP-DD support

- From: Michal Kubecek \<hidden\>
- Date: 2020-08-04 10:30:23 
- List: netdev
- Page: https://ratatoskr.run/netdev/2020/08/11178464
- Thread: https://ratatoskr.run/netdev/2020/07/11178056/t.md

```text
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
```

## Attachments

- [signature.asc](https://ratatoskr.run/netdev/2020/08/11178464/attachment/0) (application/pgp-signature, 488 bytes)
