All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] PATA-Arasan CF: Adjustments for arasan_cf_probe()
@ 2018-02-16 15:56 ` SF Markus Elfring
  0 siblings, 0 replies; 14+ messages in thread
From: SF Markus Elfring @ 2018-02-16 15:56 UTC (permalink / raw)
  To: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 16 Feb 2018 16:51:23 +0100

Three update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Delete an error message for a failed memory allocation
  Delete an unnecessary variable initialisation
  Move two variable assignments

 drivers/ata/pata_arasan_cf.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

-- 
2.16.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 0/3] PATA-Arasan CF: Adjustments for arasan_cf_probe()
@ 2018-02-16 15:56 ` SF Markus Elfring
  0 siblings, 0 replies; 14+ messages in thread
From: SF Markus Elfring @ 2018-02-16 15:56 UTC (permalink / raw)
  To: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 16 Feb 2018 16:51:23 +0100

Three update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Delete an error message for a failed memory allocation
  Delete an unnecessary variable initialisation
  Move two variable assignments

 drivers/ata/pata_arasan_cf.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

-- 
2.16.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/3] pata_arasan_cf: Delete an error message for a failed memory allocation in arasan_cf_prob
  2018-02-16 15:56 ` SF Markus Elfring
@ 2018-02-16 15:57   ` SF Markus Elfring
  -1 siblings, 0 replies; 14+ messages in thread
From: SF Markus Elfring @ 2018-02-16 15:57 UTC (permalink / raw)
  To: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 16 Feb 2018 16:01:12 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/ata/pata_arasan_cf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index b4d54771c9fe..be5fbcedecbf 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -809,10 +809,8 @@ static int arasan_cf_probe(struct platform_device *pdev)
 	}
 
 	acdev = devm_kzalloc(&pdev->dev, sizeof(*acdev), GFP_KERNEL);
-	if (!acdev) {
-		dev_warn(&pdev->dev, "kzalloc fail\n");
+	if (!acdev)
 		return -ENOMEM;
-	}
 
 	if (pdata)
 		quirk = pdata->quirk;
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 1/3] pata_arasan_cf: Delete an error message for a failed memory allocation in arasan_cf_probe()
@ 2018-02-16 15:57   ` SF Markus Elfring
  0 siblings, 0 replies; 14+ messages in thread
From: SF Markus Elfring @ 2018-02-16 15:57 UTC (permalink / raw)
  To: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 16 Feb 2018 16:01:12 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/ata/pata_arasan_cf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index b4d54771c9fe..be5fbcedecbf 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -809,10 +809,8 @@ static int arasan_cf_probe(struct platform_device *pdev)
 	}
 
 	acdev = devm_kzalloc(&pdev->dev, sizeof(*acdev), GFP_KERNEL);
-	if (!acdev) {
-		dev_warn(&pdev->dev, "kzalloc fail\n");
+	if (!acdev)
 		return -ENOMEM;
-	}
 
 	if (pdata)
 		quirk = pdata->quirk;
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/3] pata_arasan_cf: Delete an unnecessary variable initialisation in arasan_cf_probe()
  2018-02-16 15:56 ` SF Markus Elfring
@ 2018-02-16 15:59   ` SF Markus Elfring
  -1 siblings, 0 replies; 14+ messages in thread
From: SF Markus Elfring @ 2018-02-16 15:59 UTC (permalink / raw)
  To: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 16 Feb 2018 16:28:23 +0100

The local variable "ret" will eventually be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/ata/pata_arasan_cf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index be5fbcedecbf..ebecab8c3f36 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -796,7 +796,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
 	struct resource *res;
 	u32 quirk;
 	irq_handler_t irq_handler = NULL;
-	int ret = 0;
+	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/3] pata_arasan_cf: Delete an unnecessary variable initialisation in arasan_cf_probe()
@ 2018-02-16 15:59   ` SF Markus Elfring
  0 siblings, 0 replies; 14+ messages in thread
From: SF Markus Elfring @ 2018-02-16 15:59 UTC (permalink / raw)
  To: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 16 Feb 2018 16:28:23 +0100

The local variable "ret" will eventually be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/ata/pata_arasan_cf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index be5fbcedecbf..ebecab8c3f36 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -796,7 +796,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
 	struct resource *res;
 	u32 quirk;
 	irq_handler_t irq_handler = NULL;
-	int ret = 0;
+	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/3] pata_arasan_cf: Move two variable assignments in arasan_cf_probe()
  2018-02-16 15:56 ` SF Markus Elfring
@ 2018-02-16 16:00   ` SF Markus Elfring
  -1 siblings, 0 replies; 14+ messages in thread
From: SF Markus Elfring @ 2018-02-16 16:00 UTC (permalink / raw)
  To: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 16 Feb 2018 16:42:26 +0100

