blob: 97693a2a1f01aa3af6f00b7d2b3f6424febde1f6 [file] [log] [blame]
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* erofs_error.h
*
* Copyright (C) 2018 HUAWEI, Inc.
* http://www.huawei.com/
* Created by Li Guifu <bluce.liguifu@huawei.com>
*/
#ifndef __EROFS_ERROR_H
#define __EROFS_ERROR_H
#define MAX_ERRNO (4095)
#define IS_ERR_VALUE(x) \
((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
static inline void *ERR_PTR(long error)
{
return (void *)error;
}
static inline int IS_ERR(const void *ptr)
{
return IS_ERR_VALUE((unsigned long)ptr);
}
#endif