linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-cachefs@redhat.com, linux-kernel@vger.kernel.org,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] cachefiles: Explicitly cast enumerated type in put_object
Date: Mon, 5 Nov 2018 15:01:11 -0700	[thread overview]
Message-ID: <20181105220111.GA7640@flashbox> (raw)
In-Reply-To: <20180924173344.27952-1-natechancellor@gmail.com>

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

      parent reply	other threads:[~2018-11-05 22:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 17:33 [PATCH] cachefiles: Explicitly cast enumerated type in put_object Nathan Chancellor
2018-09-24 22:17 ` Nick Desaulniers
2018-11-05 22:01 ` Nathan Chancellor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181105220111.GA7640@flashbox \
    --to=natechancellor@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).