From: Jack Morgenstein <jackm@dev.mellanox.co.il>
To: general@lists.openfabrics.org
Cc: Roland Dreier <rdreier@cisco.com>,
Marcin Slusarz <marcin.slusarz@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [ofa-general] Re: [PATCH 10/14] infiniband: use printk_once
Date: Mon, 10 Aug 2009 09:36:26 +0300 [thread overview]
Message-ID: <200908100936.26963.jackm@dev.mellanox.co.il> (raw)
In-Reply-To: <adaocqo9sb4.fsf@cisco.com>
I'm a bit nervous about this one.
printk_once will print once ONLY if CONFIG_PRINTK is set in include/linux/autoconf.h
(i.e., when the kernel is configured). Otherwise, it gets defined to printk --
and it will always print in this case.
(see 2.6.30.xx kernel include file "include/linux/kernel.h", lines 235, 249, and 272).
Do you think that distributions will ALWAYS have CONFIG_PRINTK defined?
I would prefer to wait until printk_once printing only once is not config-dependent.
-Jack
On Monday 10 August 2009 08:00, Roland Dreier wrote:
>
> > drivers/infiniband/hw/cxgb3/iwch.c | 4 +---
> > drivers/infiniband/hw/mlx4/main.c | 6 +-----
>
> > --- a/drivers/infiniband/hw/mlx4/main.c
> > +++ b/drivers/infiniband/hw/mlx4/main.c
> > @@ -540,15 +540,11 @@ static struct device_attribute *mlx4_class_attributes[] = {
> >
> > static void *mlx4_ib_add(struct mlx4_dev *dev)
> > {
> > - static int mlx4_ib_version_printed;
> > struct mlx4_ib_dev *ibdev;
> > int num_ports = 0;
> > int i;
> >
> > - if (!mlx4_ib_version_printed) {
> > - printk(KERN_INFO "%s", mlx4_ib_version);
> > - ++mlx4_ib_version_printed;
> > - }
> > + printk_once(KERN_INFO "%s", mlx4_ib_version);
> >
> > mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB)
> > num_ports++;
>
> Looks fine but there is near-identical code in
> drivers/infiniband/hw/mthca/mthca_main.c that you might as well convert
> too.
>
> Thanks,
> Roland
> _______________________________________________
> general mailing list
> general@lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
>
next prev parent reply other threads:[~2009-08-10 6:36 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-09 19:53 [PATCH 00/14] " Marcin Slusarz
2009-08-09 19:53 ` [PATCH 01/14] alpha: " Marcin Slusarz
2009-08-09 19:53 ` [PATCH 02/14] ia64: " Marcin Slusarz
2009-08-09 19:53 ` [PATCH 03/14] powerpc: " Marcin Slusarz
2009-08-10 8:00 ` Wolfram Sang
2009-08-10 11:46 ` Michael Ellerman
2009-08-10 11:56 ` Gary Thomas
2009-08-09 19:53 ` [PATCH 04/14] sh: " Marcin Slusarz
2009-08-13 3:04 ` Paul Mundt
2009-08-09 19:54 ` [PATCH 05/14] x86: " Marcin Slusarz
2009-08-09 20:30 ` [tip:x86/cleanups] x86: Use printk_once() tip-bot for Marcin Slusarz
2009-08-09 19:54 ` [PATCH 06/14] ata: use printk_once Marcin Slusarz
2009-08-09 19:54 ` [PATCH 07/14] block: " Marcin Slusarz
2009-08-09 19:54 ` [PATCH 08/14] tty/vt: " Marcin Slusarz
2009-08-09 19:54 ` [PATCH 09/14] ide: " Marcin Slusarz
2009-08-10 2:52 ` David Miller
2009-08-09 19:54 ` [PATCH 10/14] infiniband: " Marcin Slusarz
2009-08-10 5:00 ` Roland Dreier
2009-08-10 6:36 ` Jack Morgenstein [this message]
2009-08-10 7:36 ` [ofa-general] " Jiri Slaby
2009-08-10 17:42 ` Roland Dreier
2009-08-11 7:17 ` Jack Morgenstein
2009-08-10 16:07 ` Marcin Slusarz
2009-08-11 16:40 ` Roland Dreier
2009-08-09 19:54 ` [PATCH 11/14] drivers/net: " Marcin Slusarz
2009-08-10 2:52 ` David Miller
2009-08-09 19:54 ` [PATCH 12/14] scsi: " Marcin Slusarz
2009-08-11 16:40 ` James Bottomley
2009-08-11 16:46 ` Roland Dreier
2009-08-11 16:50 ` James Bottomley
2009-08-11 16:49 ` Joe Perches
2009-08-09 19:54 ` [PATCH 13/14] vsprintf: use WARN_ON_ONCE Marcin Slusarz
2009-08-09 19:54 ` [PATCH 14/14] net: use printk_once Marcin Slusarz
2009-08-10 2:52 ` David Miller
2009-08-09 20:36 ` [PATCH 00/14] " Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200908100936.26963.jackm@dev.mellanox.co.il \
--to=jackm@dev.mellanox.co.il \
--cc=general@lists.openfabrics.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.slusarz@gmail.com \
--cc=rdreier@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome