From owner-svn-src-head@freebsd.org Sat Sep 9 18:39:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B05BBE01920; Sat, 9 Sep 2017 18:39:56 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8ACAA73214; Sat, 9 Sep 2017 18:39:56 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89IdtQG058312; Sat, 9 Sep 2017 18:39:55 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89Idtcv058308; Sat, 9 Sep 2017 18:39:55 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201709091839.v89Idtcv058308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sat, 9 Sep 2017 18:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323370 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 323370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Sep 2017 18:39:56 -0000 Author: scottl Date: Sat Sep 9 18:39:55 2017 New Revision: 323370 URL: https://svnweb.freebsd.org/changeset/base/323370 Log: Remove the unnecessary use of a temporary string buffer. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Sat Sep 9 18:03:40 2017 (r323369) +++ head/sys/dev/mpr/mpr_sas.c Sat Sep 9 18:39:55 2017 (r323370) @@ -2257,7 +2257,7 @@ mpr_sc_failed_io_info(struct mpr_softc *sc, struct ccb u8 scsi_status = mpi_reply->SCSIStatus; char *desc_ioc_state = NULL; char *desc_scsi_status = NULL; - char *desc_scsi_state = sc->tmp_string; + char *desc_scsi_state = NULL; u32 log_info = le32toh(mpi_reply->IOCLogInfo); if (log_info == 0x31170000) @@ -2362,19 +2362,19 @@ mpr_sc_failed_io_info(struct mpr_softc *sc, struct ccb break; } - desc_scsi_state[0] = '\0'; + desc_scsi_state = "\0"; if (!scsi_state) desc_scsi_state = " "; if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) - strcat(desc_scsi_state, "response info "); + desc_scsi_state = "response info "; if (scsi_state & MPI2_SCSI_STATE_TERMINATED) - strcat(desc_scsi_state, "state terminated "); + desc_scsi_state = "state terminated "; if (scsi_state & MPI2_SCSI_STATE_NO_SCSI_STATUS) - strcat(desc_scsi_state, "no status "); + desc_scsi_state = "no status "; if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_FAILED) - strcat(desc_scsi_state, "autosense failed "); + desc_scsi_state = "autosense failed "; if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) - strcat(desc_scsi_state, "autosense valid "); + desc_scsi_state = "autosense valid "; mpr_dprint(sc, MPR_XINFO, "\thandle(0x%04x), ioc_status(%s)(0x%04x)\n", le16toh(mpi_reply->DevHandle), desc_ioc_state, ioc_status); @@ -2960,8 +2960,8 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mp */ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); mpr_dprint(sc, MPR_INFO, - "Controller reported %s status for target %u SMID %u, " - "loginfo %x\n", ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == + "Controller reported %s target %u SMID %u, loginfo %x\n", + ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == MPI2_IOCSTATUS_SCSI_IOC_TERMINATED) ? "IOC_TERMINATED" : "EXT_TERMINATED", target_id, cm->cm_desc.Default.SMID, le32toh(rep->IOCLogInfo)); Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Sat Sep 9 18:03:40 2017 (r323369) +++ head/sys/dev/mpr/mprvar.h Sat Sep 9 18:39:55 2017 (r323370) @@ -74,7 +74,6 @@ #define IFAULT_IOP_OVER_TEMP_THRESHOLD_EXCEEDED 0x2810 #define MPR_SCSI_RI_INVALID_FRAME (0x00000002) -#define MPR_STRING_LENGTH 64 #define DEFAULT_SPINUP_WAIT 3 /* seconds to wait for spinup */ @@ -330,7 +329,6 @@ struct mpr_softc { struct mpr_queue *queues; struct mprsas_softc *sassc; - char tmp_string[MPR_STRING_LENGTH]; TAILQ_HEAD(, mpr_command) req_list; TAILQ_HEAD(, mpr_command) high_priority_req_list; TAILQ_HEAD(, mpr_chain) chain_list; Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Sat Sep 9 18:03:40 2017 (r323369) +++ head/sys/dev/mps/mps_sas.c Sat Sep 9 18:39:55 2017 (r323370) @@ -1987,7 +1987,7 @@ mps_sc_failed_io_info(struct mps_softc *sc, struct ccb u8 scsi_status = mpi_reply->SCSIStatus; char *desc_ioc_state = NULL; char *desc_scsi_status = NULL; - char *desc_scsi_state = sc->tmp_string; + char *desc_scsi_state = NULL; u32 log_info = le32toh(mpi_reply->IOCLogInfo); if (log_info == 0x31170000) @@ -2089,19 +2089,19 @@ mps_sc_failed_io_info(struct mps_softc *sc, struct ccb break; } - desc_scsi_state[0] = '\0'; + desc_scsi_state = "\0"; if (!scsi_state) desc_scsi_state = " "; if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) - strcat(desc_scsi_state, "response info "); + desc_scsi_state = "response info "; if (scsi_state & MPI2_SCSI_STATE_TERMINATED) - strcat(desc_scsi_state, "state terminated "); + desc_scsi_state = "state terminated "; if (scsi_state & MPI2_SCSI_STATE_NO_SCSI_STATUS) - strcat(desc_scsi_state, "no status "); + desc_scsi_state = "no status "; if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_FAILED) - strcat(desc_scsi_state, "autosense failed "); + desc_scsi_state = "autosense failed "; if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) - strcat(desc_scsi_state, "autosense valid "); + desc_scsi_state = "autosense valid "; mps_dprint(sc, MPS_XINFO, "\thandle(0x%04x), ioc_status(%s)(0x%04x)\n", le16toh(mpi_reply->DevHandle), desc_ioc_state, ioc_status); @@ -2490,8 +2490,8 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mp */ mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); mps_dprint(sc, MPS_INFO, - "Controller reported %s status for target %u SMID %u, " - "loginfo %x\n", ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == + "Controller reported %s target %u SMID %u, loginfo %x\n", + ((rep->IOCStatus & MPI2_IOCSTATUS_MASK) == MPI2_IOCSTATUS_SCSI_IOC_TERMINATED) ? "IOC_TERMINATED" : "EXT_TERMINATED", target_id, cm->cm_desc.Default.SMID, le32toh(rep->IOCLogInfo)); Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Sat Sep 9 18:03:40 2017 (r323369) +++ head/sys/dev/mps/mpsvar.h Sat Sep 9 18:39:55 2017 (r323370) @@ -56,7 +56,6 @@ #define MPS_MISSING_CHECK_DELAY 10 /* 10 seconds between missing check */ #define MPS_SCSI_RI_INVALID_FRAME (0x00000002) -#define MPS_STRING_LENGTH 64 #define DEFAULT_SPINUP_WAIT 3 /* seconds to wait for spinup */ @@ -317,7 +316,6 @@ struct mps_softc { struct mps_queue *queues; struct mpssas_softc *sassc; - char tmp_string[MPS_STRING_LENGTH]; TAILQ_HEAD(, mps_command) req_list; TAILQ_HEAD(, mps_command) high_priority_req_list; TAILQ_HEAD(, mps_chain) chain_list;