mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
|
|
|
|
#include <drm/ttm/ttm_resource.h>
|
|
#include <drm/ttm/ttm_device.h>
|
|
#include <drm/ttm/ttm_placement.h>
|
|
#include <linux/slab.h>
|
|
|
|
#include "ttm_module.h"
|
|
|
|
static int ttm_sys_man_alloc(struct ttm_resource_manager *man,
|
|
struct ttm_buffer_object *bo,
|
|
const struct ttm_place *place,
|
|
struct ttm_resource **res)
|
|
{
|
|
*res = kzalloc_obj(**res);
|
|
if (!*res)
|
|
return -ENOMEM;
|
|
|
|
ttm_resource_init(bo, place, *res);
|
|
return 0;
|
|
}
|
|
|
|
static void ttm_sys_man_free(struct ttm_resource_manager *man,
|
|
struct ttm_resource *res)
|
|
{
|
|
ttm_resource_fini(man, res);
|
|
kfree(res);
|
|
}
|
|
|
|
static const struct ttm_resource_manager_func ttm_sys_manager_func = {
|
|
.alloc = ttm_sys_man_alloc,
|
|
.free = ttm_sys_man_free,
|
|
};
|
|
|
|
void ttm_sys_man_init(struct ttm_device *bdev)
|
|
{
|
|
struct ttm_resource_manager *man = &bdev->sysman;
|
|
|
|
/*
|
|
* Initialize the system memory buffer type.
|
|
* Other types need to be driver / IOCTL initialized.
|
|
*/
|
|
man->use_tt = true;
|
|
man->func = &ttm_sys_manager_func;
|
|
|
|
ttm_resource_manager_init(man, bdev, 0);
|
|
ttm_set_driver_manager(bdev, TTM_PL_SYSTEM, man);
|
|
ttm_resource_manager_set_used(man, true);
|
|
}
|