2006-03-09 23:01:55

by Roland Dreier

[permalink] [raw]
Subject: Re: [PATCH 4 of 20] ipath - support for HyperTransport devices

> + /* the HT capability type byte is 3 bytes after the
> + * capability byte.
> + */
> + if (pci_read_config_byte(pdev, pos + 3, &cap_type)) {
> + dev_info(&pdev->dev, "Couldn't read config "
> + "command @ %d\n", pos);
> + continue;
> + }
> + if (!(cap_type & 0xE0)) {

It seems like all these hypertransport magic constants should be in a
general .h somewhere. I'm not sure if it makes sense to put them in
<linux/pci.h>, or start a <linux/hypertransport.h>.

> + else if (linkctrl & (0xf << 8)) {
> + ipath_cdbg(
> + VERBOSE,
> + "Clear linkctrl%d CRC "
> + "Error bits %x\n", i,
> + linkctrl & (0xf << 8));
> + /*
> + * now write them back to clear
> + * the error.
> + */
> + pci_write_config_byte(
> + pdev, link_off,
> + linkctrl & (0xf << 8));

The logic here is pretty hard to follow, and you're getting squeezed
pretty hard by indenting 5 tabs stops. Can ipath_setup_ht_config() be
split up into subfunctions?


2006-03-09 23:21:54

by Bryan O'Sullivan

[permalink] [raw]
Subject: Re: [PATCH 4 of 20] ipath - support for HyperTransport devices

On Thu, 2006-03-09 at 15:01 -0800, Roland Dreier wrote:

> It seems like all these hypertransport magic constants should be in a
> general .h somewhere. I'm not sure if it makes sense to put them in
> <linux/pci.h>, or start a <linux/hypertransport.h>.

Either way is fine by me.

> The logic here is pretty hard to follow, and you're getting squeezed
> pretty hard by indenting 5 tabs stops. Can ipath_setup_ht_config() be
> split up into subfunctions?

Definitely. I mentioned this in the introductory message for the series
as something I'm working on.

<b