All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Masoud Sharbiani <masouds@google.com>
Cc: bzolnier@gmail.com, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix pointer arithmetic in hpt3xx driver code
Date: Fri, 05 Sep 2008 22:04:14 +0400	[thread overview]
Message-ID: <48C1749E.6050002@ru.mvista.com> (raw)
In-Reply-To: <20080905174834.GD26371@google.com>

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;


      reply	other threads:[~2008-09-05 18:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-05 17:48 [PATCH] Fix pointer arithmetic in hpt3xx driver code Masoud Sharbiani
2008-09-05 18:04 ` Sergei Shtylyov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C1749E.6050002@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=akpm@linux-foundation.org \
    --cc=bzolnier@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masouds@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.