Don't test boolean return against != 1.

Don't needlessly assign the error variable in an if statement.
This commit is contained in:
Poul-Henning Kamp 1999-10-29 19:03:18 +00:00
parent 923502ff91
commit 7254edcfaf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52636
2 changed files with 8 additions and 8 deletions

View File

@ -662,8 +662,8 @@ pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
/*
* Check the user's buffer to make sure it's readable.
*/
if ((error = useracc((caddr_t)cio->patterns,
cio->pat_buf_len, B_READ)) != 1){
if (!useracc((caddr_t)cio->patterns,
cio->pat_buf_len, B_READ)) {
printf("pci_ioctl: pattern buffer %p, "
"length %u isn't user accessible for"
" READ\n", cio->patterns,
@ -698,8 +698,8 @@ pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
/*
* Make sure we can write to the match buffer.
*/
if ((error = useracc((caddr_t)cio->matches, cio->match_buf_len,
B_WRITE)) != 1) {
if (!useracc((caddr_t)cio->matches,
cio->match_buf_len, B_WRITE)) {
printf("pci_ioctl: match buffer %p, length %u "
"isn't user accessible for WRITE\n",
cio->matches, cio->match_buf_len);

View File

@ -662,8 +662,8 @@ pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
/*
* Check the user's buffer to make sure it's readable.
*/
if ((error = useracc((caddr_t)cio->patterns,
cio->pat_buf_len, B_READ)) != 1){
if (!useracc((caddr_t)cio->patterns,
cio->pat_buf_len, B_READ)) {
printf("pci_ioctl: pattern buffer %p, "
"length %u isn't user accessible for"
" READ\n", cio->patterns,
@ -698,8 +698,8 @@ pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
/*
* Make sure we can write to the match buffer.
*/
if ((error = useracc((caddr_t)cio->matches, cio->match_buf_len,
B_WRITE)) != 1) {
if (!useracc((caddr_t)cio->matches,
cio->match_buf_len, B_WRITE)) {
printf("pci_ioctl: match buffer %p, length %u "
"isn't user accessible for WRITE\n",
cio->matches, cio->match_buf_len);