[PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-06 Thread Henri Verbeet
On 5 April 2011 23:06, Marcin ?lusarz wrote: >> +static const char *mode_status_to_string(enum drm_mode_status status) >> +{ >> + ? ? ? const char *strings[] = { > > + static? > You'd probably even want that to be "static const char * const strings[]".

[PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-06 Thread Alex Deucher
On Tue, Apr 5, 2011 at 5:41 PM, Chris Wilson wrote: > On Tue, 5 Apr 2011 23:39:19 +0200, Julien Cristau > wrote: >> On Tue, Apr ?5, 2011 at 21:50:15 +0100, Chris Wilson wrote: >> >> > + ? if ((unsigned)status > ARRAY_SIZE(strings)) >> >> off by one? > > And didn't check for holes. > > /me wishe

Re: [PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-06 Thread Alex Deucher
On Tue, Apr 5, 2011 at 5:41 PM, Chris Wilson wrote: > On Tue, 5 Apr 2011 23:39:19 +0200, Julien Cristau wrote: >> On Tue, Apr  5, 2011 at 21:50:15 +0100, Chris Wilson wrote: >> >> > +   if ((unsigned)status > ARRAY_SIZE(strings)) >> >> off by one? > > And didn't check for holes. > > /me wishes he

Re: [PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-06 Thread Henri Verbeet
On 5 April 2011 23:06, Marcin Ślusarz wrote: >> +static const char *mode_status_to_string(enum drm_mode_status status) >> +{ >> +       const char *strings[] = { > > + static? > You'd probably even want that to be "static const char * const strings[]". _

[PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Julien Cristau
On Tue, Apr 5, 2011 at 21:50:15 +0100, Chris Wilson wrote: > + if ((unsigned)status > ARRAY_SIZE(strings)) off by one? > + return "unknown"; > + > + return strings[status]; > +} > + Cheers, Julien

[PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Marcin Ślusarz
2011/4/5 Chris Wilson : > Signed-off-by: Chris Wilson > --- > ?drivers/gpu/drm/drm_modes.c | ? 52 +- > ?1 files changed, 50 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c > index 25bf873..b3e07ac 1006

[PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Chris Wilson
On Tue, 5 Apr 2011 23:39:19 +0200, Julien Cristau wrote: > On Tue, Apr 5, 2011 at 21:50:15 +0100, Chris Wilson wrote: > > > + if ((unsigned)status > ARRAY_SIZE(strings)) > > off by one? And didn't check for holes. /me wishes he never sent this momentarily useful bit of code. ;-) -Chris --

[PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Chris Wilson
On Tue, 5 Apr 2011 23:06:19 +0200, Marcin ??lusarz wrote: > 2011/4/5 Chris Wilson : > > Signed-off-by: Chris Wilson > > --- > > ??drivers/gpu/drm/drm_modes.c | ?? 52 > > +- > > ??1 files changed, 50 insertions(+), 2 deletions(-) > > > > diff --git a/driver

[PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Chris Wilson
Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_modes.c | 52 +- 1 files changed, 50 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 25bf873..b3e07ac 100644 --- a/drivers/gpu/drm/drm_modes.c

Re: [PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Chris Wilson
On Tue, 5 Apr 2011 23:39:19 +0200, Julien Cristau wrote: > On Tue, Apr 5, 2011 at 21:50:15 +0100, Chris Wilson wrote: > > > + if ((unsigned)status > ARRAY_SIZE(strings)) > > off by one? And didn't check for holes. /me wishes he never sent this momentarily useful bit of code. ;-) -Chris --

Re: [PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Julien Cristau
On Tue, Apr 5, 2011 at 21:50:15 +0100, Chris Wilson wrote: > + if ((unsigned)status > ARRAY_SIZE(strings)) off by one? > + return "unknown"; > + > + return strings[status]; > +} > + Cheers, Julien ___ dri-devel mailing list dri-de

Re: [PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Chris Wilson
On Tue, 5 Apr 2011 23:06:19 +0200, Marcin Ślusarz wrote: > 2011/4/5 Chris Wilson : > > Signed-off-by: Chris Wilson > > --- > >  drivers/gpu/drm/drm_modes.c |   52 > > +- > >  1 files changed, 50 insertions(+), 2 deletions(-) > > > > diff --git a/drive

Re: [PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Marcin Ślusarz
2011/4/5 Chris Wilson : > Signed-off-by: Chris Wilson > --- >  drivers/gpu/drm/drm_modes.c |   52 +- >  1 files changed, 50 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c > index 25bf873..b3e07ac 1006

[PATCH] drm: Pretty print out the reason for rejecting the mode

2011-04-05 Thread Chris Wilson
Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_modes.c | 52 +- 1 files changed, 50 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 25bf873..b3e07ac 100644 --- a/drivers/gpu/drm/drm_modes.c