From: James Simmons Date: Wed, 12 Aug 2015 14:25:09 +0000 (-0400) Subject: LU-6245 libcfs: remove err.h X-Git-Tag: 2.7.59~60 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=refs%2Fchanges%2F09%2F15909%2F4 LU-6245 libcfs: remove err.h With the cleanup of userland with libcfs we no longer need the special error handling macros. Change-Id: I5a7a2e1df3beef548b74703b45052ce85166f3aa Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/15909 Reviewed-by: frank zago Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/libcfs/include/libcfs/Makefile.am b/libcfs/include/libcfs/Makefile.am index 10967f6..9015bc4 100644 --- a/libcfs/include/libcfs/Makefile.am +++ b/libcfs/include/libcfs/Makefile.am @@ -11,7 +11,6 @@ EXTRA_DIST = \ bitmap.h \ byteorder.h \ curproc.h \ - err.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 index 36e9dc6..0000000 --- a/libcfs/include/libcfs/err.h +++ /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 - */ -#ifndef LIBCFS_ERR_H_ -#define LIBCFS_ERR_H_ - -#ifdef __KERNEL__ -# include -#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_ */ diff --git a/libcfs/include/libcfs/libcfs.h b/libcfs/include/libcfs/libcfs.h index e76e21c..86fe687 100644 --- a/libcfs/include/libcfs/libcfs.h +++ b/libcfs/include/libcfs/libcfs.h @@ -228,7 +228,6 @@ void cfs_srand(unsigned int, unsigned int); void cfs_get_random_bytes(void *buf, int size); #include -#include #include #include #ifdef __KERNEL__ @@ -244,7 +243,6 @@ void cfs_get_random_bytes(void *buf, int size); # include # include # include -#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) @@ -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))) +#endif /* __KERNEL__ */ + #endif /* _LIBCFS_LIBCFS_H_ */