Skip to content

Commit b7e768b

Browse files
nathanchancedhowells
authored andcommitted
cachefiles: Explicitly cast enumerated type in put_object
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> Signed-off-by: David Howells <dhowells@redhat.com>
1 parent c5a94f4 commit b7e768b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎fs/cachefiles/namei.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,13 @@ static int cachefiles_mark_object_active(struct cachefiles_cache *cache,
244244

245245
ASSERT(!test_bit(CACHEFILES_OBJECT_ACTIVE, &xobject->flags));
246246

247-
cache->cache.ops->put_object(&xobject->fscache, cachefiles_obj_put_wait_retry);
247+
cache->cache.ops->put_object(&xobject->fscache,
248+
(enum fscache_obj_ref_trace)cachefiles_obj_put_wait_retry);
248249
goto try_again;
249250

250251
requeue:
251-
cache->cache.ops->put_object(&xobject->fscache, cachefiles_obj_put_wait_timeo);
252+
cache->cache.ops->put_object(&xobject->fscache,
253+
(enum fscache_obj_ref_trace)cachefiles_obj_put_wait_timeo);
252254
_leave(" = -ETIMEDOUT");
253255
return -ETIMEDOUT;
254256
}

0 commit comments

Comments
 (0)