Move assignments for the local variables "irq_handler" and "pdata"
so that their setting will only be performed after a call
of the function "devm_kzalloc" succeeded by this function.
Thus adjust a corresponding if statement.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/ata/pata_arasan_cf.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index ebecab8c3f36..27f241b1b1b1 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -790,12 +790,12 @@ static struct ata_port_operations arasan_cf_ops = {
 static int arasan_cf_probe(struct platform_device *pdev)
 {
 	struct arasan_cf_dev *acdev;
-	struct arasan_cf_pdata *pdata = dev_get_platdata(&pdev->dev);
+	struct arasan_cf_pdata *pdata;
 	struct ata_host *host;
 	struct ata_port *ap;
 	struct resource *res;
 	u32 quirk;
-	irq_handler_t irq_handler = NULL;
+	irq_handler_t irq_handler;
 	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -812,6 +812,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
 	if (!acdev)
 		return -ENOMEM;
 
+	pdata = dev_get_platdata(&pdev->dev);
 	if (pdata)
 		quirk = pdata->quirk;
 	else
@@ -819,10 +820,12 @@ static int arasan_cf_probe(struct platform_device *pdev)
 
 	/* if irq is 0, support only PIO */
 	acdev->irq = platform_get_irq(pdev, 0);
-	if (acdev->irq)
+	if (acdev->irq) {
 		irq_handler = arasan_cf_interrupt;
-	else
+	} else {
 		quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA;
+		irq_handler = NULL;
+	}
 
 	acdev->pbase = res->start;
 	acdev->vbase = devm_ioremap_nocache(&pdev->dev, res->start,
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/3] pata_arasan_cf: Move two variable assignments in arasan_cf_probe()
@ 2018-02-16 16:00   ` SF Markus Elfring
  0 siblings, 0 replies; 14+ messages in thread
From: SF Markus Elfring @ 2018-02-16 16:00 UTC (permalink / raw)
  To: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 16 Feb 2018 16:42:26 +0100

Move assignments for the local variables "irq_handler" and "pdata"
so that their setting will only be performed after a call
of the function "devm_kzalloc" succeeded by this function.
Thus adjust a corresponding if statement.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/ata/pata_arasan_cf.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index ebecab8c3f36..27f241b1b1b1 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -790,12 +790,12 @@ static struct ata_port_operations arasan_cf_ops = {
 static int arasan_cf_probe(struct platform_device *pdev)
 {
 	struct arasan_cf_dev *acdev;
-	struct arasan_cf_pdata *pdata = dev_get_platdata(&pdev->dev);
+	struct arasan_cf_pdata *pdata;
 	struct ata_host *host;
 	struct ata_port *ap;
 	struct resource *res;
 	u32 quirk;
-	irq_handler_t irq_handler = NULL;
+	irq_handler_t irq_handler;
 	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -812,6 +812,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
 	if (!acdev)
 		return -ENOMEM;
 
+	pdata = dev_get_platdata(&pdev->dev);
 	if (pdata)
 		quirk = pdata->quirk;
 	else
@@ -819,10 +820,12 @@ static int arasan_cf_probe(struct platform_device *pdev)
 
 	/* if irq is 0, support only PIO */
 	acdev->irq = platform_get_irq(pdev, 0);
-	if (acdev->irq)
+	if (acdev->irq) {
 		irq_handler = arasan_cf_interrupt;
-	else
+	} else {
 		quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA;
+		irq_handler = NULL;
+	}
 
 	acdev->pbase = res->start;
 	acdev->vbase = devm_ioremap_nocache(&pdev->dev, res->start,
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] pata_arasan_cf: Delete an unnecessary variable initialisation in arasan_cf_probe()
  2018-02-16 15:59   ` SF Markus Elfring
@ 2018-02-18 13:17     ` Tejun Heo
  -1 siblings, 0 replies; 14+ messages in thread
From: Tejun Heo @ 2018-02-18 13:17 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-ide, Bartlomiej Zolnierkiewicz, Viresh Kumar, LKML,
	kernel-janitors

On Fri, Feb 16, 2018 at 04:59:01PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 16 Feb 2018 16:28:23 +0100
> 
> The local variable "ret" will eventually be set to an appropriate value
> a bit later. Thus omit the explicit initialisation at the beginning.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Applied 1-2 to libata/for-4.17.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] pata_arasan_cf: Delete an unnecessary variable initialisation in arasan_cf_probe()
@ 2018-02-18 13:17     ` Tejun Heo
  0 siblings, 0 replies; 14+ messages in thread
From: Tejun Heo @ 2018-02-18 13:17 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-ide, Bartlomiej Zolnierkiewicz, Viresh Kumar, LKML,
	kernel-janitors

On Fri, Feb 16, 2018 at 04:59:01PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 16 Feb 2018 16:28:23 +0100
> 
> The local variable "ret" will eventually be set to an appropriate value
> a bit later. Thus omit the explicit initialisation at the beginning.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Applied 1-2 to libata/for-4.17.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] pata_arasan_cf: Move two variable assignments in arasan_cf_probe()
  2018-02-16 16:00   ` SF Markus Elfring
@ 2018-02-18 13:18     ` Tejun Heo
  -1 siblings, 0 replies; 14+ messages in thread
From: Tejun Heo @ 2018-02-18 13:18 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-ide, Bartlomiej Zolnierkiewicz, Viresh Kumar, LKML,
	kernel-janitors

On Fri, Feb 16, 2018 at 05:00:11PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 16 Feb 2018 16:42:26 +0100
> 
> Move assignments for the local variables "irq_handler" and "pdata"
> so that their setting will only be performed after a call
> of the function "devm_kzalloc" succeeded by this function.
> Thus adjust a corresponding if statement.

I'm not gonna apply this.  If there's something preventing the
compiler from optimizing it, the right thing to do is fixing that.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] pata_arasan_cf: Move two variable assignments in arasan_cf_probe()
@ 2018-02-18 13:18     ` Tejun Heo
  0 siblings, 0 replies; 14+ messages in thread
From: Tejun Heo @ 2018-02-18 13:18 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-ide, Bartlomiej Zolnierkiewicz, Viresh Kumar, LKML,
	kernel-janitors

On Fri, Feb 16, 2018 at 05:00:11PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 16 Feb 2018 16:42:26 +0100
> 
> Move assignments for the local variables "irq_handler" and "pdata"
> so that their setting will only be performed after a call
> of the function "devm_kzalloc" succeeded by this function.
> Thus adjust a corresponding if statement.

I'm not gonna apply this.  If there's something preventing the
compiler from optimizing it, the right thing to do is fixing that.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] pata_arasan_cf: Delete an error message for a failed memory allocation in arasan_cf_probe()
  2018-02-16 15:57   ` [PATCH 1/3] pata_arasan_cf: Delete an error message for a failed memory allocation in arasan_cf_probe() SF Markus Elfring
