From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Subject: Re: [PATCH 05/25] drivers/i2c: Use static const char arrays Date: Mon, 13 Sep 2010 13:16:07 -0700 Message-ID: <1284408967.26719.36.camel@Joe-Laptop> References: <4C8E84A0.1010606@jic23.retrosnub.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C8E84A0.1010606-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org> Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Jonathan Cameron Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Jean Delvare (PC drivers, core)" , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linus Walleij , "Ben Dooks (embedded platforms)" , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-i2c@vger.kernel.org On Mon, 2010-09-13 at 21:08 +0100, Jonathan Cameron wrote: > Commit message is somewhat inaccurate... Yeah, sorry 'bout that. That's what I get for using a script. I did write an intro with more complete description. > > diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c > > @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev) > > } > > > > bus_nr = pdev->id; > > - clk_name[3] += (char)bus_nr; > > + sprintf(clk_name, "I2C%c", '0' + bus_nr); > I'm guessing that there are never more than a couple of these. > Why is this method a better bet than just putting %d? It tries to standardize the style use and it avoids possible future checkpatch warnings of: char foo[] = "bar" char array could possibly be static const. There was another use with "%1.1d" somewhere. The end result is the same, so I don't really care much if this sort of change is applied or not. The possible checkpatch message could just be considered noise but Mike Frysinger seemed to prefer it, so I thought I could try to accommodate him. cheers, Joe