diff --git a/drivers/gpu/nvgpu/include/nvgpu/posix/bug.h b/drivers/gpu/nvgpu/include/nvgpu/posix/bug.h index 4cfd7ef7b..00c46168e 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/posix/bug.h +++ b/drivers/gpu/nvgpu/include/nvgpu/posix/bug.h @@ -33,7 +33,7 @@ * Implementation is specific to OS. For QNX and Posix implementation * refer to nvgpu_posix_bug. */ -#define BUG() nvgpu_posix_bug("") +#define BUG() nvgpu_posix_bug(__func__, __LINE__) /** Macro to handle a buggy code only upon meeting the condition. */ #define BUG_ON(cond) \ @@ -72,12 +72,12 @@ void dump_stack(void); /** * @brief Bug. * - * @param fmt [in] Format of variable argument list. - * @param ... [in] Variable length arguments. + * @param msg [in] Message to be printed in log. + * @param line_no [in] Line number. * * Function to be invoked upon identifying bug in the code. */ -void nvgpu_posix_bug(const char *fmt, ...) __attribute__ ((noreturn)); +void nvgpu_posix_bug(const char *msg, int line_no) __attribute__ ((noreturn)); /** * @brief Issues Warning. diff --git a/drivers/gpu/nvgpu/os/posix/bug.c b/drivers/gpu/nvgpu/os/posix/bug.c index 09ec71d42..807ef8ff1 100644 --- a/drivers/gpu/nvgpu/os/posix/bug.c +++ b/drivers/gpu/nvgpu/os/posix/bug.c @@ -126,12 +126,12 @@ void nvgpu_bug_unregister_cb(struct nvgpu_bug_cb *cb) /* * Ahhh! A bug! */ -void nvgpu_posix_bug(const char *fmt, ...) +void nvgpu_posix_bug(const char *msg, int line_no) { int err; struct nvgpu_bug_cb *cb; - nvgpu_err(NULL, "BUG detected!"); + nvgpu_err(NULL, "%s:%d BUG detected!", msg, line_no); #ifndef __NVGPU_UNIT_TEST__ dump_stack(); #endif