]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove unused return value from lfstackUnpack
authorDave Cheney <dave@cheney.net>
Wed, 6 Apr 2016 08:43:23 +0000 (18:43 +1000)
committerDave Cheney <dave@cheney.net>
Wed, 6 Apr 2016 21:04:43 +0000 (21:04 +0000)
None of the two places that call lfstackUnpack use the second argument.
This simplifies a followup CL that merges the lfstack{Pack,Unpack}
implementations.

Change-Id: I3c93f6259da99e113d94f8c8027584da79c1ac2c
Reviewed-on: https://go-review.googlesource.com/21595
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/lfstack.go
src/runtime/lfstack_32bit.go
src/runtime/lfstack_64bit.go
src/runtime/lfstack_amd64.go

index ea640eb12f2415671e73790814097b5ca92c4a5b..1261f54d9727c85fc625dc08ad8710c43247ab70 100644 (file)
@@ -15,7 +15,7 @@ import (
 func lfstackpush(head *uint64, node *lfnode) {
        node.pushcnt++
        new := lfstackPack(node, node.pushcnt)
-       if node1, _ := lfstackUnpack(new); node1 != node {
+       if node1 := lfstackUnpack(new); node1 != node {
                print("runtime: lfstackpush invalid packing: node=", node, " cnt=", hex(node.pushcnt), " packed=", hex(new), " -> node=", node1, "\n")
                throw("lfstackpush")
        }
@@ -34,7 +34,7 @@ func lfstackpop(head *uint64) unsafe.Pointer {
                if old == 0 {
                        return nil
                }
-               node, _ := lfstackUnpack(old)
+               node := lfstackUnpack(old)
                next := atomic.Load64(&node.next)
                if atomic.Cas64(head, old, next) {
                        return unsafe.Pointer(node)
index 36811c1e47c7040e91d0576ea87f3a133b8aa657..2f59e0212efa5a914b026f2d040b891a0313291e 100644 (file)
@@ -14,8 +14,6 @@ func lfstackPack(node *lfnode, cnt uintptr) uint64 {
        return uint64(uintptr(unsafe.Pointer(node)))<<32 | uint64(cnt)
 }
 
-func lfstackUnpack(val uint64) (node *lfnode, cnt uintptr) {
-       node = (*lfnode)(unsafe.Pointer(uintptr(val >> 32)))
-       cnt = uintptr(val)
-       return
+func lfstackUnpack(val uint64) *lfnode {
+       return (*lfnode)(unsafe.Pointer(uintptr(val >> 32)))
 }
index 27a058c7638b4a69b8c9fc5c107cb05795f435a8..07c2a141f0214fb6f8cdcdbc931f46585de26617 100644 (file)
@@ -28,8 +28,6 @@ func lfstackPack(node *lfnode, cnt uintptr) uint64 {
        return uint64(uintptr(unsafe.Pointer(node)))<<(64-addrBits) | uint64(cnt&(1<<cntBits-1))
 }
 
-func lfstackUnpack(val uint64) (node *lfnode, cnt uintptr) {
-       node = (*lfnode)(unsafe.Pointer(uintptr(val >> cntBits << 3)))
-       cnt = uintptr(val & (1<<cntBits - 1))
-       return
+func lfstackUnpack(val uint64) *lfnode {
+       return (*lfnode)(unsafe.Pointer(uintptr(val >> cntBits << 3)))
 }
index 0a71455c6be19919eac9ec7932572a2385d6cac2..6397e1d47ff384ba4adcdc36c96c6fb56c465e8c 100644 (file)
@@ -17,8 +17,6 @@ func lfstackPack(node *lfnode, cnt uintptr) uint64 {
        return uint64(uintptr(unsafe.Pointer(node)))<<16 | uint64(cnt&(1<<19-1))
 }
 
-func lfstackUnpack(val uint64) (node *lfnode, cnt uintptr) {
-       node = (*lfnode)(unsafe.Pointer(uintptr(int64(val) >> 19 << 3)))
-       cnt = uintptr(val & (1<<19 - 1))
-       return
+func lfstackUnpack(val uint64) *lfnode {
+       return (*lfnode)(unsafe.Pointer(uintptr(int64(val) >> 19 << 3)))
 }