Re: svn commit: r361994 - in head/sys/mips: cavium/cryptocteon nlm/dev/sec

2020-06-10 Thread John Baldwin
On 6/9/20 5:13 PM, Kyle Evans wrote:
> On Tue, Jun 9, 2020 at 7:09 PM John Baldwin  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
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361994 - in head/sys/mips: cavium/cryptocteon nlm/dev/sec

2020-06-09 Thread Kyle Evans
On Tue, Jun 9, 2020 at 7:09 PM John Baldwin  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:

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();
   }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361994 - in head/sys/mips: cavium/cryptocteon nlm/dev/sec

2020-06-09 Thread John Baldwin
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) {

Modified: head/sys/mips/nlm/dev/sec/nlmseclib.c
==
--- head/sys/mips/nlm/dev/sec/nlmseclib.c   Tue Jun  9 23:03:48 2020
(r361993)
+++ head/sys/mips/nlm/dev/sec/nlmseclib.c   Wed Jun 10 00:09:31 2020
(r361994)
@@ -157,6 +157,8 @@ nlm_crypto_form_srcdst_segs(struct xlp_sec_command *cm
crp->crp_buf.cb_buf, crp->crp_buf.cb_buf_len);
}
break;
+   default:
+   __assert_unreachable();
}
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"