Skip to contentSkip to conversation

Staging: vboxvideo: Do not return -ENOSYS

PATCH Superseded Debleena Sen 2 participants 3 messages Mar 7, 2019 – Mar 8, 2019 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: vboxvideo: Do not return -ENOSYS

New instances of ENOSYS are errors. Refer /usr/include/asm-generic/errno.h to find correct error code to use in place of ENOSYS.
In vbox_prime.c, replace all occurrences of -ENOSYS with -ENODEV to fix checkpatch.pl warning:
WARNING: ENOSYS means 'invalid syscall nr' and nothing else

---
 drivers/staging/vboxvideo/vbox_prime.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/vboxvideo/vbox_prime.c +5 -5
index d61985b..702b1aa 100644
@@ -16,7 +16,7 @@
 int vbox_gem_prime_pin(struct drm_gem_object *obj)
 {
 	WARN_ONCE(1, "not implemented");
-	return -ENOSYS;
+	return -ENODEV;
 }
 
 void vbox_gem_prime_unpin(struct drm_gem_object *obj)
@@ -27,7 +27,7 @@ void vbox_gem_prime_unpin(struct drm_gem_object *obj)
 struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj)
 {
 	WARN_ONCE(1, "not implemented");
-	return ERR_PTR(-ENOSYS);
+	return ERR_PTR(-ENODEV);
 }
 
 struct drm_gem_object *vbox_gem_prime_import_sg_table(
@@ -35,13 +35,13 @@ struct drm_gem_object *vbox_gem_prime_import_sg_table(
 	struct sg_table *table)
 {
 	WARN_ONCE(1, "not implemented");
-	return ERR_PTR(-ENOSYS);
+	return ERR_PTR(-ENODEV);
 }
 
 void *vbox_gem_prime_vmap(struct drm_gem_object *obj)
 {
 	WARN_ONCE(1, "not implemented");
-	return ERR_PTR(-ENOSYS);
+	return ERR_PTR(-ENODEV);
 }
 
 void vbox_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
@@ -52,5 +52,5 @@ void vbox_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
 int vbox_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *area)
 {
 	WARN_ONCE(1, "not implemented");
-	return -ENOSYS;
+	return -ENODEV;
 }
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Debleena Sen

New instances of ENOSYS are errors. Refer /usr/include/asm-generic/errno.h to find correct error code to use in place of ENOSYS.

The second sentence is strange. It would be better to just put the following message, and then add something at the end explaining how you chose -ENODEV.

julia

Quoted 64 lines

In vbox_prime.c, replace all occurrences of -ENOSYS with -ENODEV to fix checkpatch.pl warning:
WARNING: ENOSYS means 'invalid syscall nr' and nothing else

---
 drivers/staging/vboxvideo/vbox_prime.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/vboxvideo/vbox_prime.c +5 -6
index d61985b..702b1aa 100644
@@ -16,7 +16,7 @@
 int vbox_gem_prime_pin(struct drm_gem_object *obj)
 {
 	WARN_ONCE(1, "not implemented");
-	return -ENOSYS;
+	return -ENODEV;
 }
 
 void vbox_gem_prime_unpin(struct drm_gem_object *obj)
@@ -27,7 +27,7 @@ void vbox_gem_prime_unpin(struct drm_gem_object *obj)
 struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj)
 {
 	WARN_ONCE(1, "not implemented");
-	return ERR_PTR(-ENOSYS);
+	return ERR_PTR(-ENODEV);
 }
 
 struct drm_gem_object *vbox_gem_prime_import_sg_table(
@@ -35,13 +35,13 @@ struct drm_gem_object *vbox_gem_prime_import_sg_table(
 	struct sg_table *table)
 {
 	WARN_ONCE(1, "not implemented");
-	return ERR_PTR(-ENOSYS);
+	return ERR_PTR(-ENODEV);
 }
 
 void *vbox_gem_prime_vmap(struct drm_gem_object *obj)
 {
 	WARN_ONCE(1, "not implemented");
-	return ERR_PTR(-ENOSYS);
+	return ERR_PTR(-ENODEV);
 }
 
 void vbox_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
@@ -52,5 +52,5 @@ void vbox_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
 int vbox_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *area)
 {
 	WARN_ONCE(1, "not implemented");
-	return -ENOSYS;
+	return -ENODEV;
 }
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1551991259-109878-1-git-send-email-idebleenasen%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 77 lines · On Fri, 8 Mar 2019, 05:50 Julia Lawall, <[email protected]> wrote:
Quoted 1 line · Debleena Sen

