On Sep 18, 2015, at 4:34 PM, Brian King [off-list ref] =
wrote:
On 09/16/2015 04:29 PM, Matthew R. Ochs wrote:
quoted
=20
+ ssize_t bytes =3D 0;
+ __be64 __iomem *fc_port;
+
+ if (port >=3D NUM_FC_PORTS)
+ return 0;
+
+ fc_port =3D &afu->afu_map->global.fc_port[port][0];
+
+ for (i =3D 0; i < CXLFLASH_NUM_VLUNS; i++, buf +=3D 22)
=20
Rather than this bug prone hard coded 22, how about never incrementing =
buf and do something
similar to this:
=20
quoted
+ bytes +=3D scnprintf(buf, PAGE_SIZE, "%03d: %016llX\n",
+ i, readq_be(&fc_port[i]));
=20
bytes +=3D scnprintf(&buf[bytes], PAGE_SIZE, "%03d: =
%016llX\n",
i, readq_be(&fc_port[i]));
=20
quoted
+ return bytes;
+}
+
Great suggestion! Will fix in v3.
-matt=