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

Commit 0a3bdb00 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

staging: lustre: remove RETURN macro



We have a kernel-wide function tracing system, so use that instead of
rolling a custom one just for one filesystem.

Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 23f14e79
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -52,11 +52,11 @@ cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)

	OBD_ALLOC(ptr, CFS_BITMAP_SIZE(size));
	if (ptr == NULL)
		RETURN(ptr);
		return ptr;

	ptr->size = size;

	RETURN (ptr);
	return ptr;
}

#define CFS_FREE_BITMAP(ptr)	OBD_FREE(ptr, CFS_BITMAP_SIZE(ptr->size))
+0 −12
Original line number Diff line number Diff line
@@ -80,20 +80,8 @@ static inline int __is_po2(unsigned long long val)
#define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \
			   ((hexnum) >> 8 & 0xf))


/*
 * Some (nomina odiosa sunt) platforms define NULL as naked 0. This confuses
 * Lustre RETURN(NULL) macro.
 */
#if defined(NULL)
#undef NULL
#endif

#define NULL ((void *)0)

#define LUSTRE_SRV_LNET_PID      LUSTRE_LNET_PID


#include <linux/list.h>

#ifndef cfs_for_each_possible_cpu
+0 −47
Original line number Diff line number Diff line
@@ -262,53 +262,6 @@ do { \
} while (0)


/*
 * if rc == NULL, we need to code as RETURN((void *)NULL), otherwise
 * there will be a warning in osx.
 */
#if defined(__GNUC__)

long libcfs_log_return(struct libcfs_debug_msg_data *, long rc);
#if BITS_PER_LONG > 32
#define RETURN(rc)							\
do {									\
	if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) {		\
		LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL);	\
		return (typeof(rc))libcfs_log_return(&msgdata,		\
						     (long)(rc));	\
	}								\
									\
	return (rc);							\
} while (0)
#else /* BITS_PER_LONG == 32 */
/* We need an on-stack variable, because we cannot case a 32-bit pointer
 * directly to (long long) without generating a complier warning/error, yet
 * casting directly to (long) will truncate 64-bit return values. The log
 * values will print as 32-bit values, but they always have been. LU-1436
 */
#define RETURN(rc)							\
do {									\
	if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) {		\
		typeof(rc) __rc = (rc);					\
		LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL);	\
		libcfs_log_return(&msgdata, (long_ptr_t)__rc);		\
		return __rc;						\
	}								\
									\
	return (rc);							\
} while (0)
#endif /* BITS_PER_LONG > 32 */

#elif defined(_MSC_VER)
#define RETURN(rc)						      \
do {								    \
	CDEBUG(D_TRACE, "Process leaving.\n");			  \
	return (rc);						    \
} while (0)
#else
# error "Unkown compiler"
#endif /* __GNUC__ */

extern int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
			    const char *format1, ...)
	__attribute__ ((format (printf, 2, 3)));
+1 −1
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ ksocknal_receive (ksock_conn_t *conn)
	}

	ksocknal_connsock_decref(conn);
	RETURN (rc);
	return rc;
}

void
+6 −6
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev)

	/* must called with lnet_eq_wait_lock hold */
	if (LNET_SEQ_GT(eq->eq_deq_seq, new_event->sequence))
		RETURN(0);
		return 0;

	/* We've got a new event... */
	*ev = *new_event;
@@ -267,7 +267,7 @@ lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev)
	}

	eq->eq_deq_seq = new_event->sequence + 1;
	RETURN(rc);
	return rc;
}

/**
@@ -404,7 +404,7 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
	LASSERT (the_lnet.ln_refcount > 0);

	if (neq < 1)
		RETURN(-ENOENT);
		return -ENOENT;

	lnet_eq_wait_lock();

@@ -414,14 +414,14 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,

			if (eq == NULL) {
				lnet_eq_wait_unlock();
				RETURN(-ENOENT);
				return -ENOENT;
			}

			rc = lnet_eq_dequeue_event(eq, event);
			if (rc != 0) {
				lnet_eq_wait_unlock();
				*which = i;
				RETURN(rc);
				return rc;
			}
		}

@@ -441,5 +441,5 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms,
	}

	lnet_eq_wait_unlock();
	RETURN(0);
	return 0;
}
Loading