Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422708AbbENQGw (ORCPT ); Thu, 14 May 2015 12:06:52 -0400 Received: from mail-qc0-f176.google.com ([209.85.216.176]:33988 "EHLO mail-qc0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422676AbbENQGr (ORCPT ); Thu, 14 May 2015 12:06:47 -0400 From: Tejun Heo To: akpm@linux-foundation.org Cc: davem@davemloft.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Tejun Heo Subject: [PATCH 4/7] netconsole: remove unnecessary netconsole_target_get/out() from write_msg() Date: Thu, 14 May 2015 12:06:23 -0400 Message-Id: <1431619586-29187-5-git-send-email-tj@kernel.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1431619586-29187-1-git-send-email-tj@kernel.org> References: <1431619586-29187-1-git-send-email-tj@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1551 Lines: 43 write_msg() grabs target_list_lock and walks target_list invoking netpool_send_udp() on each target. Curiously, it protects each iteration with netconsole_target_get/put() even though it never releases target_list_lock which protects all the members. While this doesn't harm anything, it doesn't serve any purpose either. The items on the list can't go away while target_list_lock is held. Remove the unnecessary get/put pair. Signed-off-by: Tejun Heo Cc: David Miller --- drivers/net/netconsole.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 15731d1..30c0524 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -744,7 +744,6 @@ static void write_msg(struct console *con, const char *msg, unsigned int len) spin_lock_irqsave(&target_list_lock, flags); list_for_each_entry(nt, &target_list, list) { - netconsole_target_get(nt); if (nt->enabled && netif_running(nt->np.dev)) { /* * We nest this inside the for-each-target loop above @@ -760,7 +759,6 @@ static void write_msg(struct console *con, const char *msg, unsigned int len) left -= frag; } } - netconsole_target_put(nt); } spin_unlock_irqrestore(&target_list_lock, flags); } -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/