Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Nov 2021 20:22:31 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 5b5a48c787b8 - main - freebsd32: simplify memrange translation
Message-ID:  <202111172022.1AHKMVYW059840@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=5b5a48c787b8a4655e9782bd8ac392a79aeae1a6

commit 5b5a48c787b8a4655e9782bd8ac392a79aeae1a6
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2021-11-17 20:12:24 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2021-11-17 20:12:24 +0000

    freebsd32: simplify memrange translation
    
    Assume we've been passed a valid argument and use _IOC_NEWTYPE to
    translate the command as we do elsewhere.
    
    Reviewed by:    kevans
---
 sys/compat/freebsd32/freebsd32_ioctl.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/sys/compat/freebsd32/freebsd32_ioctl.c b/sys/compat/freebsd32/freebsd32_ioctl.c
index 4818a410586a..957c546d4daf 100644
--- a/sys/compat/freebsd32/freebsd32_ioctl.c
+++ b/sys/compat/freebsd32/freebsd32_ioctl.c
@@ -74,19 +74,7 @@ freebsd32_ioctl_memrange(struct thread *td,
 	CP(mro32, mro, mo_arg[0]);
 	CP(mro32, mro, mo_arg[1]);
 
-	com = 0;
-	switch (uap->com) {
-	case MEMRANGE_GET32:
-		com = MEMRANGE_GET;
-		break;
-
-	case MEMRANGE_SET32:
-		com = MEMRANGE_SET;
-		break;
-
-	default:
-		panic("%s: unknown MEMRANGE %#lx", __func__, uap->com);
-	}
+	com = _IOC_NEWTYPE(uap->com, struct mem_range_op);
 
 	if ((error = fo_ioctl(fp, com, (caddr_t)&mro, td->td_ucred, td)) != 0)
 		return (error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111172022.1AHKMVYW059840>