diff --git a/arch/nvgpu-posix.yaml b/arch/nvgpu-posix.yaml index ed26d7a00..31e5a7ecf 100644 --- a/arch/nvgpu-posix.yaml +++ b/arch/nvgpu-posix.yaml @@ -48,10 +48,15 @@ headers: include/nvgpu/posix/posix-fault-injection.h, include/nvgpu/posix/probe.h, include/nvgpu/posix/soc_fuse.h, - include/nvgpu/posix/sort.h, include/nvgpu/posix/vm.h, include/nvgpu/posix/posix_vidmem.h ] +sort: + safe: yes + owner: Ajesh K + sources: [ include/nvgpu/posix/sort.h ] + deps: + bug: safe: yes owner: Ajesh K diff --git a/drivers/gpu/nvgpu/include/nvgpu/posix/sort.h b/drivers/gpu/nvgpu/include/nvgpu/posix/sort.h index 6572c75eb..60a5058fb 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/posix/sort.h +++ b/drivers/gpu/nvgpu/include/nvgpu/posix/sort.h @@ -23,13 +23,13 @@ #ifndef NVGPU_POSIX_SORT_H #define NVGPU_POSIX_SORT_H -#include +#include static void sort(void *base, size_t num, size_t size, int (*cmp)(const void *a, const void *b), void (*swap)(void *a, void *b, int n)) { - nvgpu_posix_bug("sort() not implemented yet!"); + qsort(base, num, size, cmp); } #endif /* NVGPU_POSIX_SORT_H */ diff --git a/drivers/gpu/nvgpu/include/nvgpu/sort.h b/drivers/gpu/nvgpu/include/nvgpu/sort.h index 80bae4b55..2ad62fd75 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/sort.h +++ b/drivers/gpu/nvgpu/include/nvgpu/sort.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -24,10 +24,8 @@ #ifdef __KERNEL__ #include -#elif defined(__NVGPU_POSIX__) -#include #else -#include +#include #endif #endif /* NVGPU_SORT_H */