Hi Sean,
Sure, thanks for the review

Marcel

> -----Original Message-----
> From: Hefty, Sean [mailto:sean.he...@intel.com]
> Sent: Tuesday, October 04, 2011 5:14 PM
> To: Marcel Apfelbaum; linux-rdma@vger.kernel.org
> Cc: rol...@kernel.org; Marcel Apfelbaum; Or Gerlitz; Hal Rosenstock
> Subject: RE: [PATCH for-3.2 v1 1/5] ib/core: Add extended link speeds
> 
> > @@ -186,16 +187,30 @@ static ssize_t rate_show(struct ib_port
> >             return ret;
> >
> >     switch (attr.active_speed) {
> > -   case 2: speed = " DDR"; break;
> > -   case 4: speed = " QDR"; break;
> > +   case 2:
> > +           speed = " DDR";
> > +           break;
> > +   case 4:
> > +           speed = " QDR";
> > +           break;
> > +   case 8:
> > +           speed = " FDR10";
> > +           break;
> > +   case 16:
> > +           speed = " FDR";
> > +           break;
> > +   case 32:
> > +           speed = " EDR";
> > +           break;
> >     }
> 
> We're already switching on attr.active speed above.  We should just merge
> ib_active_speed_to_rate() into this function, so we can avoid dealing with its
> 'rate_rounded' parameter as well.
> 
> >
> > -   rate = 25 * ib_width_enum_to_int(attr.active_width) *
> attr.active_speed;
> > +   rate = ib_width_enum_to_int(attr.active_width) *
> > +          ib_active_speed_to_rate(attr.active_speed, &rate_rounded);
> >     if (rate < 0)
> >             return -EINVAL;
> >
> >     return sprintf(buf, "%d%s Gb/sec (%dX%s)\n",
> > -                  rate / 10, rate % 10 ? ".5" : "",
> > +                  rate, rate_rounded ? ".5" : "",
> >                    ib_width_enum_to_int(attr.active_width), speed);  }
> 
> Thanks,
> Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to