On Thu, Nov 05, 2015 at 04:22:09PM +0200, Ville Syrjälä wrote:
> On Thu, Nov 05, 2015 at 02:10:15PM +0000, Chris Wilson wrote:
> > static const char *ddc_name(enum port port) {
> >     static const char * const names[] = {
> >             [PORT_A] = "DPDDC-A",
> >             [PORT_B] = "DPDDC-B",
> >             [PORT_C] = "DPDDC-C",
> >             [PORT_D] = "DPDDC-D",
> >             [PORT_E] = "DPDDC-E",
> >     };
> >     if (WARN_ON(port >= ARRAY_SIZE(names))
> >             return "DPDDC-XXX";
> >     return names[port];
> > }
> 
> We can do that. Or we could just do
> kasprintf(GFP_KERNEL, "DPDDC-%c", port_name(port));
> 
> + error handling and kfree() along drm_dp_aux_unregister()
> of course.

Aye, that's better.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to