summaryrefslogtreecommitdiffstats
path: root/drivers/iio/light/Makefile
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-02-14 14:19:00 +0000
committerJonathan Cameron <jic23@kernel.org>2014-02-18 10:31:11 +0000
commit7bbcf7e13695c70f13b2cae59392016c0fa2e7a6 (patch)
tree0924f4ccf137451f6186fb889b8c0a6bdb9a5e90 /drivers/iio/light/Makefile
parent77bfa8baa0c230eb3d8acccd7d341f406a32cdf4 (diff)
downloadlinux-7bbcf7e13695c70f13b2cae59392016c0fa2e7a6.tar.gz
linux-7bbcf7e13695c70f13b2cae59392016c0fa2e7a6.tar.bz2
linux-7bbcf7e13695c70f13b2cae59392016c0fa2e7a6.zip
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 <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/light/Makefile')
0 files changed, 0 insertions, 0 deletions