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

From
Michal Kubecek <hidden>
Date
2020-08-04 10:30:23
Reply to
Adrian Pop, 2020-07-31
I noticed one more minor problem:

On Fri, Jul 31, 2020 at 11:47:25AM +0300, Adrian Pop wrote:
quoted hunk ↗ jump to hunk
+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

Thread (9 messages) 9 messages, 4 authors, last reply 2020-08-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help