[dpdk-dev] [PATCH] doc: fix issues in metrics example

Kovacevic, Marko marko.kovacevic at intel.com
Tue Dec 12 15:45:44 CET 2017



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Mattias Rönnblom
> Sent: Wednesday, November 29, 2017 9:29 AM
> To: Mcnamara, John <john.mcnamara at intel.com>
> Cc: dev at dpdk.org; Mattias Rönnblom <hofors at lysator.liu.se>
> Subject: [dpdk-dev] [PATCH] doc: fix issues in metrics example
> 
> The metrics example didn't retrieve the metrics' names, and also had some more
> minor issues with repetitive error handling code and missing variable
> declarations.
> 
> Signed-off-by: Mattias Rönnblom <hofors at lysator.liu.se>

Would it be more beneficial to keep the return in these two cases as not to do two jumps to go out instead of just one
And to remove the out: ; at the very end completely.

if (len == 0) {
-            printf("No metrics to display (none have been registered)\n");
-            return;
+            printf("Cannot get metrics count.\n");
+            goto out;
+        } else if (len == 0) {
+            printf("No metrics to display (none have been registered).\n");
+            goto out;
         }


More information about the dev mailing list