Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Dec 2018 23:12:48 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341411 - head/sbin/nvmecontrol
Message-ID:  <201812022312.wB2NCmiV037809@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sun Dec  2 23:12:48 2018
New Revision: 341411
URL: https://svnweb.freebsd.org/changeset/base/341411

Log:
  Return after we find the dispatched function.
  
  If the dispatched function doesn't exit, then we get can get a
  spurious function not found message. They all do exit, but this is a
  little cleaner.
  
  Sponsored by: Netflix
  Differential Revision: https://reviews.freebsd.org/D18403

Modified:
  head/sbin/nvmecontrol/nvmecontrol.c

Modified: head/sbin/nvmecontrol/nvmecontrol.c
==============================================================================
--- head/sbin/nvmecontrol/nvmecontrol.c	Sun Dec  2 23:12:37 2018	(r341410)
+++ head/sbin/nvmecontrol/nvmecontrol.c	Sun Dec  2 23:12:48 2018	(r341411)
@@ -73,8 +73,10 @@ dispatch_set(int argc, char *argv[], struct nvme_funct
 	}
 
 	while (f < tbl_limit) {
-		if (strcmp(argv[1], (*f)->name) == 0)
+		if (strcmp(argv[1], (*f)->name) == 0) {
 			(*f)->fn(argc-1, &argv[1]);
+			return;
+		}
 		f++;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812022312.wB2NCmiV037809>