diff options
author | Dean Deng <deandeng@google.com> | 2019-12-16 14:40:01 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-12-16 14:41:20 -0800 |
commit | 3193b2fff8149fe43a3a59c266359e7f443a1563 (patch) | |
tree | d018b675b785815b3c7aa485e577c42b12b1ee50 /pkg/sentry/syscalls/linux | |
parent | e6f4124afd951c3b089f9c75c499c14f4d90a590 (diff) |
Drop unnecessary cast.
Bitshift operators with signed int is supported in Go 1.13.
PiperOrigin-RevId: 285853622
Diffstat (limited to 'pkg/sentry/syscalls/linux')
-rw-r--r-- | pkg/sentry/syscalls/linux/sys_poll.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_poll.go b/pkg/sentry/syscalls/linux/sys_poll.go index 631dffec6..2b2df989a 100644 --- a/pkg/sentry/syscalls/linux/sys_poll.go +++ b/pkg/sentry/syscalls/linux/sys_poll.go @@ -198,7 +198,7 @@ func doPoll(t *kernel.Task, addr usermem.Addr, nfds uint, timeout time.Duration) } // CopyInFDSet copies an fd set from select(2)/pselect(2). -func CopyInFDSet(t *kernel.Task, addr usermem.Addr, nBytes int, nBitsInLastPartialByte uint) ([]byte, error) { +func CopyInFDSet(t *kernel.Task, addr usermem.Addr, nBytes, nBitsInLastPartialByte int) ([]byte, error) { set := make([]byte, nBytes) if addr != 0 { @@ -222,7 +222,7 @@ func doSelect(t *kernel.Task, nfds int, readFDs, writeFDs, exceptFDs usermem.Add // Calculate the size of the fd sets (one bit per fd). nBytes := (nfds + 7) / 8 - nBitsInLastPartialByte := uint(nfds % 8) + nBitsInLastPartialByte := nfds % 8 // Capture all the provided input vectors. r, err := CopyInFDSet(t, readFDs, nBytes, nBitsInLastPartialByte) |