Commit 919d8a3f authored by Joe Perches's avatar Joe Perches Committed by Martin K. Petersen
Browse files

scsi: mpt3sas: Convert uses of pr_<level> with MPT3SAS_FMT to ioc_<level>



Use a more common logging style.

Done using the perl script below and some typing

$ git grep --name-only -w MPT3SAS_FMT -- "*.c" | \
  xargs perl -i -e 'local $/; while (<>) { s/\bpr_(info|err|notice|warn)\s*\(\s*MPT3SAS_FMT\s*("[^"]+"(?:\s*\\?\s*"[^"]+"\s*){0,5}\s*),\s*ioc->name\s*/ioc_\1(ioc, \2/g; print;}'

Miscellanea for these conversions:

o Coalesce formats
o Realign arguments
o Remove unnecessary parentheses
o Use casts to u64 instead of unsigned long long where appropriate
o Convert broken pr_info uses to pr_cont
o Fix broken format string concatenation with line continuations and
  excess whitespace

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarSuganath Prabu <suganath-prabu.subramani@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 645a20c6
Loading
Loading
Loading
Loading
+465 −600

File changed.

Preview size limit exceeded, changes collapsed.

+20 −28
Original line number Diff line number Diff line
@@ -175,9 +175,8 @@ _config_display_some_debug(struct MPT3SAS_ADAPTER *ioc, u16 smid,
	if (!desc)
		return;

	pr_info(MPT3SAS_FMT
		"%s: %s(%d), action(%d), form(0x%08x), smid(%d)\n",
		ioc->name, calling_function_name, desc,
	ioc_info(ioc, "%s: %s(%d), action(%d), form(0x%08x), smid(%d)\n",
		 calling_function_name, desc,
		 mpi_request->Header.PageNumber, mpi_request->Action,
		 le32_to_cpu(mpi_request->PageAddress), smid);

@@ -185,9 +184,8 @@ _config_display_some_debug(struct MPT3SAS_ADAPTER *ioc, u16 smid,
		return;

	if (mpi_reply->IOCStatus || mpi_reply->IOCLogInfo)
		pr_info(MPT3SAS_FMT
		    "\tiocstatus(0x%04x), loginfo(0x%08x)\n",
		    ioc->name, le16_to_cpu(mpi_reply->IOCStatus),
		ioc_info(ioc, "\tiocstatus(0x%04x), loginfo(0x%08x)\n",
			 le16_to_cpu(mpi_reply->IOCStatus),
			 le32_to_cpu(mpi_reply->IOCLogInfo));
}

@@ -210,9 +208,8 @@ _config_alloc_config_dma_memory(struct MPT3SAS_ADAPTER *ioc,
		mem->page = dma_alloc_coherent(&ioc->pdev->dev, mem->sz,
		    &mem->page_dma, GFP_KERNEL);
		if (!mem->page) {
			pr_err(MPT3SAS_FMT
				"%s: dma_alloc_coherent failed asking for (%d) bytes!!\n",
			    ioc->name, __func__, mem->sz);
			ioc_err(ioc, "%s: dma_alloc_coherent failed asking for (%d) bytes!!\n",
				__func__, mem->sz);
			r = -ENOMEM;
		}
	} else { /* use tmp buffer if less than 512 bytes */
@@ -313,8 +310,7 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t

	mutex_lock(&ioc->config_cmds.mutex);
	if (ioc->config_cmds.status != MPT3_CMD_NOT_USED) {
		pr_err(MPT3SAS_FMT "%s: config_cmd in use\n",
		    ioc->name, __func__);
		ioc_err(ioc, "%s: config_cmd in use\n", __func__);
		mutex_unlock(&ioc->config_cmds.mutex);
		return -EAGAIN;
	}
@@ -362,34 +358,30 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t
			r = -EFAULT;
			goto free_mem;
		}
		pr_info(MPT3SAS_FMT "%s: attempting retry (%d)\n",
		    ioc->name, __func__, retry_count);
		ioc_info(ioc, "%s: attempting retry (%d)\n",
			 __func__, retry_count);
	}
	wait_state_count = 0;
	ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
	while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
		if (wait_state_count++ == MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT) {
			pr_err(MPT3SAS_FMT
			    "%s: failed due to ioc not operational\n",
			    ioc->name, __func__);
			ioc_err(ioc, "%s: failed due to ioc not operational\n",
				__func__);
			ioc->config_cmds.status = MPT3_CMD_NOT_USED;
			r = -EFAULT;
			goto free_mem;
		}
		ssleep(1);
		ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
		pr_info(MPT3SAS_FMT
			"%s: waiting for operational state(count=%d)\n",
			ioc->name, __func__, wait_state_count);
		ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
			 __func__, wait_state_count);
	}
	if (wait_state_count)
		pr_info(MPT3SAS_FMT "%s: ioc is operational\n",
		    ioc->name, __func__);
		ioc_info(ioc, "%s: ioc is operational\n", __func__);

	smid = mpt3sas_base_get_smid(ioc, ioc->config_cb_idx);
	if (!smid) {
		pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n",
		    ioc->name, __func__);
		ioc_err(ioc, "%s: failed obtaining a smid\n", __func__);
		ioc->config_cmds.status = MPT3_CMD_NOT_USED;
		r = -EAGAIN;
		goto free_mem;
@@ -453,8 +445,8 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t
	}

	if (retry_count)
		pr_info(MPT3SAS_FMT "%s: retry (%d) completed!!\n", \
		    ioc->name, __func__, retry_count);
		ioc_info(ioc, "%s: retry (%d) completed!!\n",
			 __func__, retry_count);

	if ((ioc_status == MPI2_IOCSTATUS_SUCCESS) &&
	    config_page && mpi_request->Action ==
+208 −285

File changed.

Preview size limit exceeded, changes collapsed.

+623 −802

File changed.

Preview size limit exceeded, changes collapsed.

+140 −173

File changed.

Preview size limit exceeded, changes collapsed.

Loading