netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] nfc: hci: Save a few bytes of memory when registering a 'nfc_llc' engine
@ 2024-02-03  7:51 Christophe JAILLET
  2024-02-03  7:51 ` [PATCH v2 1/2] nfc: hci: Introduce nfc_llc_del_engine() to reduce code duplication Christophe JAILLET
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Christophe JAILLET @ 2024-02-03  7:51 UTC (permalink / raw)
  To: krzysztof.kozlowski, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET

nfc_llc_register() calls pass a string literal as the 'name' parameter.

So kstrdup_const() can be used instead of kfree() to avoid a memory
allocation in such cases.

v2: Add a new helper function, nfc_llc_del_engine(), to reduce code
    duplication. This is needed to address Jakub Kicinski's comment
    about nfc_llc_exit() that was not updated in v1.

v1: https://lore.kernel.org/all/6d2b8c390907dcac2e4dc6e71f1b2db2ef8abef1.1705744530.git.christophe.jaillet@wanadoo.fr/

Christophe JAILLET (2):
  nfc: hci: Introduce nfc_llc_del_engine() to reduce code duplication
  nfc: hci: Save a few bytes of memory when registering a 'nfc_llc'
    engine

 net/nfc/hci/llc.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-06 14:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-03  7:51 [PATCH v2 0/2] nfc: hci: Save a few bytes of memory when registering a 'nfc_llc' engine Christophe JAILLET
2024-02-03  7:51 ` [PATCH v2 1/2] nfc: hci: Introduce nfc_llc_del_engine() to reduce code duplication Christophe JAILLET
2024-02-06 14:30   ` Simon Horman
2024-02-03  7:51 ` [PATCH v2 2/2] nfc: hci: Save a few bytes of memory when registering a 'nfc_llc' engine Christophe JAILLET
2024-02-06 14:34   ` Simon Horman
2024-02-06 14:40 ` [PATCH v2 0/2] " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).