Re: [PATCH] Marvell 6440 SAS/SATA driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- On Tue, 2/5/08, Ke Wei <kewei.mv@xxxxxxxxx> wrote:
> +	for_each_phy(port->wide_port_phymap, no, j, mvi->chip->n_phy) {
> +		mvs_write_port_cfg_addr(mvi, no, PHYR_WIDE_PORT);
> +		mvs_write_port_cfg_data(mvi, no , port->wide_port_phymap);
> +	} else {
> +		mvs_write_port_cfg_addr(mvi, no, PHYR_WIDE_PORT);
> +		mvs_write_port_cfg_data(mvi, no , 0);
> +	}
> +}

Don't do this.  Make the "if" explicit.

Since I can see you've taken this verbatim from the SAS code,
if "no" means number, then it is "j". "no" is just a temporary
register which gets shifted right each iteration and not of
much use outside the macro.

Also if "__rest" (which you added to the macro) is 0, then nether
statement would execute, which is probably not what you want.

If "n_phy" means "number of phys", then its usage that you added
into the macro is inconsistent. Furthermore it shouldn't be
necessary since wide_port_phymap & ~((2^n_phy)-1) must never be true.

    Luben

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux