All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Lars Ellenberg <lars.ellenberg@linbit.com>
Cc: Philipp Reisner <philipp.reisner@linbit.com>,
	Jens Axboe <axboe@kernel.dk>,
	drbd-dev@lists.linbit.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH RESEND] drbd: avoid clang warning about pointless switch statement
Date: Thu, 4 Oct 2018 12:22:31 -0700	[thread overview]
Message-ID: <20181004192231.GA29744@localhost> (raw)
In-Reply-To: <20181004191854.GD10984@soda.linbit>

On Thu, Oct 04, 2018 at 09:18:54PM +0200, Lars Ellenberg wrote:
> On Tue, Oct 02, 2018 at 10:14:48AM -0700, Nathan Chancellor wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > The drbd code causes warnings that we cannot easily disable when building with clang:
> > 
> > In file included from drivers/block/drbd/drbd_debugfs.c:10:
> > In file included from drivers/block/drbd/drbd_int.h:48:
> > In file included from include/linux/drbd_genl_api.h:53:
> > In file included from include/linux/genl_magic_struct.h:237:
> > include/linux/drbd_genl.h:300:1: warning: no case matching constant switch condition '0'
> > 
> > There is nothing wrong with the code, and adding 'default:' labels
> > in the right place is enough to let clang shut up about the warning.
> 
> Actually, I think I'd prefer a "case 0:" instead of the "default:",
> because that would assert that we don't use a 0 for op or field numbers.
> 
> As at least some people seem to care, I suggest we bundle up
> this and the other clang warning you just resent the patch for
> with whatever else we may come up with for the next merge window
> and send a pull request to Jens then.
> In case we forget, please send a friendly reminder.
> 
> Thanks,
> 
>     Lars
> 

Hi Lars,

I will go ahead and test that change shortly and send it over for
review.

Thanks for the quick reply!
Nathan

WARNING: multiple messages have this Message-ID (diff)
From: Nathan Chancellor <natechancellor@gmail.com>
To: Lars Ellenberg <lars.ellenberg@linbit.com>
Cc: Jens Axboe <axboe@kernel.dk>, Arnd Bergmann <arnd@arndb.de>,
	Philipp Reisner <philipp.reisner@linbit.com>,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] [PATCH RESEND] drbd: avoid clang warning about pointless switch statement
Date: Thu, 4 Oct 2018 12:22:31 -0700	[thread overview]
Message-ID: <20181004192231.GA29744@localhost> (raw)
In-Reply-To: <20181004191854.GD10984@soda.linbit>

On Thu, Oct 04, 2018 at 09:18:54PM +0200, Lars Ellenberg wrote:
> On Tue, Oct 02, 2018 at 10:14:48AM -0700, Nathan Chancellor wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > The drbd code causes warnings that we cannot easily disable when building with clang:
> > 
> > In file included from drivers/block/drbd/drbd_debugfs.c:10:
> > In file included from drivers/block/drbd/drbd_int.h:48:
> > In file included from include/linux/drbd_genl_api.h:53:
> > In file included from include/linux/genl_magic_struct.h:237:
> > include/linux/drbd_genl.h:300:1: warning: no case matching constant switch condition '0'
> > 
> > There is nothing wrong with the code, and adding 'default:' labels
> > in the right place is enough to let clang shut up about the warning.
> 
> Actually, I think I'd prefer a "case 0:" instead of the "default:",
> because that would assert that we don't use a 0 for op or field numbers.
> 
> As at least some people seem to care, I suggest we bundle up
> this and the other clang warning you just resent the patch for
> with whatever else we may come up with for the next merge window
> and send a pull request to Jens then.
> In case we forget, please send a friendly reminder.
> 
> Thanks,
> 
>     Lars
> 

Hi Lars,

I will go ahead and test that change shortly and send it over for
review.

Thanks for the quick reply!
Nathan

  reply	other threads:[~2018-10-04 19:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 17:14 [PATCH RESEND] drbd: avoid clang warning about pointless switch statement Nathan Chancellor
2018-10-02 17:14 ` [Drbd-dev] " Nathan Chancellor
2018-10-04 19:18 ` Lars Ellenberg
2018-10-04 19:18   ` [Drbd-dev] " Lars Ellenberg
2018-10-04 19:22   ` Nathan Chancellor [this message]
2018-10-04 19:22     ` Nathan Chancellor
2018-10-04 20:09 ` [PATCH v2] drbd: Avoid Clang warning about pointless switch statment Nathan Chancellor
2018-10-04 20:09   ` [Drbd-dev] " Nathan Chancellor
2018-12-17 17:24   ` Nathan Chancellor
2018-12-17 17:29     ` Jens Axboe
2018-12-17 17:29       ` [Drbd-dev] " Jens Axboe
2018-12-18  9:22       ` Lars Ellenberg
2018-12-18  9:22         ` [Drbd-dev] " Lars Ellenberg
2018-12-18 13:29         ` Jens Axboe
2018-12-18 13:29           ` [Drbd-dev] " Jens Axboe

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=20181004192231.GA29744@localhost \
    --to=natechancellor@gmail.com \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipp.reisner@linbit.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.