Commit f2090594 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by Stefan Richter

firewire net: Omit checking dev->broadcast_rcv_context in fwnet_broadcast_start().

dev->broadcast_rcv_context is always non-NULL if dev->broadcast_state is
not FWNET_BROADCAST_ERROR.
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent f60bac4b
...@@ -1154,6 +1154,7 @@ static int fwnet_broadcast_start(struct fwnet_device *dev) ...@@ -1154,6 +1154,7 @@ static int fwnet_broadcast_start(struct fwnet_device *dev)
unsigned max_receive; unsigned max_receive;
struct fw_iso_packet packet; struct fw_iso_packet packet;
unsigned long offset; unsigned long offset;
void **ptrptr;
unsigned u; unsigned u;
if (dev->broadcast_state != FWNET_BROADCAST_ERROR) if (dev->broadcast_state != FWNET_BROADCAST_ERROR)
...@@ -1162,19 +1163,17 @@ static int fwnet_broadcast_start(struct fwnet_device *dev) ...@@ -1162,19 +1163,17 @@ static int fwnet_broadcast_start(struct fwnet_device *dev)
max_receive = 1U << (dev->card->max_receive + 1); max_receive = 1U << (dev->card->max_receive + 1);
num_packets = (FWNET_ISO_PAGE_COUNT * PAGE_SIZE) / max_receive; num_packets = (FWNET_ISO_PAGE_COUNT * PAGE_SIZE) / max_receive;
if (!dev->broadcast_rcv_context) { context = fw_iso_context_create(dev->card, FW_ISO_CONTEXT_RECEIVE,
void **ptrptr; IEEE1394_BROADCAST_CHANNEL,
dev->card->link_speed, 8,
context = fw_iso_context_create(dev->card, fwnet_receive_broadcast, dev);
FW_ISO_CONTEXT_RECEIVE, IEEE1394_BROADCAST_CHANNEL,
dev->card->link_speed, 8, fwnet_receive_broadcast, dev);
if (IS_ERR(context)) { if (IS_ERR(context)) {
retval = PTR_ERR(context); retval = PTR_ERR(context);
goto failed_context_create; goto failed_context_create;
} }
retval = fw_iso_buffer_init(&dev->broadcast_rcv_buffer, retval = fw_iso_buffer_init(&dev->broadcast_rcv_buffer, dev->card,
dev->card, FWNET_ISO_PAGE_COUNT, DMA_FROM_DEVICE); FWNET_ISO_PAGE_COUNT, DMA_FROM_DEVICE);
if (retval < 0) if (retval < 0)
goto failed_buffer_init; goto failed_buffer_init;
...@@ -1191,13 +1190,9 @@ static int fwnet_broadcast_start(struct fwnet_device *dev) ...@@ -1191,13 +1190,9 @@ static int fwnet_broadcast_start(struct fwnet_device *dev)
ptr = kmap(dev->broadcast_rcv_buffer.pages[u]); ptr = kmap(dev->broadcast_rcv_buffer.pages[u]);
for (v = 0; v < num_packets / FWNET_ISO_PAGE_COUNT; v++) for (v = 0; v < num_packets / FWNET_ISO_PAGE_COUNT; v++)
*ptrptr++ = (void *) *ptrptr++ = (void *) ((char *)ptr + v * max_receive);
((char *)ptr + v * max_receive);
} }
dev->broadcast_rcv_context = context; dev->broadcast_rcv_context = context;
} else {
context = dev->broadcast_rcv_context;
}
packet.payload_length = max_receive; packet.payload_length = max_receive;
packet.interrupt = 1; packet.interrupt = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment