all: make bit clear operator explicitly
Change-Id: If72588778b815bc5d8f3e9f41d888cffc0d2a18d
Reviewed-on: https://go-review.googlesource.com/c/net/+/168298
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/icmp/multipart.go b/icmp/multipart.go
index 7f88a4d..5f36675 100644
--- a/icmp/multipart.go
+++ b/icmp/multipart.go
@@ -43,7 +43,7 @@
return 128
}
r := len(b)
- return (r + align - 1) & ^(align - 1)
+ return (r + align - 1) &^ (align - 1)
}
switch proto {
case iana.ProtocolICMP:
diff --git a/internal/socket/sys.go b/internal/socket/sys.go
index 4f0eead..ee492ba 100644
--- a/internal/socket/sys.go
+++ b/internal/socket/sys.go
@@ -29,5 +29,5 @@
}
func roundup(l int) int {
- return (l + kernelAlign - 1) & ^(kernelAlign - 1)
+ return (l + kernelAlign - 1) &^ (kernelAlign - 1)
}
diff --git a/route/sys.go b/route/sys.go
index 3d0ee9b..13933f9 100644
--- a/route/sys.go
+++ b/route/sys.go
@@ -29,7 +29,7 @@
if l == 0 {
return kernelAlign
}
- return (l + kernelAlign - 1) & ^(kernelAlign - 1)
+ return (l + kernelAlign - 1) &^ (kernelAlign - 1)
}
type wireFormat struct {