New instances of ENOSYS are errors. Refer

/usr/include/asm-generic/errno.h

Quoted 1 line

to find correct error code to use in place of ENOSYS.

The second sentence is strange. It would be better to just put the following message, and then add something at the end explaining how you chose -ENODEV.

julia

Review

Quoted 10 lines

In vbox_prime.c, replace all occurrences of -ENOSYS with -ENODEV to fix checkpatch.pl warning:
WARNING: ENOSYS means 'invalid syscall nr' and nothing else

---
 drivers/staging/vboxvideo/vbox_prime.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/vboxvideo/vbox_prime.c

drivers/staging/vboxvideo/vbox_prime.c struct drm_gem_object

Quoted 22 lines

index d61985b..702b1aa 100644

drivers/staging/vboxvideo/vbox_prime.c +2 -2
@@ -16,7 +16,7 @@
 int vbox_gem_prime_pin(struct drm_gem_object *obj)
 {
      WARN_ONCE(1, "not implemented");
-     return -ENOSYS;
+     return -ENODEV;
 }
 
 void vbox_gem_prime_unpin(struct drm_gem_object *obj)
@@ -27,7 +27,7 @@ void vbox_gem_prime_unpin(struct drm_gem_object *obj)
 struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj)
 {
      WARN_ONCE(1, "not implemented");
-     return ERR_PTR(-ENOSYS);
+     return ERR_PTR(-ENODEV);
 }
 
 struct drm_gem_object *vbox_gem_prime_import_sg_table(
@@ -35,13 +35,13 @@ struct drm_gem_object

*vbox_gem_prime_import_sg_table(

drivers/staging/vboxvideo/vbox_prime.c void vbox_gem_prime_vunmap(struct drm_gem_object *obj,

Quoted 16 lines
drivers/staging/vboxvideo/vbox_prime.c +2 -2
      struct sg_table *table)
 {
      WARN_ONCE(1, "not implemented");
-     return ERR_PTR(-ENOSYS);
+     return ERR_PTR(-ENODEV);
 }
 
 void *vbox_gem_prime_vmap(struct drm_gem_object *obj)
 {
      WARN_ONCE(1, "not implemented");
-     return ERR_PTR(-ENOSYS);
+     return ERR_PTR(-ENODEV);
 }
 
 void vbox_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
@@ -52,5 +52,5 @@ void vbox_gem_prime_vunmap(struct drm_gem_object *obj,

void *vaddr)

drivers/staging/vboxvideo/vbox_prime.c void vbox_gem_prime_vunmap(struct drm_gem_object *obj, · line 52

Quoted 1 line
drivers/staging/vboxvideo/vbox_prime.c +0 -0
 int vbox_gem_prime_mmap(struct drm_gem_object *obj, struct

vm_area_struct *area)

Quoted 10 lines
drivers/staging/vboxvideo/vbox_prime.c +1 -2
 {
      WARN_ONCE(1, "not implemented");
-     return -ENOSYS;
+     return -ENODEV;
 }
--

2.7.4

--
You received this message because you are subscribed to the Google

Quoted 10 lines

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/1551991259-109878-1-git-send-email-idebleenasen%40gmail.com
.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

OK. I'll do that.

Quoted 1 line