From patchwork Thu Sep 11 07:20:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varka Bhadram X-Patchwork-Id: 388087 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47382140088 for ; Thu, 11 Sep 2014 17:23:32 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752687AbaIKHX2 (ORCPT ); Thu, 11 Sep 2014 03:23:28 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:37520 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751102AbaIKHX1 (ORCPT ); Thu, 11 Sep 2014 03:23:27 -0400 Received: by mail-pd0-f174.google.com with SMTP id v10so12727131pde.5 for ; Thu, 11 Sep 2014 00:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=acXwvYOU9y6tXebj9TS5m39qTsVjpZwMPPrRNoyuY9o=; b=eT2I5pg2Q10wUEUTaq4A2o+otidRwx6Uv09stMurAEdZEjTYl2QuzEvKYx9YGnsXRc xO+MgyZHjhRgUQTPWGD//pOZi0rtP+6/60PXdeo64ioFWafI1xSnJSc4Z4hQ5+tGeYOw hm1VvppO+1yWFa0vTJnj3XkSJOzzldQLXv5Rhzx8pAcW4PvcRP15xx9M524AVWja9ipL b/5riIiz3h2zebotsmqogEvipS4Fq87H8j+gcnssC2nZWKBqRftAaDWA2KVkGfl2o/Zq Ksca10ZZzn41bRE3mwy/oLOoqDU7gbjAUozCvzPmX9S+uaBGwjOOZxFeqjJIGvtx4/R9 cZAw== X-Received: by 10.70.131.101 with SMTP id ol5mr73975679pdb.77.1410420206699; Thu, 11 Sep 2014 00:23:26 -0700 (PDT) Received: from cdac.hyderabad.cdac.in ([196.12.45.164]) by mx.google.com with ESMTPSA id db2sm198084pbc.16.2014.09.11.00.23.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 00:23:25 -0700 (PDT) From: Varka Bhadram X-Google-Original-From: Varka Bhadram To: netdev@vger.kernel.org Cc: davem@davemloft.net, Thomas.Lendacky@amd.com, Varka Bhadram Subject: [PATCH net-next] ethernet: amd: use pr_info_once() Date: Thu, 11 Sep 2014 12:50:50 +0530 Message-Id: <1410420050-16088-1-git-send-email-varkab@cdac.in> X-Mailer: git-send-email 1.7.9.5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org It will use pr_info_one() to print the version info of the driver in probe function only once. No need to use the static variable here. Signed-off-by: Varka Bhadram --- drivers/net/ethernet/amd/au1000_eth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c index 31c48a7..6c323f4 100644 --- a/drivers/net/ethernet/amd/au1000_eth.c +++ b/drivers/net/ethernet/amd/au1000_eth.c @@ -1140,7 +1140,6 @@ static const struct net_device_ops au1000_netdev_ops = { static int au1000_probe(struct platform_device *pdev) { - static unsigned version_printed; struct au1000_private *aup = NULL; struct au1000_eth_platform_data *pd; struct net_device *dev = NULL; @@ -1371,9 +1370,8 @@ static int au1000_probe(struct platform_device *pdev) netdev_info(dev, "Au1xx0 Ethernet found at 0x%lx, irq %d\n", (unsigned long)base->start, irq); - if (version_printed++ == 0) - pr_info("%s version %s %s\n", - DRV_NAME, DRV_VERSION, DRV_AUTHOR); + + pr_info_once("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR); return 0;