Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 553448f6 authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley
Browse files

[SCSI] zfcp: Message cleanup



Cleanup the messages used in the zfcp driver: Remove unnecessary debug
and trace message and convert the remaining messages to standard
kernel macros. Remove the zfcp message macros and while updating the
whole flie also update the copyright headers.

Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 00bab910
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,6 +4,6 @@

zfcp-objs := zfcp_aux.o zfcp_ccw.o zfcp_scsi.o zfcp_erp.o zfcp_qdio.o \
	     zfcp_fsf.o zfcp_dbf.o zfcp_sysfs_adapter.o zfcp_sysfs_port.o \
	     zfcp_sysfs_unit.o zfcp_sysfs_driver.o zfcp_fc.o zfcp_cfdc.o
	     zfcp_sysfs_unit.o zfcp_fc.o zfcp_cfdc.o

obj-$(CONFIG_ZFCP) += zfcp.o
+21 −54
Original line number Diff line number Diff line
/*
 * This file is part of the zfcp device driver for
 * FCP adapters for IBM System z9 and zSeries.
 * zfcp device driver
 *
 * (C) Copyright IBM Corp. 2002, 2006
 * Module interface and handling of zfcp data structures.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 * Copyright IBM Corporation 2002, 2008
 */

/*
@@ -31,13 +18,16 @@
 *            Maxim Shchetynin
 *            Volker Sameske
 *            Ralph Wuerthner
 *            Michael Loehr
 *            Swen Schillig
 *            Christof Schmitt
 *            Martin Petermann
 *            Sven Schuetz
 */

#include <linux/miscdevice.h>
#include "zfcp_ext.h"

/* accumulated log level (module parameter) */
static u32 loglevel = ZFCP_LOG_LEVEL_DEFAULTS;
static char *device;
/*********************** FUNCTION PROTOTYPES *********************************/

@@ -57,12 +47,6 @@ MODULE_LICENSE("GPL");
module_param(device, charp, 0400);
MODULE_PARM_DESC(device, "specify initial device");

module_param(loglevel, uint, 0400);
MODULE_PARM_DESC(loglevel,
		 "log levels, 8 nibbles: "
		 "FC ERP QDIO CIO Config FSF SCSI Other, "
		 "levels: 0=none 1=normal 2=devel 3=trace");

/****************************************************************/
/************** Functions without logging ***********************/
/****************************************************************/
@@ -87,8 +71,6 @@ _zfcp_hex_dump(char *addr, int count)
/****** Functions to handle the request ID hash table    ********/
/****************************************************************/

#define ZFCP_LOG_AREA			ZFCP_LOG_AREA_FSF

static int zfcp_reqlist_alloc(struct zfcp_adapter *adapter)
{
	int idx;
@@ -118,14 +100,10 @@ int zfcp_reqlist_isempty(struct zfcp_adapter *adapter)
	return 1;
}

#undef ZFCP_LOG_AREA

/****************************************************************/
/************** Uncategorised Functions *************************/
/****************************************************************/

#define ZFCP_LOG_AREA			ZFCP_LOG_AREA_OTHER

/**
 * zfcp_device_setup - setup function
 * @str: pointer to parameter string
@@ -143,8 +121,11 @@ zfcp_device_setup(char *devstr)

	len = strlen(devstr) + 1;
	str = kmalloc(len, GFP_KERNEL);
	if (!str)
		goto err_out;
	if (!str) {
		pr_err("zfcp: Could not allocate memory for "
		       "device parameter string, device not attached.\n");
		return 0;
	}
	memcpy(str, devstr, len);

	tmp = strchr(str, ',');
@@ -167,7 +148,8 @@ zfcp_device_setup(char *devstr)
	return 1;

 err_out:
	ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str);
	pr_err("zfcp: Parse error for device parameter string %s, "
	       "device not attached.\n", str);
	kfree(str);
	return 0;
}
@@ -248,8 +230,6 @@ zfcp_module_init(void)
	if (!zfcp_data.gid_pn_cache)
		goto out_gid_cache;

	atomic_set(&zfcp_data.loglevel, loglevel);

	/* initialize adapter list */
	INIT_LIST_HEAD(&zfcp_data.adapter_list_head);

