Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jun 2020 08:21:10 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        Kyle Evans <kevans@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r361994 - in head/sys/mips: cavium/cryptocteon nlm/dev/sec
Message-ID:  <2c7d50d4-1f5d-fad5-75b6-3c0e3a62d560@FreeBSD.org>
In-Reply-To: <CACNAnaFCtc-u%2BBS2AStfPXOoGxTz2QcJGvh_ppAWpPLSncioPA@mail.gmail.com>
References:  <202006100009.05A09VkH082752@repo.freebsd.org> <CACNAnaFCtc-u%2BBS2AStfPXOoGxTz2QcJGvh_ppAWpPLSncioPA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6/9/20 5:13 PM, Kyle Evans wrote:
> On Tue, Jun 9, 2020 at 7:09 PM John Baldwin <jhb@freebsd.org> wrote:
>>
>> Author: jhb
>> Date: Wed Jun 10 00:09:31 2020
>> New Revision: 361994
>> URL: https://svnweb.freebsd.org/changeset/base/361994
>>
>> Log:
>>   Add some default cases for unreachable code to silence compiler warnings.
>>
>>   This was caused by r361481 when the buffer type was changed from an
>>   int to an enum.
>>
>>   Reported by:  mjg, rpokala
>>   Sponsored by: Chelsio Communications
>>
>> Modified:
>>   head/sys/mips/cavium/cryptocteon/cryptocteon.c
>>   head/sys/mips/nlm/dev/sec/nlmseclib.c
>>
>> Modified: head/sys/mips/cavium/cryptocteon/cryptocteon.c
>> ==============================================================================
>> --- head/sys/mips/cavium/cryptocteon/cryptocteon.c      Tue Jun  9 23:03:48 2020        (r361993)
>> +++ head/sys/mips/cavium/cryptocteon/cryptocteon.c      Wed Jun 10 00:09:31 2020        (r361994)
>> @@ -323,6 +323,8 @@ cryptocteon_process(device_t dev, struct cryptop *crp,
>>                         goto done;
>>                 }
>>                 break;
>> +       default:
>> +               break;
>>         }
>>
>>         if (csp->csp_cipher_alg != 0) {
>>
> 
> This one could kind of looks like it should also be an
> __assert_unreachable(), and perhaps this bit not too long later:

This one is not.  It doesn't handle CRYPTO_BUF_CONTIG as there is nothing to do
for that case.

>         case CRYPTO_BUF_CONTIG:
>                 iovlen = crp->crp_buf.cb_buf_len;
>                 od->octo_iov[0].iov_base = crp->crp_buf.cb_buf;
>                 od->octo_iov[0].iov_len = crp->crp_buf.cb_buf_len
>                 iovcnt = 1;
>                 break;
>         default:
> -                panic("can't happen");
> +                __assert_unreachable();

This could.  I don't think we had __assert_unreachable() yet when I committed this.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2c7d50d4-1f5d-fad5-75b6-3c0e3a62d560>