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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 2 Feb 2009 19:26:44 +0100
From:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To:	"Daniel K." <daniel@...ded.net>
Cc:	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro

On Monday 02 February 2009, Daniel K. wrote:
> Bartlomiej Zolnierkiewicz wrote:
> > Index: b/drivers/ide/scc_pata.c
> > ===================================================================
> > --- a/drivers/ide/scc_pata.c
> > +++ b/drivers/ide/scc_pata.c
> > @@ -882,21 +882,16 @@ static const struct ide_dma_ops scc_dma_
> >  	.dma_sff_read_status	= scc_dma_sff_read_status,
> >  };
> >  
> > -#define DECLARE_SCC_DEV(name_str)			\
> > -  {							\
> > -      .name		= name_str,			\
> > -      .init_iops	= init_iops_scc,		\
> > -      .init_dma		= scc_init_dma,			\
> > -      .init_hwif	= init_hwif_scc,		\
> > -      .tp_ops		= &scc_tp_ops,		\
> > -      .port_ops		= &scc_port_ops,		\
> > -      .dma_ops		= &scc_dma_ops,			\
> > -      .host_flags	= IDE_HFLAG_SINGLE,		\
> > -      .pio_mask		= ATA_PIO4,			\
> > -  }
> > -
> >  static const struct ide_port_info scc_chipsets[] __devinitdata = {
> > -	/* 0 */ DECLARE_SCC_DEV("sccIDE"),
> > +	.name		= "sccIDE",
> > +	.init_iops	= init_iops_scc,
> > +	.init_dma	= scc_init_dma,
> > +	.init_hwif	= init_hwif_scc,
> > +	.tp_ops		= &scc_tp_ops,
> > +	.port_ops	= &scc_port_ops,
> > +	.dma_ops	= &scc_dma_ops,
> > +	.host_flags	= IDE_HFLAG_SINGLE,
> > +	.pio_mask	= ATA_PIO4,
> >  };
> >  
> >  /**
> 
> You're a few braces short here, aren't you?

Good catch, thanks!

> The braces in the #define, didn't get carried over in the change.

Actually we may simplify the whole thing while at it.

From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Subject: [PATCH] scc_pata: remove DECLARE_SCC_DEV() macro (v2)

v2:
scc_chipsets[] -> scc_chipset fix (spotted by Daniel K.).

Cc: "Daniel K." <daniel@...ded.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
---
 drivers/ide/scc_pata.c |   27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -882,21 +882,16 @@ static const struct ide_dma_ops scc_dma_
 	.dma_sff_read_status	= scc_dma_sff_read_status,
 };
 
-#define DECLARE_SCC_DEV(name_str)			\
-  {							\
-      .name		= name_str,			\
-      .init_iops	= init_iops_scc,		\
-      .init_dma		= scc_init_dma,			\
-      .init_hwif	= init_hwif_scc,		\
-      .tp_ops		= &scc_tp_ops,		\
-      .port_ops		= &scc_port_ops,		\
-      .dma_ops		= &scc_dma_ops,			\
-      .host_flags	= IDE_HFLAG_SINGLE,		\
-      .pio_mask		= ATA_PIO4,			\
-  }
-
-static const struct ide_port_info scc_chipsets[] __devinitdata = {
-	/* 0 */ DECLARE_SCC_DEV("sccIDE"),
+static const struct ide_port_info scc_chipset __devinitdata = {
+	.name		= "sccIDE",
+	.init_iops	= init_iops_scc,
+	.init_dma	= scc_init_dma,
+	.init_hwif	= init_hwif_scc,
+	.tp_ops		= &scc_tp_ops,
+	.port_ops	= &scc_port_ops,
+	.dma_ops	= &scc_dma_ops,
+	.host_flags	= IDE_HFLAG_SINGLE,
+	.pio_mask	= ATA_PIO4,
 };
 
 /**
@@ -910,7 +905,7 @@ static const struct ide_port_info scc_ch
 
 static int __devinit scc_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	return init_setup_scc(dev, &scc_chipsets[id->driver_data]);
+	return init_setup_scc(dev, &scc_chipset);
 }
 
 /**

--
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