Skip to contentSkip to conversation

efivarfs: use QSTR() in efivarfs_alloc_dentry

PATCH In review Thorsten Blum 3 participants 3 messages Apr 22 – Apr 25

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efivarfs: use QSTR() in efivarfs_alloc_dentry

Use QSTR() and drop strlen() in efivarfs_alloc_dentry().

---
 fs/efivarfs/super.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/efivarfs/super.c +1 -4
index 1c5224cf183e..95a685f022e6 100644
@@ -192,12 +192,9 @@ static const struct dentry_operations efivarfs_d_ops = {
 static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name)
 {
 	struct dentry *d;
-	struct qstr q;
+	struct qstr q = QSTR(name);
 	int err;
 
-	q.name = name;
-	q.len = strlen(name);
-
 	err = efivarfs_d_hash(parent, &q);
 	if (err)
 		return ERR_PTR(err);
maintainer
#1 lore raw

Hi Thorsten,

Quoted 7 lines · Thorsten Blum

Use QSTR() and drop strlen() in efivarfs_alloc_dentry().

---
 fs/efivarfs/super.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

I'll queue this up once -rc1 comes around. Thanks.

Quoted 18 lines
fs/efivarfs/super.c +1 -4
index 1c5224cf183e..95a685f022e6 100644
@@ -192,12 +192,9 @@ static const struct dentry_operations efivarfs_d_ops = {
 static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name)
 {
 	struct dentry *d;
-	struct qstr q;
+	struct qstr q = QSTR(name);
 	int err;
 
-	q.name = name;
-	q.len = strlen(name);
-
 	err = efivarfs_d_hash(parent, &q);
 	if (err)
 		return ERR_PTR(err);
#2 lore raw
In reply to Thorsten Blum
Quoted 1 line · Thorsten Blum

Use QSTR() and drop strlen() in efivarfs_alloc_dentry().

QSTR contains strlen(), so it's not really accurate to say it's been dropped; this is merely changing to use a #define that does exactly the same as the original code.

Regards,

James