lkml.org 
[lkml]   [2008]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix pointer arithmetic in hpt3xx driver code
Masoud Sharbiani wrote:

> Hi there,
> git commit 74811f355f4f69a187fa74892dcf2a684b84ce99 causes crash at
> module load (or boot) time on my machine with a hpt374 controller.
> Sergei says this is due to the pointer arithmatic. This patch fixes that
> and makes my machine boot again.

> Signed-Off-By: Masoud Sharbiani <masouds@google.com>

> diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
> index eb107ee..f41f3fd 100644
> --- a/drivers/ide/pci/hpt366.c
> +++ b/drivers/ide/pci/hpt366.c
> @@ -613,6 +613,14 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list)
> return 0;
> }

> +static struct hpt_info *hpt3xx_get_info(void *host_priv, struct device *hwif_dev, struct device *host_dev)

Ugh, that's oversimplified and doesn't save much...
I rather meant the following prototype:

static struct hpt_info *hpt3xx_get_info(struct pci_dev *dev)

In case it'll be too complex for you, I'll do it myself later.

> +{
> + struct hpt_info *info = (struct hpt_info *)host_priv;

Newline needed after the declaration block.

> + if (hwif_dev == host_dev)
return info + 1;
else
return info;

or

return hwif_dev == host_dev ? info + 1 : info;



\
 
 \ /
  Last update: 2008-09-05 20:07    [W:0.030 / U:3.452 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site