Skip to content

Commit 677b0ce

Browse files
Colin Ian Kingliuw
authored andcommitted
drivers: hv: remove redundant assignment to pointer primary_channel
The pointer primary_channel is being assigned with a value that is never used. The assignment is redundant and can be removed. Move the definition of primary_channel to a narrower scope. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ wei: move primary_channel and update commit message ] Signed-off-by: Wei Liu <[email protected]>
1 parent 7769e18 commit 677b0ce

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/hv/channel_mgmt.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@ static void vmbus_release_relid(u32 relid)
400400

401401
void hv_process_channel_removal(struct vmbus_channel *channel)
402402
{
403-
struct vmbus_channel *primary_channel;
404403
unsigned long flags;
405404

406405
lockdep_assert_held(&vmbus_connection.channel_mutex);
@@ -425,10 +424,8 @@ void hv_process_channel_removal(struct vmbus_channel *channel)
425424

426425
if (channel->primary_channel == NULL) {
427426
list_del(&channel->listentry);
428-
429-
primary_channel = channel;
430427
} else {
431-
primary_channel = channel->primary_channel;
428+
struct vmbus_channel *primary_channel = channel->primary_channel;
432429
spin_lock_irqsave(&primary_channel->lock, flags);
433430
list_del(&channel->sc_list);
434431
spin_unlock_irqrestore(&primary_channel->lock, flags);

0 commit comments

Comments
 (0)