[PATCH AUTOSEL 4.19 107/123] cachefiles: Explicitly cast enumerated type in put_object

2018-12-05 Thread Sasha Levin
From: Nathan Chancellor 

[ Upstream commit b7e768b7e3522695ed36dcb48ecdcd344bd30a9b ]

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(>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 
Signed-off-by: Nathan Chancellor 
Signed-off-by: David Howells 
Signed-off-by: Sasha Levin 
---
 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 95983c744164..5ab411d4bc59 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, >flags));
 
-   cache->cache.ops->put_object(>fscache, 
cachefiles_obj_put_wait_retry);
+   cache->cache.ops->put_object(>fscache,
+   (enum fscache_obj_ref_trace)cachefiles_obj_put_wait_retry);
goto try_again;
 
 requeue:
-   cache->cache.ops->put_object(>fscache, 
cachefiles_obj_put_wait_timeo);
+   cache->cache.ops->put_object(>fscache,
+   (enum fscache_obj_ref_trace)cachefiles_obj_put_wait_timeo);
_leave(" = -ETIMEDOUT");
return -ETIMEDOUT;
 }
-- 
2.17.1



[PATCH AUTOSEL 4.19 107/123] cachefiles: Explicitly cast enumerated type in put_object

2018-12-05 Thread Sasha Levin
From: Nathan Chancellor 

[ Upstream commit b7e768b7e3522695ed36dcb48ecdcd344bd30a9b ]

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(>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 
Signed-off-by: Nathan Chancellor 
Signed-off-by: David Howells 
Signed-off-by: Sasha Levin 
---
 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 95983c744164..5ab411d4bc59 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, >flags));
 
-   cache->cache.ops->put_object(>fscache, 
cachefiles_obj_put_wait_retry);
+   cache->cache.ops->put_object(>fscache,
+   (enum fscache_obj_ref_trace)cachefiles_obj_put_wait_retry);
goto try_again;
 
 requeue:
-   cache->cache.ops->put_object(>fscache, 
cachefiles_obj_put_wait_timeo);
+   cache->cache.ops->put_object(>fscache,
+   (enum fscache_obj_ref_trace)cachefiles_obj_put_wait_timeo);
_leave(" = -ETIMEDOUT");
return -ETIMEDOUT;
 }
-- 
2.17.1