[PATCH v2 1/2] drm: constify edid handling functions

Thierry Reding thierry.reding at avionic-design.de
Wed Jan 16 10:45:40 PST 2013


On Wed, Jan 16, 2013 at 07:04:22PM +0200, Jani Nikula wrote:
> On Wed, 16 Jan 2013, Lucas Stach <dev at lynxeye.de> wrote:
> > Am Mittwoch, den 16.01.2013, 16:23 +0100 schrieb Thierry Reding:
> >> On Wed, Jan 16, 2013 at 03:36:41PM +0100, Lucas Stach wrote:
> >> [...]
> >> > @@ -705,7 +705,7 @@ static int standard_timing_level(struct edid *edid)
> >> >   * monitors fill with ascii space (0x20) instead.
> >> >   */
> >> >  static int
> >> > -bad_std_timing(u8 a, u8 b)
> >> > +bad_std_timing(const u8 a, const u8 b)
> >> >  {
> >> >  	return (a == 0x00 && b == 0x00) ||
> >> >  	       (a == 0x01 && b == 0x01) ||
> >> 
> >> Was this intended to go in here?
> 
> [...]
> 
> > Yes, probably I should have been a bit more elaborate in the commit
> > message. Both hunks are intentional, as I looked at how those functions
> > in the environment of the edid handling funcs are used and added const
> > where appropriate, not just strictly to the struct edid pointer.
> 
> Please, let's not start constifying non-pointer parameters and local
> variables.

I agree. I don't think there's any advantage in making a and b const.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20130116/c86964c8/attachment.pgp>


More information about the dri-devel mailing list