* [PATCH 1/5] drm/vgem: Indent switch and case at the same level
2018-03-08 2:02 [PATCH 0/5] drm/vgem: Checkpatch cleanup for vgem Rodrigo Siqueira
@ 2018-03-08 2:02 ` Rodrigo Siqueira
2018-03-08 2:03 ` [PATCH 2/5] drm/vgem: Remove assignment in if condition Rodrigo Siqueira
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Rodrigo Siqueira @ 2018-03-08 2:02 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel, kernel-janitors, linux-kernel
This patch fixes the checkpatch.pl errors:
vgem_drv.c:97: ERROR: switch and case should be at the same indent
vgem_drv.c:97: ERROR: trailing statements should be on next line
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
drivers/gpu/drm/vgem/vgem_drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 2524ff116f00..5767030d04a8 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -94,7 +94,8 @@ static int vgem_gem_fault(struct vm_fault *vmf)
if (!IS_ERR(page)) {
vmf->page = page;
ret = 0;
- } else switch (PTR_ERR(page)) {
+ } else {
+ switch (PTR_ERR(page)) {
case -ENOSPC:
case -ENOMEM:
ret = VM_FAULT_OOM;
@@ -110,8 +111,8 @@ static int vgem_gem_fault(struct vm_fault *vmf)
WARN_ON(PTR_ERR(page));
ret = VM_FAULT_SIGBUS;
break;
+ }
}
-
}
return ret;
}
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/5] drm/vgem: Remove assignment in if condition
2018-03-08 2:02 [PATCH 0/5] drm/vgem: Checkpatch cleanup for vgem Rodrigo Siqueira
2018-03-08 2:02 ` [PATCH 1/5] drm/vgem: Indent switch and case at the same level Rodrigo Siqueira
@ 2018-03-08 2:03 ` Rodrigo Siqueira
2018-03-08 2:03 ` [PATCH 3/5] drm/vgem: Replace uint32_t for u32 Rodrigo Siqueira
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Rodrigo Siqueira @ 2018-03-08 2:03 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel, kernel-janitors, linux-kernel
This patch fixes the checkpatch.pl error:
vgem_fence.c:196: ERROR: do not use assignment in if condition
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
drivers/gpu/drm/vgem/vgem_fence.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c
index b28876c222b4..f5b659463b00 100644
--- a/drivers/gpu/drm/vgem/vgem_fence.c
+++ b/drivers/gpu/drm/vgem/vgem_fence.c
@@ -191,10 +191,13 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
/* Expose the fence via the dma-buf */
ret = 0;
reservation_object_lock(resv, NULL);
- if (arg->flags & VGEM_FENCE_WRITE)
+ if (arg->flags & VGEM_FENCE_WRITE) {
reservation_object_add_excl_fence(resv, fence);
- else if ((ret = reservation_object_reserve_shared(resv)) == 0)
- reservation_object_add_shared_fence(resv, fence);
+ } else {
+ ret = reservation_object_reserve_shared(resv);
+ if (!ret)
+ reservation_object_add_shared_fence(resv, fence);
+ }
reservation_object_unlock(resv);
/* Record the fence in our idr for later signaling */
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/5] drm/vgem: Replace uint32_t for u32
2018-03-08 2:02 [PATCH 0/5] drm/vgem: Checkpatch cleanup for vgem Rodrigo Siqueira
2018-03-08 2:02 ` [PATCH 1/5] drm/vgem: Indent switch and case at the same level Rodrigo Siqueira
2018-03-08 2:03 ` [PATCH 2/5] drm/vgem: Remove assignment in if condition Rodrigo Siqueira
@ 2018-03-08 2:03 ` Rodrigo Siqueira
2018-03-08 2:03 ` [PATCH 4/5] drm/vgem: Add space around operators Rodrigo Siqueira
2018-03-08 2:03 ` [PATCH 5/5] drm/vgem: Remove '(' from the end of line Rodrigo Siqueira
4 siblings, 0 replies; 6+ messages in thread
From: Rodrigo Siqueira @ 2018-03-08 2:03 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel, kernel-janitors, linux-kernel
This patch fixes the checkpatch.pl check:
vgem_drv.c:229: CHECK: Prefer kernel type 'u32' over 'uint32_t'
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 5767030d04a8..bf704ed51da4 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -226,7 +226,7 @@ static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
}
static int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev,
- uint32_t handle, uint64_t *offset)
+ u32 handle, uint64_t *offset)
{
struct drm_gem_object *obj;
int ret;
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 4/5] drm/vgem: Add space around operators
2018-03-08 2:02 [PATCH 0/5] drm/vgem: Checkpatch cleanup for vgem Rodrigo Siqueira
` (2 preceding siblings ...)
2018-03-08 2:03 ` [PATCH 3/5] drm/vgem: Replace uint32_t for u32 Rodrigo Siqueira
@ 2018-03-08 2:03 ` Rodrigo Siqueira
2018-03-08 2:03 ` [PATCH 5/5] drm/vgem: Remove '(' from the end of line Rodrigo Siqueira
4 siblings, 0 replies; 6+ messages in thread
From: Rodrigo Siqueira @ 2018-03-08 2:03 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel, kernel-janitors, linux-kernel
This patch fixes the checkpatch.pl check and warning:
vgem_fence.c:28: CHECK: spaces preferred around that '*' (ctx:VxV)
vgem_drv.c:255: CHECK: spaces preferred around that '|' (ctx:VxV)
vgem_drv.c:256: WARNING: line over 80 characters
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
drivers/gpu/drm/vgem/vgem_drv.c | 8 ++++++--
drivers/gpu/drm/vgem/vgem_fence.c | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index bf704ed51da4..6e6084e3204a 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -252,8 +252,12 @@ static int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev,
}
static struct drm_ioctl_desc vgem_ioctls[] = {
- DRM_IOCTL_DEF_DRV(VGEM_FENCE_ATTACH, vgem_fence_attach_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
- DRM_IOCTL_DEF_DRV(VGEM_FENCE_SIGNAL, vgem_fence_signal_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
+ DRM_IOCTL_DEF_DRV(VGEM_FENCE_ATTACH,
+ vgem_fence_attach_ioctl,
+ DRM_AUTH | DRM_RENDER_ALLOW),
+ DRM_IOCTL_DEF_DRV(VGEM_FENCE_SIGNAL,
+ vgem_fence_signal_ioctl,
+ DRM_AUTH | DRM_RENDER_ALLOW),
};
static int vgem_mmap(struct file *filp, struct vm_area_struct *vma)
diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c
index f5b659463b00..d0bcb5fb33d1 100644
--- a/drivers/gpu/drm/vgem/vgem_fence.c
+++ b/drivers/gpu/drm/vgem/vgem_fence.c
@@ -25,7 +25,7 @@
#include "vgem_drv.h"
-#define VGEM_FENCE_TIMEOUT (10*HZ)
+#define VGEM_FENCE_TIMEOUT (10 * HZ)
struct vgem_fence {
struct dma_fence base;
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 5/5] drm/vgem: Remove '(' from the end of line
2018-03-08 2:02 [PATCH 0/5] drm/vgem: Checkpatch cleanup for vgem Rodrigo Siqueira
` (3 preceding siblings ...)
2018-03-08 2:03 ` [PATCH 4/5] drm/vgem: Add space around operators Rodrigo Siqueira
@ 2018-03-08 2:03 ` Rodrigo Siqueira
4 siblings, 0 replies; 6+ messages in thread
From: Rodrigo Siqueira @ 2018-03-08 2:03 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel, kernel-janitors, linux-kernel
This patch fixes the checkpatch.pl check:
vgem_drv.c:91: CHECK: Lines should not end with a '('
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
drivers/gpu/drm/vgem/vgem_drv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 6e6084e3204a..4ddf3b8c3875 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -87,10 +87,10 @@ static int vgem_gem_fault(struct vm_fault *vmf)
mutex_unlock(&obj->pages_lock);
if (ret) {
struct page *page;
+ struct address_space *mapping;
- page = shmem_read_mapping_page(
- file_inode(obj->base.filp)->i_mapping,
- page_offset);
+ mapping = file_inode(obj->base.filp)->i_mapping;
+ page = shmem_read_mapping_page(mapping, page_offset);
if (!IS_ERR(page)) {
vmf->page = page;
ret = 0;
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread