On 01/21/2012 06:57 PM, Mark Brown wrote: > On Sat, Jan 21, 2012 at 05:10:22PM +0100, Sylwester Nawrocki wrote: >>> - i2c = kzalloc(sizeof(struct s3c24xx_i2c), GFP_KERNEL); >>> + i2c = devm_kzalloc(&pdev->dev, sizeof(struct s3c24xx_i2c), GFP_KERNEL); > >> Just in case you are resending the patch for any other reason, it might be worth >> to change to sizeof(*i2c) for consistency. > > Consistency with...? Consistency with the rest of code in i2c-s3c244.c, all other occurrences of sizeof take name of a variable, rather than its type. > TBH I'd rather not change the coding style as well as presumably Ben > likes that the way it is. If that's Ben's will then let it stay as it is. I don't even dare to propose any change ;) It's rather a meaningless detail. I personally like more using variable's name, and I had a feeling it was preferred style in the kernel. It's even mentioned in Documentation/CodingStyle: "The kernel provides the following general purpose memory allocators: kmalloc(), kzalloc(), kcalloc(), vmalloc(), and vzalloc(). Please refer to the API documentation for further information about them. The preferred form for passing a size of a struct is the following: p = kmalloc(sizeof(*p), ...); The alternative form where struct name is spelled out hurts readability and introduces an opportunity for a bug when the pointer variable type is changed but the corresponding sizeof that is passed to a memory allocator is not." -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html