acrn-hypervisor/hypervisor/include/debug/assert.h
Xiangyang Wu b74358d08e HV:treewide:string assigned to const object
In the hypervisor, some strings are assigned to non const
object, this violates MISRA C:2012.

Update the type of the object as const type since it always
points to string.

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2018-07-05 11:13:51 +08:00

23 lines
422 B
C

/*
* Copyright (C) 2018 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef ASSERT_H
#define ASSERT_H
#ifdef HV_DEBUG
void __assert(uint32_t line, const char *file, const char *txt);
#define ASSERT(x, ...) \
if (!(x)) {\
pr_fatal(__VA_ARGS__);\
__assert(__LINE__, __FILE__, "fatal error");\
}
#else
#define ASSERT(x, ...) do { } while(0)
#endif
#endif /* ASSERT_H */