Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2013 23:20:12 +0000 (UTC)
From:      Scott Long <scottl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253307 - head/sys/cam/scsi
Message-ID:  <201307122320.r6CNKCiN089236@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: scottl
Date: Fri Jul 12 23:20:11 2013
New Revision: 253307
URL: http://svnweb.freebsd.org/changeset/base/253307

Log:
  Const-ify the new da_delete_functions.
  Remove a redundant sanity check
  
  Submitted by:	Steven Hartland
  Obtained from:	Netflix
  MFC after:	3 days

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Fri Jul 12 23:12:37 2013	(r253306)
+++ head/sys/cam/scsi/scsi_da.c	Fri Jul 12 23:20:11 2013	(r253307)
@@ -150,7 +150,7 @@ static da_delete_func_t da_delete_trim;
 static da_delete_func_t da_delete_unmap;
 static da_delete_func_t da_delete_ws;
 
-static void * da_delete_functions[] = {
+static const void * da_delete_functions[] = {
 	NULL,
 	NULL,
 	da_delete_trim,
@@ -1818,10 +1818,7 @@ dadeletemethodset(struct da_softc *softc
 
 	softc->delete_method = delete_method;
 	softc->disk->d_delmaxsize = dadeletemaxsize(softc, delete_method);
-	if (delete_method <= DA_DELETE_MAX)
-		softc->delete_func = da_delete_functions[delete_method];
-	else
-		softc->delete_func = NULL;
+	softc->delete_func = da_delete_functions[delete_method];
 
 	if (softc->delete_method > DA_DELETE_DISABLE)
 		softc->disk->d_flags |= DISKFLAG_CANDELETE;



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