From: Lars-Peter Clausen Date: Fri, 14 Feb 2014 14:19:00 +0000 (+0000) Subject: iio: Avoid unnecessary kasprintf X-Git-Tag: v3.15-rc1~139^2~912^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bbcf7e13695c70f13b2cae59392016c0fa2e7a6;p=pandora-kernel.git iio: Avoid unnecessary kasprintf name_format already contains the final name and no format characters. So the code basically reads: dev_attr->attr.name = kstrdup(GFP_KERNEL, name_format); if (dev_attr->attr.name == NULL) ... kfree(name_format); Which means we can save one alloc and free pair per attribute name if we directly assign name_format to dev_attr->attr.name. The patch also renames name_format to name to denote that this is indeed the final name and has no format characters in it. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron --- Reading git-diff-tree failed