@@ -263,8 +243,7 @@ zfcp_module_init(void)

	retval = misc_register(&zfcp_cfdc_misc);
	if (retval != 0) {
		ZFCP_LOG_INFO("registration of misc device "
			      "zfcp_cfdc failed\n");
		pr_err("zfcp: registration of misc device zfcp_cfdc failed\n");
		goto out_misc;
	}

@@ -277,7 +256,7 @@ zfcp_module_init(void)
	/* setup dynamic I/O */
	retval = zfcp_ccw_register();
	if (retval) {
		ZFCP_LOG_NORMAL("registration with common I/O layer failed\n");
		pr_err("zfcp: Registration with common I/O layer failed.\n");
		goto out_ccw_register;
	}

@@ -300,14 +279,10 @@ zfcp_module_init(void)
	return retval;
}

#undef ZFCP_LOG_AREA

/****************************************************************/
/****** Functions for configuration/set-up of structures ********/
/****************************************************************/

#define ZFCP_LOG_AREA			ZFCP_LOG_AREA_CONFIG

/**
 * zfcp_get_unit_by_lun - find unit in unit list of port by FCP LUN
 * @port: pointer to port to search for unit
@@ -598,6 +573,8 @@ static void _zfcp_status_read_scheduler(struct work_struct *work)
 * All adapter internal structures are set up.
 * Proc-fs entries are also created.
 *
 * FIXME: Use -ENOMEM as return code for allocation failures
 *
 * returns:	0             if a new adapter was successfully enqueued
 *              ZFCP_KNOWN    if an adapter with this devno was already present
 *		-ENOMEM       if alloc failed
@@ -615,11 +592,8 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)

	/* try to allocate new adapter data structure (zeroed) */
	adapter = kzalloc(sizeof (struct zfcp_adapter), GFP_KERNEL);
	if (!adapter) {
		ZFCP_LOG_INFO("error: allocation of base adapter "
			      "structure failed\n");
	if (!adapter)
		goto out;
	}

	ccw_device->handler = NULL;

@@ -760,7 +734,6 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
	zfcp_reqlist_free(adapter);
	kfree(adapter->fc_stats);
	kfree(adapter->stats_reset_data);
	ZFCP_LOG_TRACE("freeing adapter structure\n");
	kfree(adapter);
 out:
	return;
@@ -908,12 +881,8 @@ zfcp_nameserver_enqueue(struct zfcp_adapter *adapter)

	port = zfcp_port_enqueue(adapter, 0, ZFCP_STATUS_PORT_WKA,
				 ZFCP_DID_DIRECTORY_SERVICE);
	if (!port) {
		ZFCP_LOG_INFO("error: enqueue of nameserver port for "
			      "adapter %s failed\n",
			      zfcp_get_busid_by_adapter(adapter));
	if (!port)
		return -ENXIO;
	}
	zfcp_port_put(port);

	return 0;
@@ -946,5 +915,3 @@ int zfcp_sg_setup_table(struct scatterlist *sg, int count)
	}
	return 0;
}

#undef ZFCP_LOG_AREA
+12 −29
Original line number Diff line number Diff line
/*
 * This file is part of the zfcp device driver for
 * FCP adapters for IBM System z9 and zSeries.
 * zfcp device driver
 *
 * (C) Copyright IBM Corp. 2002, 2006
 * Debug traces for zfcp.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 * Copyright IBM Corporation 2002, 2008
 */

#include <linux/ctype.h>
@@ -29,8 +16,6 @@ module_param(dbfsize, uint, 0400);
MODULE_PARM_DESC(dbfsize,
		 "number of pages for each debug feature area (default 4)");

