ethtool: qsfp: fix special value comparison

One of the warnings gcc issues when building ethtool with -Wall seems to
point to an actual problem:

qsfp.c: In function 'sff8636_show_dom':
qsfp.c:709:57: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  if ((sd.sfp_temp[MCURR] == 0x0) || (sd.sfp_temp[MCURR] == 0xFFFF))

Rather than writing the special value as -1 which would be a bit confusing,
cast 0xFFFF to __s16.

Fixes: a5e73bb05ee4 ("ethtool:QSFP Plus/QSFP28 Diagnostics Information Support")
Signed-off-by: Michal Kubecek <>
Signed-off-by: John W. Linville <>
diff --git a/qsfp.c b/qsfp.c
index d196aa1..d0774b0 100644
--- a/qsfp.c
+++ b/qsfp.c
@@ -706,7 +706,8 @@
 	 * current fields are supported or not. A valid temperature
 	 * reading is used as existence for TX/RX power.
-	if ((sd.sfp_temp[MCURR] == 0x0) || (sd.sfp_temp[MCURR] == 0xFFFF))
+	if ((sd.sfp_temp[MCURR] == 0x0) ||
+	    (sd.sfp_temp[MCURR] == (__s16)0xFFFF))
 	printf("\t%-41s : %s\n", "Alarm/warning flags implemented",