Skip to content

Commit

Permalink
accel/amdxdna: Add missing include linux/slab.h
Browse files Browse the repository at this point in the history
When compiling without CONFIG_IA32_EMULATION, there can be some errors:

drivers/accel/amdxdna/amdxdna_mailbox.c: In function ‘mailbox_release_msg’:
drivers/accel/amdxdna/amdxdna_mailbox.c:197:2: error: implicit declaration
of function ‘kfree’.
  197 |  kfree(mb_msg);
      |  ^~~~~
drivers/accel/amdxdna/amdxdna_mailbox.c: In function ‘xdna_mailbox_send_msg’:
drivers/accel/amdxdna/amdxdna_mailbox.c:418:11: error:implicit declaration
of function ‘kzalloc’.
  418 |  mb_msg = kzalloc(sizeof(*mb_msg) + pkg_size, GFP_KERNEL);
      |           ^~~~~~~

Add the missing include.

Fixes: b87f920 ("accel/amdxdna: Support hardware mailbox")
Signed-off-by: Su Hui <[email protected]>
Reviewed-by: Lizhi Hou <[email protected]>
Reviewed-by: Jeffrey Hugo <[email protected]>
Signed-off-by: Lizhi Hou <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
Su Hui authored and houlz0507 committed Feb 19, 2025
1 parent 6586788 commit 838c17f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/accel/amdxdna/amdxdna_mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <linux/bitfield.h>
#include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/slab.h>
#include <linux/xarray.h>

#define CREATE_TRACE_POINTS
Expand Down

0 comments on commit 838c17f

Please sign in to comment.