Fix USB/IP lint and vet issues
This commit is contained in:
@@ -155,11 +155,7 @@ func (c *ClientService) initializeWorkers() {
|
||||
|
||||
func (c *ClientService) run() {
|
||||
defer c.wg.Done()
|
||||
immediate := true
|
||||
for {
|
||||
if !immediate && !sleepCtx(c.ctx, clientReconnectDelay) {
|
||||
break
|
||||
}
|
||||
for immediate := true; immediate || sleepCtx(c.ctx, clientReconnectDelay); {
|
||||
err := c.runSession()
|
||||
if c.ctx.Err() != nil {
|
||||
break
|
||||
|
||||
@@ -172,11 +172,7 @@ func (c *ClientService) initializeWorkers() {
|
||||
|
||||
func (c *ClientService) run() {
|
||||
defer c.wg.Done()
|
||||
immediate := true
|
||||
for {
|
||||
if !immediate && !sleepCtx(c.ctx, clientReconnectDelay) {
|
||||
break
|
||||
}
|
||||
for immediate := true; immediate || sleepCtx(c.ctx, clientReconnectDelay); {
|
||||
err := c.runSession()
|
||||
if c.ctx.Err() != nil {
|
||||
break
|
||||
|
||||
@@ -271,6 +271,7 @@ func (s *ServerService) acceptLoop(ln net.Listener) {
|
||||
if E.IsClosed(err) {
|
||||
return
|
||||
}
|
||||
//nolint:staticcheck // Keep parity with Linux accept retry handling.
|
||||
if netError, isNetError := err.(net.Error); isNetError && netError.Temporary() {
|
||||
s.logger.Error("accept: ", err)
|
||||
if !sleepCtx(s.ctx, 200*time.Millisecond) {
|
||||
|
||||
@@ -64,6 +64,7 @@ type darwinCIMessage struct {
|
||||
control uint32
|
||||
data0 uint32
|
||||
data1 uint64
|
||||
buffer unsafe.Pointer
|
||||
}
|
||||
|
||||
type darwinCITransfer struct {
|
||||
@@ -255,6 +256,7 @@ func (s *darwinUSBHostEndpointSM) currentTransfer() darwinCITransfer {
|
||||
control: uint32(ptr.control),
|
||||
data0: uint32(ptr.data0),
|
||||
data1: uint64(ptr.data1),
|
||||
buffer: C.box_usbhost_ci_normal_buffer(ptr),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -313,7 +315,7 @@ func (m darwinCIMessage) normalLength() uint32 {
|
||||
}
|
||||
|
||||
func (m darwinCIMessage) bufferPointer() unsafe.Pointer {
|
||||
return unsafe.Pointer(uintptr(m.data1))
|
||||
return m.buffer
|
||||
}
|
||||
|
||||
func darwinCIFrameTimestamp() uint64 {
|
||||
|
||||
Reference in New Issue
Block a user