Re: [PATCH ] mlx4_core: Verify that port types are the same only if DPDP supported

Yuval Shaia
2014-12-08T06:29:01Z

On Sun, Dec 07, 2014 at 09:24:26PM -0800, Roland Dreier wrote:
> On Sat, Dec 6, 2014 at 10:46 AM, Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> >
> > - for (i = 0; i < dev->caps.num_ports - 1; i++) {
> > - if (port_type[i] != port_type[i + 1]) {
> > - if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) {
> > + if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP))
> > + for (i = 0; i < dev->caps.num_ports - 1; i++) {
> > + if (port_type[i] != port_type[i + 1]) {
>
> I'm struggling to understand what this patch does. It sure looks like
> a NOP to me.
Move check out of the loop just to make the code more nice & readable.
>
> At least you need to resend it with a changelog that explains why we
> want this change.
Will do.
>
> - R.