+++ /dev/null
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * 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 version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.gnu.org/licenses/gpl-2.0.html
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2014, Intel Corporation.
- * Author: John L. Hammond <john.hammond@intel.com>
- */
-#ifndef LIBCFS_ERR_H_
-#define LIBCFS_ERR_H_
-
-#ifdef __KERNEL__
-# include <linux/err.h>
-#else /* __KERNEL__ */
-
-# define IS_ERR_VALUE(x) ((x) >= (unsigned long)-4095)
-
-static inline void *ERR_PTR(long error)
-{
- return (void *)error;
-}
-
-static inline long PTR_ERR(const void *ptr)
-{
- return (long)ptr;
-}
-
-static inline long IS_ERR(const void *ptr)
-{
- return IS_ERR_VALUE((unsigned long)ptr);
-}
-
-static inline long IS_ERR_OR_NULL(const void *ptr)
-{
- return IS_ERR_VALUE((unsigned long)ptr) || ptr == NULL;
-}
-
-/**
- * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
- * @ptr: The pointer to cast.
- *
- * Explicitly cast an error-valued pointer to another pointer type in such a
- * way as to make it clear that's what's going on.
- */
-static inline void *ERR_CAST(const void *ptr)
-{
- /* Cast away the const. */
- return (void *)ptr;
-}
-
-# endif /* !__KERNEL__ */
-
-#endif /* LIBCFS_ERR_H_ */
void cfs_get_random_bytes(void *buf, int size);
#include <libcfs/byteorder.h>
-#include <libcfs/err.h>
#include <libcfs/libcfs_debug.h>
#include <libcfs/libcfs_private.h>
#ifdef __KERNEL__
# include <libcfs/libcfs_hash.h>
# include <libcfs/libcfs_heap.h>
# include <libcfs/libcfs_fail.h>
-#endif /* __KERNEL__ */
/* container_of depends on "likely" which is defined in libcfs_private.h */
static inline void *__container_of(const void *ptr, unsigned long shift)
#define container_of0(ptr, type, member) \
((type *)__container_of((ptr), offsetof(type, member)))
+#endif /* __KERNEL__ */
+
#endif /* _LIBCFS_LIBCFS_H_ */