lkml.org 
[lkml]   [2018]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cachefiles: Explicitly cast enumerated type in put_object
On Mon, Sep 24, 2018 at 10:33:44AM -0700, Nathan Chancellor wrote:
> Clang warns when one enumerated type is implicitly converted to another.
>
> fs/cachefiles/namei.c:247:50: warning: implicit conversion from
> enumeration type 'enum cachefiles_obj_ref_trace' to different
> enumeration type 'enum fscache_obj_ref_trace' [-Wenum-conversion]
> cache->cache.ops->put_object(&xobject->fscache,
> cachefiles_obj_put_wait_retry);
>
> Silence this warning by explicitly casting to fscache_obj_ref_trace,
> which is also done in put_object.
>
> Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
> fs/cachefiles/namei.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
> index af2b17b21b94..15e5988a83de 100644
> --- a/fs/cachefiles/namei.c
> +++ b/fs/cachefiles/namei.c
> @@ -244,11 +244,13 @@ static int cachefiles_mark_object_active(struct cachefiles_cache *cache,
>
> ASSERT(!test_bit(CACHEFILES_OBJECT_ACTIVE, &xobject->flags));
>
> - cache->cache.ops->put_object(&xobject->fscache, cachefiles_obj_put_wait_retry);
> + cache->cache.ops->put_object(&xobject->fscache,
> + (enum fscache_obj_ref_trace)cachefiles_obj_put_wait_retry);
> goto try_again;
>
> requeue:
> - cache->cache.ops->put_object(&xobject->fscache, cachefiles_obj_put_wait_timeo);
> + cache->cache.ops->put_object(&xobject->fscache,
> + (enum fscache_obj_ref_trace)cachefiles_obj_put_wait_timeo);
> _leave(" = -ETIMEDOUT");
> return -ETIMEDOUT;
> }
> --
> 2.19.0
>

Hi David,

Have you had a chance to take a look at this patch?

Thanks,
Nathan

\
 
 \ /
  Last update: 2018-11-05 23:03    [W:0.170 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site