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:	Thu, 31 May 2012 12:06:39 +0200
From:	Christian Dietrich <stettberger@...ucode.de>
To:	Sergei Shtylyov <sshtylyov@...sta.com>
Cc:	Christian Dietrich 
	<christian.dietrich@...ormatik.uni-erlangen.de>,
	"David S. Miller" <davem@...emloft.net>, linux-ide@...r.kernel.org,
	linux-kernel@...r.kernel.org, vamos-dev@...ts.cs.fau.de
Subject: Re: [PATCH] ide: icside.c: Fix compile with CONFIG_BLK_DEV_IDEDMA_ICS=n

The icside driver can be configured without DMA support, but it
 doesn't compile then, because DMA operations are referenced.

drivers/ide/icside.c:523: error: 'icside_v6_port_ops' undeclared
drivers/ide/icside.c:522: error: 'icside_dma_init' undeclared
---
 drivers/ide/icside.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

Sergei Shtylyov <sshtylyov@...sta.com> writes:

>> I attach the configuration, that exposes this compilation error.
>
>    Apparently, you forgot to do it. :-)

Should be better now.


Download attachment "icside.config" of type "application/octet-stream" (52863 bytes)


>> -	printk("%s: %s selected (peak %dMB/s)\n", drive->name,
>> +	printk("%s: %s selected (peak %ldMB/s)\n", drive->name,
>
>    Unrelated change, should go into its own patch.

Will arrive in one second.

> You forgot to remove the useless '#define icside_v6_dma_ops NULL'
> above.  Also, you could set .dma_ops inside the 'if' below (and get
> rid of else' then), removing this line.

I rearranged the change a little bit and it doesn't require a else
statement now.

diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c
index 8716066..83e5100 100644
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -375,8 +375,6 @@ static const struct ide_dma_ops icside_v6_dma_ops = {
 	.dma_test_irq		= icside_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 };
-#else
-#define icside_v6_dma_ops NULL
 #endif
 
 static int icside_dma_off_init(ide_hwif_t *hwif, const struct ide_port_info *d)
@@ -456,7 +454,6 @@ err_free:
 static const struct ide_port_info icside_v6_port_info __initdata = {
 	.init_dma		= icside_dma_off_init,
 	.port_ops		= &icside_v6_no_dma_port_ops,
-	.dma_ops		= &icside_v6_dma_ops,
 	.host_flags		= IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
 	.mwdma_mask		= ATA_MWDMA2,
 	.swdma_mask		= ATA_SWDMA2,
@@ -518,11 +515,13 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
 
 	ecard_set_drvdata(ec, state);
 
+#ifdef CONFIG_BLK_DEV_IDEDMA_ICS
 	if (ec->dma != NO_DMA && !request_dma(ec->dma, DRV_NAME)) {
 		d.init_dma = icside_dma_init;
 		d.port_ops = &icside_v6_port_ops;
-	} else
-		d.dma_ops = NULL;
+		d.dma_ops  = &icside_v6_dma_ops;
+	}
+#endif
 
 	ret = ide_host_register(host, &d, hws);
 	if (ret)
-- 
1.7.5.4

Powered by blists - more mailing lists