lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200804103020.4myko3zlw3bh62az@lion.mk-sys.cz>
Date:   Tue, 4 Aug 2020 12:30:20 +0200
From:   Michal Kubecek <mkubecek@...e.cz>
To:     Adrian Pop <popadrian1996@...il.com>
Cc:     netdev@...r.kernel.org, linville@...driver.com,
        davem@...emloft.net, kuba@...nel.org, jiri@...lanox.com,
        vadimp@...lanox.com, mlxsw@...lanox.com, idosch@...lanox.com,
        andrew@...n.ch
Subject: Re: [PATCH] ethtool: Add QSFP-DD support

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

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