#define ZFCP_LOG_AREA			ZFCP_LOG_AREA_OTHER

static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len,
			     int level, char *from, int from_len)
{
@@ -515,13 +500,13 @@ static const char *zfcp_rec_dbf_ids[] = {
	[52]	= "port boxed close unit",
	[53]	= "port boxed fcp",
	[54]	= "unit boxed fcp",
	[55]	= "port access denied ct",
	[56]	= "port access denied els",
	[57]	= "port access denied open port",
	[58]	= "port access denied close physical",
	[59]	= "unit access denied open unit",
	[55]	= "port access denied",
	[56]	= "",
	[57]	= "",
	[58]	= "",
	[59]	= "unit access denied",
	[60]	= "shared unit access denied open unit",
	[61]	= "unit access denied fcp",
	[61]	= "",
	[62]	= "request timeout",
	[63]	= "adisc link test reject or timeout",
	[64]	= "adisc link test d_id changed",
@@ -586,8 +571,8 @@ static const char *zfcp_rec_dbf_ids[] = {
	[120]	= "unknown fsf command",
	[121]	= "no recommendation for status qualifier",
	[122]	= "status read physical port closed in error",
	[123]	= "fc service class not supported ct",
	[124]	= "fc service class not supported els",
	[123]	= "fc service class not supported",
	[124]	= "",
	[125]	= "need newer zfcp",
	[126]	= "need newer microcode",
	[127]	= "arbitrated loop not supported",
@@ -595,7 +580,7 @@ static const char *zfcp_rec_dbf_ids[] = {
	[129]	= "qtcb size mismatch",
	[130]	= "unknown fsf status ecd",
	[131]	= "fcp request too big",
	[132]	= "fc service class not supported fcp",
	[132]	= "",
	[133]	= "data direction not valid fcp",
	[134]	= "command length not valid fcp",
	[135]	= "status read act update",
@@ -1291,5 +1276,3 @@ void zfcp_adapter_debug_unregister(struct zfcp_adapter *adapter)
	adapter->hba_dbf = NULL;
	adapter->rec_dbf = NULL;
}

#undef ZFCP_LOG_AREA
+3 −121
Original line number Diff line number Diff line
/*
 * This file is part of the zfcp device driver for
 * FCP adapters for IBM System z9 and zSeries.
 * zfcp device driver
 *
 * (C) Copyright IBM Corp. 2002, 2006
 * Global definitions for the zfcp device driver.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 * Copyright IBM Corporation 2002, 2008
 */

#ifndef ZFCP_DEF_H
@@ -52,9 +39,6 @@

/********************* GENERAL DEFINES *********************************/

/* zfcp version number, it consists of major, minor, and patch-level number */
#define ZFCP_VERSION		"4.8.0"

/**
 * zfcp_sg_to_address - determine kernel address from struct scatterlist
 * @list: struct scatterlist
@@ -308,107 +292,6 @@ struct zfcp_rc_entry {
 */
#define ZFCP_CT_TIMEOUT			(3 * R_A_TOV)

/******************** LOGGING MACROS AND DEFINES *****************************/

/*
 * Logging may be applied on certain kinds of driver operations
 * independently. Additionally, different log-levels are supported for
 * each of these areas.
 */

#define ZFCP_NAME               "zfcp"

/* independent log areas */
#define ZFCP_LOG_AREA_OTHER	0
#define ZFCP_LOG_AREA_SCSI	1
#define ZFCP_LOG_AREA_FSF	2
#define ZFCP_LOG_AREA_CONFIG	3
#define ZFCP_LOG_AREA_CIO	4
#define ZFCP_LOG_AREA_QDIO	5
#define ZFCP_LOG_AREA_ERP	6
#define ZFCP_LOG_AREA_FC	7

/* log level values*/
#define ZFCP_LOG_LEVEL_NORMAL	0
#define ZFCP_LOG_LEVEL_INFO	1
#define ZFCP_LOG_LEVEL_DEBUG	2
#define ZFCP_LOG_LEVEL_TRACE	3

/*
 * this allows removal of logging code by the preprocessor
 * (the most detailed log level still to be compiled in is specified,
 * higher log levels are removed)
 */
#define ZFCP_LOG_LEVEL_LIMIT	ZFCP_LOG_LEVEL_TRACE

/* get "loglevel" nibble assignment */
#define ZFCP_GET_LOG_VALUE(zfcp_lognibble) \
	       ((atomic_read(&zfcp_data.loglevel) >> (zfcp_lognibble<<2)) & 0xF)

/* set "loglevel" nibble */
#define ZFCP_SET_LOG_NIBBLE(value, zfcp_lognibble) \
	       (value << (zfcp_lognibble << 2))

/* all log-level defaults are combined to generate initial log-level */
#define ZFCP_LOG_LEVEL_DEFAULTS \
	(ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_OTHER) | \
	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_SCSI) | \
	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_FSF) | \
	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_CONFIG) | \
	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_CIO) | \
	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_QDIO) | \
	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_ERP) | \
	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_FC))

