Re: [PATCH][next] IB/hfi1: Use fallthrough pseudo-keyword

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 08, 2020 at 01:28:35PM -0500, Gustavo A. R. Silva wrote:
> Hi Leon,
>
> On Wed, Jul 08, 2020 at 08:47:03AM +0300, Leon Romanovsky wrote:
> > On Tue, Jul 07, 2020 at 12:39:42PM -0500, Gustavo A. R. Silva wrote:
> > > Replace the existing /* fall through */ comments and its variants with
> > > the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
> > > fall-through markings when it is the case.
> > >
> > > [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
> > >
> > > Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
> > > ---
> > >  drivers/infiniband/hw/hfi1/chip.c     |    8 ++++----
> > >  drivers/infiniband/hw/hfi1/firmware.c |   16 ----------------
> > >  drivers/infiniband/hw/hfi1/mad.c      |    9 ++++-----
> > >  drivers/infiniband/hw/hfi1/pio.c      |    2 +-
> > >  drivers/infiniband/hw/hfi1/pio_copy.c |   12 ++++++------
> > >  drivers/infiniband/hw/hfi1/platform.c |   10 +++++-----
> > >  drivers/infiniband/hw/hfi1/qp.c       |    2 +-
> > >  drivers/infiniband/hw/hfi1/qsfp.c     |    4 ++--
> > >  drivers/infiniband/hw/hfi1/rc.c       |   25 ++++++++++++-------------
> > >  drivers/infiniband/hw/hfi1/sdma.c     |    9 ++++-----
> > >  drivers/infiniband/hw/hfi1/tid_rdma.c |    4 ++--
> > >  drivers/infiniband/hw/hfi1/uc.c       |    8 ++++----
> > >  12 files changed, 45 insertions(+), 64 deletions(-)
> > >
> > > diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c
> > > index 15f9c635f292..132f1df6f23b 100644
> > > --- a/drivers/infiniband/hw/hfi1/chip.c
> > > +++ b/drivers/infiniband/hw/hfi1/chip.c
> > > @@ -7320,7 +7320,7 @@ static u16 link_width_to_bits(struct hfi1_devdata *dd, u16 width)
> > >  	default:
> > >  		dd_dev_info(dd, "%s: invalid width %d, using 4\n",
> > >  			    __func__, width);
> > > -		/* fall through */
> > > +		fallthrough;
> > >  	case 4: return OPA_LINK_WIDTH_4X;
> >
> > "case ..:" after "default:" ???
> > IMHO, it should be written in more standard way.
> >
>
> I agree. However, that piece of code, and the other below, does not
> concern to this patch.

I'm not super excited about such half-baked solutions. Let's fix all at
once by pre-patch or post-patch to this change.

Thanks



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux