Re: [PATCH V3] drm: handle error values properly

2018-08-31 Thread Nicholas Mc Guire
On Wed, Jul 18, 2018 at 11:14:04AM +0200, Nicholas Mc Guire wrote: > drm_legacy_ctxbitmap_next() returns idr_alloc() which can return > -ENOMEM, -EINVAL or -ENOSPC none of which are -1. since drm_context_t > is an unsigned int an intermediate variable is used to handle the > error cases, and then c

[PATCH V3] drm: handle error values properly

2018-07-18 Thread Nicholas Mc Guire
drm_legacy_ctxbitmap_next() returns idr_alloc() which can return -ENOMEM, -EINVAL or -ENOSPC none of which are -1. since drm_context_t is an unsigned int an intermediate variable is used to handle the error cases, and then cast to drm_context_t after ensuring that the value is >= 0. The explicit ca