/* check whether we have the right level for logging */
#define ZFCP_LOG_CHECK(level) \
	((ZFCP_GET_LOG_VALUE(ZFCP_LOG_AREA)) >= level)

/* logging routine for zfcp */
#define _ZFCP_LOG(fmt, args...) \
	printk(KERN_ERR ZFCP_NAME": %s(%d): " fmt, __func__, \
	       __LINE__ , ##args)

#define ZFCP_LOG(level, fmt, args...) \
do { \
	if (ZFCP_LOG_CHECK(level)) \
		_ZFCP_LOG(fmt, ##args); \
} while (0)

#if ZFCP_LOG_LEVEL_LIMIT < ZFCP_LOG_LEVEL_NORMAL
# define ZFCP_LOG_NORMAL(fmt, args...)	do { } while (0)
#else
# define ZFCP_LOG_NORMAL(fmt, args...) \
do { \
	if (ZFCP_LOG_CHECK(ZFCP_LOG_LEVEL_NORMAL)) \
		printk(KERN_ERR ZFCP_NAME": " fmt, ##args); \
} while (0)
#endif

#if ZFCP_LOG_LEVEL_LIMIT < ZFCP_LOG_LEVEL_INFO
# define ZFCP_LOG_INFO(fmt, args...)	do { } while (0)
#else
# define ZFCP_LOG_INFO(fmt, args...) \
do { \
	if (ZFCP_LOG_CHECK(ZFCP_LOG_LEVEL_INFO)) \
		printk(KERN_ERR ZFCP_NAME": " fmt, ##args); \
} while (0)
#endif

#if ZFCP_LOG_LEVEL_LIMIT < ZFCP_LOG_LEVEL_DEBUG
# define ZFCP_LOG_DEBUG(fmt, args...)	do { } while (0)
#else
# define ZFCP_LOG_DEBUG(fmt, args...) \
	ZFCP_LOG(ZFCP_LOG_LEVEL_DEBUG, fmt , ##args)
#endif

#if ZFCP_LOG_LEVEL_LIMIT < ZFCP_LOG_LEVEL_TRACE
# define ZFCP_LOG_TRACE(fmt, args...)	do { } while (0)
#else
# define ZFCP_LOG_TRACE(fmt, args...) \
	ZFCP_LOG(ZFCP_LOG_LEVEL_TRACE, fmt , ##args)
#endif

/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/

/*
@@ -846,7 +729,6 @@ struct zfcp_data {
	char                    init_busid[BUS_ID_SIZE];
	wwn_t                   init_wwpn;
	fcp_lun_t               init_fcp_lun;
	char 			*driver_version;
	struct kmem_cache		*fsf_req_qtcb_cache;
	struct kmem_cache		*sr_buffer_cache;
	struct kmem_cache		*gid_pn_cache;
+57 −236

File changed.

Preview size limit exceeded, changes collapsed.

Loading