[E3-hacking] [PATCH v2 1/6] SoC Camera: add driver for OMAP1 camera interface

Janusz Krzysztofik jkrzyszt at tis.icnet.pl
Sun Sep 19 20:24:25 BST 2010

Sunday 19 September 2010 17:06:58 Ralph Corderoy wrote:
> Hi Janusz,

Hi Ralph,
Thanks for your time.

> > This is a V4L2 driver for TI OMAP1 SoC camera interface.
> >
> > +				"0x%0x\n", __func__, it_status);
> > +				"0x%0x\n", __func__, it_status);
> > +		dev_warn(dev, "%s: format %#x not found\n", __func__,
> > +		dev_warn(icd->dev.parent, "Format %#x not found\n",
> Two bytes could be saved with consistent use of %#x.  :-) 

My "man 3 printf" says:

"The flag characters
	The character % is followed by zero or more of the following flags:

 #	The value should be converted to an  "alternate  form"...  For x and
	X conversions,  a non-zero result has the string "0x" (or "0X" for X
	conversions) prepended to it."

In the first two cases, I intended to keep the "0x" prepended even if 0. Am I 
missing something?

> Does it make 
> sense to say `%0x' without giving a field width to pad to? 

My bad.

In next iteration, I'll probably use "0x%.8x" when printing 32-bit register 
values. What do you think?


> That's 
> another two bytes saved.  A veritable word!
> Cheers,
> Ralph.
> _______________________________________________
> e3-hacking mailing list
> e3-hacking at earth.li
> http://www.earth.li/cgi-bin/mailman/listinfo/e3-hacking

More information about the e3-hacking mailing list