lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 11 Aug 2009 11:40:13 -0500
From:	James Bottomley <James.Bottomley@...senPartnership.com>
To:	Marcin Slusarz <marcin.slusarz@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>, linux-scsi@...r.kernel.org
Subject: Re: [PATCH 12/14] scsi: use printk_once

On Sun, 2009-08-09 at 21:54 +0200, Marcin Slusarz wrote:
> Signed-off-by: Marcin Slusarz <marcin.slusarz@...il.com>
> Cc: "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>
> Cc: linux-scsi@...r.kernel.org
> ---
>  drivers/scsi/53c700.c             |    6 +-----
>  drivers/scsi/cxgb3i/cxgb3i_init.c |    7 +------
>  2 files changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
> index f5a9add..c5f4fa7 100644
> --- a/drivers/scsi/53c700.c
> +++ b/drivers/scsi/53c700.c
> @@ -291,7 +291,6 @@ NCR_700_detect(struct scsi_host_template *tpnt,
>  	__u8 *memory;
>  	__u32 *script;
>  	struct Scsi_Host *host;
> -	static int banner = 0;
>  	int j;
>  
>  	if(tpnt->sdev_attrs == NULL)
> @@ -385,10 +384,7 @@ NCR_700_detect(struct scsi_host_template *tpnt,
>  	else
>  		hostdata->rev = (NCR_700_readb(host, CTEST7_REG)>>4) & 0x0f;
>  	hostdata->fast = (NCR_700_readb(host, CTEST9_REG) == 0);
> -	if (banner == 0) {
> -		printk(KERN_NOTICE "53c700: Version " NCR_700_VERSION " By James.Bottomley@...senPartnership.com\n");
> -		banner = 1;
> -	}
> +	printk_once(KERN_NOTICE "53c700: Version " NCR_700_VERSION " By James.Bottomley@...senPartnership.com\n");
>  	printk(KERN_NOTICE "scsi%d: %s rev %d %s\n", host->host_no,
>  	       hostdata->chip710 ? "53c710" :
>  	       (hostdata->fast ? "53c700-66" : "53c700"),
> diff --git a/drivers/scsi/cxgb3i/cxgb3i_init.c b/drivers/scsi/cxgb3i/cxgb3i_init.c
> index 042d9bc..8c9285f 100644
> --- a/drivers/scsi/cxgb3i/cxgb3i_init.c
> +++ b/drivers/scsi/cxgb3i/cxgb3i_init.c
> @@ -43,12 +43,7 @@ static struct cxgb3_client t3c_client = {
>   */
>  static void open_s3_dev(struct t3cdev *t3dev)
>  {
> -	static int vers_printed;
> -
> -	if (!vers_printed) {
> -		printk(KERN_INFO "%s", version);
> -		vers_printed = 1;
> -	}
> +	printk_once(KERN_INFO "%s", version);

There's really no point to this beyond code churn.  Both patterns are
correct uses so conversion buys us nothing.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