iPXE
mlx_bail.h
Go to the documentation of this file.
00001 #ifndef INCLUDE_PUBLIC_MLXBAIL_H_
00002 #define INCLUDE_PUBLIC_MLXBAIL_H_
00003 
00004 /*
00005  * Copyright (C) 2015 Mellanox Technologies Ltd.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301, USA.
00021  */
00022 
00023 FILE_LICENCE ( GPL2_OR_LATER );
00024 
00025 #include "mlx_types.h"
00026 
00027 #define MLX_BAIL_ERROR(id, status,message) MLX_CHECK_STATUS(id, status, bail, message)
00028 
00029 #define MLX_FATAL_CHECK_STATUS(status, label, message)                                          \
00030         do {                                                                                                                                    \
00031             if (status != MLX_SUCCESS) {                                                                                \
00032                 MLX_DEBUG_FATAL_ERROR(message " (Status = %d)\n", status);      \
00033                 goto label;                                                                                                             \
00034             }                                                                                                                                   \
00035         } while (0)
00036 
00037 #define MLX_CHECK_STATUS(id, status, label, message)                                    \
00038         do {                                                                                                                    \
00039             if (status != MLX_SUCCESS) {                                                                \
00040                 MLX_DEBUG_ERROR(id, message " (Status = %d)\n", status);\
00041                 goto label;                                                                                             \
00042             }                                                                                                                   \
00043         } while (0)
00044 
00045 
00046 
00047 #endif /* INCLUDE_PUBLIC_MLXBAIL_H_ */