]> git.itanic.dy.fi Git - linux-stable/commit
parport: Save a few bytes of memory
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 24 Nov 2023 21:14:36 +0000 (22:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Dec 2023 02:09:31 +0000 (11:09 +0900)
commitad66d503052d51ff9efeab487f41a39816ffc11c
tree7ad560ecf23b7a195489eb333f3b405805c93ec4
parent190015a4bb016e0263297fa5ad20744b8ce98b50
parport: Save a few bytes of memory

Most of parport_register_dev_model() callers pass a 'name' that is a
constant string.

So kstrdup_const() can be used to save the duplication of this string
when it is not needed. This saves a few bytes of memory.

Use kfree_const() accordingly when this string is freed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/0eba5f2ddd142ab0f577f67e482d1152b40ee720.1700860416.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/parport/share.c