All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] loadpin: stop using bdevname
@ 2022-05-12  6:20 Christoph Hellwig
  2022-05-12 16:32 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2022-05-12  6:20 UTC (permalink / raw)
  To: keescook; +Cc: jmorris, serge, linux-security-module

Use the %pg format specifier to save on stack consuption and code size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 security/loadpin/loadpin.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c
index b12f7d986b1e3..ad4e6756c0386 100644
--- a/security/loadpin/loadpin.c
+++ b/security/loadpin/loadpin.c
@@ -78,11 +78,8 @@ static void check_pinning_enforcement(struct super_block *mnt_sb)
 	 * device, allow sysctl to change modes for testing.
 	 */
 	if (mnt_sb->s_bdev) {
-		char bdev[BDEVNAME_SIZE];
-
 		ro = bdev_read_only(mnt_sb->s_bdev);
-		bdevname(mnt_sb->s_bdev, bdev);
-		pr_info("%s (%u:%u): %s\n", bdev,
+		pr_info("%pg (%u:%u): %s\n", mnt_sb->s_bdev,
 			MAJOR(mnt_sb->s_bdev->bd_dev),
 			MINOR(mnt_sb->s_bdev->bd_dev),
 			ro ? "read-only" : "writable");
-- 
2.30.2


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

* Re: [PATCH] loadpin: stop using bdevname
  2022-05-12  6:20 [PATCH] loadpin: stop using bdevname Christoph Hellwig
@ 2022-05-12 16:32 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2022-05-12 16:32 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Kees Cook, linux-security-module, serge, jmorris

On Thu, 12 May 2022 08:20:14 +0200, Christoph Hellwig wrote:
> Use the %pg format specifier to save on stack consuption and code size.

Applied to for-next/hardening, thanks!

[1/1] loadpin: stop using bdevname
      https://git.kernel.org/kees/c/8c296a9ad2c8

-- 
Kees Cook


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

end of thread, other threads:[~2022-05-12 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12  6:20 [PATCH] loadpin: stop using bdevname Christoph Hellwig
2022-05-12 16:32 ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.