[PATCH] drm/amd/display: include linux/slab.h where needed

Arnd Bergmann arnd at arndb.de
Tue Dec 10 20:51:49 UTC 2019


On Tue, Dec 10, 2019 at 9:30 PM Kazlauskas, Nicholas
<nicholas.kazlauskas at amd.com> wrote:
>
> On 2019-12-10 2:59 p.m., Arnd Bergmann wrote:
> > Calling kzalloc() and related functions requires the
> > linux/slab.h header to be included:
> >
> > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c: In function 'dcn21_ipp_create':
> > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c:679:3: error: implicit declaration of function 'kzalloc'; did you mean 'd_alloc'? [-Werror=implicit-function-declaration]
> >     kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL);
> >
> > A lot of other headers also miss a direct include in this file,
> > but this is the only one that causes a problem for now.
> >
> > Signed-off-by: Arnd Bergmann <arnd at arndb.de>
>
> What version of the kernel are you building?

This is v5.5-rc1, plus some local patches.

> We have:
>
> #include <linux/slab.h>
>
> in os_types.h which gets included as part of this file:
>
> #include <dc.h> -> #include <dc_types.h> -> #include <os_types.h>

I don't see linux/slab.h in os_types.h. I now see that commit
4fc4dca8320e ("drm/amd: drop use of drmp.h in os_types.h")
was merged into linux-5.3, which may have caused this.

I also don't see anything in os_types.h that needs linux/slab.h.

    Arnd


More information about the amd-gfx mailing list