Re: [PATCH] powerpc: fix i2c device string format

2007-08-15 Thread Stephen Rothwell
On Wed, 15 Aug 2007 21:15:03 +0200 (CEST) Guennadi Liakhovetski <[EMAIL PROTECTED]> wrote: > > diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c > index 727453d..c0d66df 100644 > --- a/arch/powerpc/sysdev/fsl_soc.c > +++ b/arch/powerpc/sysdev/fsl_soc.c > @@ -320,21 +320,26

Re: [PATCH] powerpc: fix i2c device string format

2007-08-15 Thread Guennadi Liakhovetski
On Wed, 15 Aug 2007, Scott Wood wrote: > BTW, is there any reason this stuff is fsl_soc specific? I'd think > prom_parse.c (or better yet, drivers/of/ or drivers/i2c/, now that some OF > calls have been factored out) would be a better place. Minimal intrusion:-) Initially in your patch you added

Re: [PATCH] powerpc: fix i2c device string format

2007-08-15 Thread Scott Wood
Guennadi Liakhovetski wrote: > diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c > index 727453d..c0d66df 100644 > --- a/arch/powerpc/sysdev/fsl_soc.c > +++ b/arch/powerpc/sysdev/fsl_soc.c > @@ -320,21 +320,26 @@ static struct i2c_driver_device i2c_devices[] > __initdata =

Re: [PATCH] powerpc: fix i2c device string format

2007-08-15 Thread Guennadi Liakhovetski
Use strlcpy() to guarantee strings in i2c device type and driver_name fields are 0-terminated. Signed-off-by: Guennadi Liakhovetski <[EMAIL PROTECTED]> --- On Wed, 15 Aug 2007, Paul Mackerras wrote: > That's not a commit message I can use. Please repost with an > informative commit message th

Re: [PATCH] powerpc: fix i2c device string format

2007-08-14 Thread Paul Mackerras
Guennadi Liakhovetski writes: > On Thu, 9 Aug 2007, Segher Boessenkool wrote: > > > > > strncpy() won't put a terminating zero on there, is everything > > > > that uses the resulting string okay with that? Also, if the > > > > name gets cut short, it might match some _other_ expected name. > > >

Re: [PATCH] powerpc: fix i2c device string format

2007-08-10 Thread Segher Boessenkool
> hm... Well, the worst that could happen, if an "evil" programmer > defines > too long a name, it gets truncated, and then binds to a wrong driver, > well, the worst that can happen is that your hardware gets damaged, > not a > big thing. :-) > However, some might disagree, so, below is a new

Re: [PATCH] powerpc: fix i2c device string format

2007-08-09 Thread Guennadi Liakhovetski
On Thu, 9 Aug 2007, Segher Boessenkool wrote: > > > strncpy() won't put a terminating zero on there, is everything > > > that uses the resulting string okay with that? Also, if the > > > name gets cut short, it might match some _other_ expected name. > > > > On Wed, 1 Aug 2007, Scott Wood wrote:

Re: [PATCH] powerpc: fix i2c device string format

2007-08-09 Thread Segher Boessenkool
>> strncpy() won't put a terminating zero on there, is everything >> that uses the resulting string okay with that? Also, if the >> name gets cut short, it might match some _other_ expected name. > > On Wed, 1 Aug 2007, Scott Wood wrote: > >> You could use strlcpy() instead, which always leaves a

[PATCH] powerpc: fix i2c device string format

2007-08-07 Thread Guennadi Liakhovetski
On Wed, 1 Aug 2007, Segher Boessenkool wrote: > strncpy() won't put a terminating zero on there, is everything > that uses the resulting string okay with that? Also, if the > name gets cut short, it might match some _other_ expected name. On Wed, 1 Aug 2007, Scott Wood wrote: > You could use st