Whamcloud - gitweb
LU-6245 libcfs: remove err.h 09/15909/4
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 12 Aug 2015 14:25:09 +0000 (10:25 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 18 Aug 2015 11:17:07 +0000 (11:17 +0000)
With the cleanup of userland with libcfs we no longer
need the special error handling macros.

Change-Id: I5a7a2e1df3beef548b74703b45052ce85166f3aa
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/15909
Reviewed-by: frank zago <fzago@cray.com>
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/Makefile.am
libcfs/include/libcfs/err.h [deleted file]
libcfs/include/libcfs/libcfs.h

index 10967f6..9015bc4 100644 (file)
@@ -11,7 +11,6 @@ EXTRA_DIST = \
        bitmap.h \
        byteorder.h \
        curproc.h \
        bitmap.h \
        byteorder.h \
        curproc.h \
-       err.h \
        libcfs.h \
        libcfs_cpu.h \
        libcfs_crypto.h \
        libcfs.h \
        libcfs_cpu.h \
        libcfs_crypto.h \
diff --git a/libcfs/include/libcfs/err.h b/libcfs/include/libcfs/err.h
deleted file mode 100644 (file)
index 36e9dc6..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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_ */
index e76e21c..86fe687 100644 (file)
@@ -228,7 +228,6 @@ void cfs_srand(unsigned int, unsigned int);
 void cfs_get_random_bytes(void *buf, int size);
 
 #include <libcfs/byteorder.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_debug.h>
 #include <libcfs/libcfs_private.h>
 #ifdef __KERNEL__
@@ -244,7 +243,6 @@ void cfs_get_random_bytes(void *buf, int size);
 # include <libcfs/libcfs_hash.h>
 # include <libcfs/libcfs_heap.h>
 # include <libcfs/libcfs_fail.h>
 # 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)
 
 /* container_of depends on "likely" which is defined in libcfs_private.h */
 static inline void *__container_of(const void *ptr, unsigned long shift)
@@ -258,4 +256,6 @@ static inline void *__container_of(const void *ptr, unsigned long shift)
 #define container_of0(ptr, type, member)                               \
        ((type *)__container_of((ptr), offsetof(type, member)))
 
 #define container_of0(ptr, type, member)                               \
        ((type *)__container_of((ptr), offsetof(type, member)))
 
+#endif /* __KERNEL__ */
+
 #endif /* _LIBCFS_LIBCFS_H_ */
 #endif /* _LIBCFS_LIBCFS_H_ */