@ 2018-02-19  3:52     ` Viresh Kumar
  -1 siblings, 0 replies; 14+ messages in thread
From: Viresh Kumar @ 2018-02-19  3:40 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar,
	LKML, kernel-janitors

On 16-02-18, 16:57, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 16 Feb 2018 16:01:12 +0100
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/ata/pata_arasan_cf.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
> index b4d54771c9fe..be5fbcedecbf 100644
> --- a/drivers/ata/pata_arasan_cf.c
> +++ b/drivers/ata/pata_arasan_cf.c
> @@ -809,10 +809,8 @@ static int arasan_cf_probe(struct platform_device *pdev)
>  	}
>  
>  	acdev = devm_kzalloc(&pdev->dev, sizeof(*acdev), GFP_KERNEL);
> -	if (!acdev) {
> -		dev_warn(&pdev->dev, "kzalloc fail\n");
> +	if (!acdev)
>  		return -ENOMEM;
> -	}
>  
>  	if (pdata)
>  		quirk = pdata->quirk;

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] pata_arasan_cf: Delete an error message for a failed memory allocation in arasan_cf_
@ 2018-02-19  3:52     ` Viresh Kumar
  0 siblings, 0 replies; 14+ messages in thread
From: Viresh Kumar @ 2018-02-19  3:52 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-ide, Bartlomiej Zolnierkiewicz, Tejun Heo, Viresh Kumar,
	LKML, kernel-janitors

On 16-02-18, 16:57, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 16 Feb 2018 16:01:12 +0100
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/ata/pata_arasan_cf.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
> index b4d54771c9fe..be5fbcedecbf 100644
> --- a/drivers/ata/pata_arasan_cf.c
> +++ b/drivers/ata/pata_arasan_cf.c
> @@ -809,10 +809,8 @@ static int arasan_cf_probe(struct platform_device *pdev)
>  	}
>  
>  	acdev = devm_kzalloc(&pdev->dev, sizeof(*acdev), GFP_KERNEL);
> -	if (!acdev) {
> -		dev_warn(&pdev->dev, "kzalloc fail\n");
> +	if (!acdev)
>  		return -ENOMEM;
> -	}
>  
>  	if (pdata)
>  		quirk = pdata->quirk;

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-02-19  3:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-16 15:56 [PATCH 0/3] PATA-Arasan CF: Adjustments for arasan_cf_probe() SF Markus Elfring
2018-02-16 15:56 ` SF Markus Elfring
2018-02-16 15:57 ` [PATCH 1/3] pata_arasan_cf: Delete an error message for a failed memory allocation in arasan_cf_prob SF Markus Elfring
2018-02-16 15:57   ` [PATCH 1/3] pata_arasan_cf: Delete an error message for a failed memory allocation in arasan_cf_probe() SF Markus Elfring
2018-02-19  3:40   ` Viresh Kumar
2018-02-19  3:52     ` [PATCH 1/3] pata_arasan_cf: Delete an error message for a failed memory allocation in arasan_cf_ Viresh Kumar
2018-02-16 15:59 ` [PATCH 2/3] pata_arasan_cf: Delete an unnecessary variable initialisation in arasan_cf_probe() SF Markus Elfring
2018-02-16 15:59   ` SF Markus Elfring
2018-02-18 13:17   ` Tejun Heo
2018-02-18 13:17     ` Tejun Heo
2018-02-16 16:00 ` [PATCH 3/3] pata_arasan_cf: Move two variable assignments " SF Markus Elfring
2018-02-16 16:00   ` SF Markus Elfring
2018-02-18 13:18   ` Tejun Heo
2018-02-18 13:18     ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.