[PATCH] drm/udl: Make page_flip asynchronous

2017-07-06 Thread Dawid Kurek
In page_flip vblank is sent with no delay. Driver does not know when the
actual update is present on the display and has no means for getting
this information from a device. It is practically impossible to say
exactly *when* as there is also i.e. a usb delay.

When we are unable to determine when the vblank actually happens we may
assume it will behave accordingly, i.e. it will present frames with
proper timing. In the worst case scenario it should take up to duration
of one frame (we may get new frame in the device just after presenting
current one so we would need to wait for the whole frame).

Because of the asynchronous nature of the delay we need to synchronize:
 * read/write vrefresh/page_flip data when changing mode and
   preparing/executing vblank
 * USB requests to prevent interleaved access to URBs for two different
   frame buffers

All those changes are backports from ChromeOS:
  1. https://chromium-review.googlesource.com/250622
  2. https://chromium-review.googlesource.com/249450
  partially, only change in udl_modeset.c for 'udl_flip_queue'
  3. https://chromium-review.googlesource.com/321378
  4. https://chromium-review.googlesource.com/324119
+ fixes for checkpatch and latest drm changes

Cc: h...@chromium.org
Cc: marc...@chromium.org
Cc: za...@chromium.org
Cc: db...@google.com
Signed-off-by: Dawid Kurek <dawid.ku...@displaylink.com>
---
 drivers/gpu/drm/udl/udl_drv.h |   4 +
 drivers/gpu/drm/udl/udl_fb.c  |  28 ---
 drivers/gpu/drm/udl/udl_main.c|   3 +
 drivers/gpu/drm/udl/udl_modeset.c | 160 ++
 4 files changed, 171 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index 2a75ab8..b93fb8d 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -47,6 +47,7 @@ struct urb_list {
 };
 
 struct udl_fbdev;
+struct udl_flip_queue;
 
 struct udl_device {
struct device *dev;
@@ -66,6 +67,9 @@ struct udl_device {
atomic_t bytes_identical; /* saved effort with backbuffer comparison */
atomic_t bytes_sent; /* to usb, after compression including overhead */
atomic_t cpu_kcycles_used; /* transpired during pixel processing */
+
+   struct udl_flip_queue *flip_queue;
+   struct mutex transfer_lock; /* to serialize transfers */
 };
 
 struct udl_gem_object {
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
index 4a65003..6dd9a49 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
@@ -82,7 +82,7 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int 
y,
 {
struct drm_device *dev = fb->base.dev;
struct udl_device *udl = dev->dev_private;
-   int i, ret;
+   int i, ret = 0;
char *cmd;
cycles_t start_cycles, end_cycles;
int bytes_sent = 0;
@@ -91,18 +91,22 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
int aligned_x;
int bpp = fb->base.format->cpp[0];
 
+   mutex_lock(>transfer_lock);
+
if (!fb->active_16)
-   return 0;
+   goto out;
 
if (!fb->obj->vmapping) {
ret = udl_gem_vmap(fb->obj);
if (ret == -ENOMEM) {
DRM_ERROR("failed to vmap fb\n");
-   return 0;
+   ret = 0;
+   goto out;
}
if (!fb->obj->vmapping) {
DRM_ERROR("failed to vmapping\n");
-   return 0;
+   ret = 0;
+   goto out;
}
}
 
@@ -112,14 +116,18 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
 
if ((width <= 0) ||
(x + width > fb->base.width) ||
-   (y + height > fb->base.height))
-   return -EINVAL;
+   (y + height > fb->base.height)) {
+   ret = -EINVAL;
+   goto out;
+   }
 
start_cycles = get_cycles();
 
urb = udl_get_urb(dev);
-   if (!urb)
-   return 0;
+   if (!urb) {
+   ret = 0;
+   goto out;
+   }
cmd = urb->transfer_buffer;
 
for (i = y; i < y + height ; i++) {
@@ -151,7 +159,9 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
>> 10)), /* Kcycles */
   >cpu_kcycles_used);
 
-   return 0;
+out:
+   mutex_unlock(>transfer_lock);
+   return ret;
 }
 
 static int udl_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
index a9d93b8..d376233 100644
--- a/drivers/gpu/drm/udl/udl_main.c
+++ b/drivers/gpu/drm/udl/udl_main.c
@@ -319,6 +319,8 @@ int udl_driver_load(struct drm_device *dev, unsigned long 
flags)
   

[PATCH] drm/udl: Make page_flip asynchronous

2017-07-06 Thread Dawid Kurek
In page_flip vblank is sent with no delay. Driver does not know when the
actual update is present on the display and has no means for getting
this information from a device. It is practically impossible to say
exactly *when* as there is also i.e. a usb delay.

When we are unable to determine when the vblank actually happens we may
assume it will behave accordingly, i.e. it will present frames with
proper timing. In the worst case scenario it should take up to duration
of one frame (we may get new frame in the device just after presenting
current one so we would need to wait for the whole frame).

Because of the asynchronous nature of the delay we need to synchronize:
 * read/write vrefresh/page_flip data when changing mode and
   preparing/executing vblank
 * USB requests to prevent interleaved access to URBs for two different
   frame buffers

All those changes are backports from ChromeOS:
  1. https://chromium-review.googlesource.com/250622
  2. https://chromium-review.googlesource.com/249450
  partially, only change in udl_modeset.c for 'udl_flip_queue'
  3. https://chromium-review.googlesource.com/321378
  4. https://chromium-review.googlesource.com/324119
+ fixes for checkpatch and latest drm changes

Cc: h...@chromium.org
Cc: marc...@chromium.org
Cc: za...@chromium.org
Cc: db...@google.com
Signed-off-by: Dawid Kurek 
---
 drivers/gpu/drm/udl/udl_drv.h |   4 +
 drivers/gpu/drm/udl/udl_fb.c  |  28 ---
 drivers/gpu/drm/udl/udl_main.c|   3 +
 drivers/gpu/drm/udl/udl_modeset.c | 160 ++
 4 files changed, 171 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index 2a75ab8..b93fb8d 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -47,6 +47,7 @@ struct urb_list {
 };
 
 struct udl_fbdev;
+struct udl_flip_queue;
 
 struct udl_device {
struct device *dev;
@@ -66,6 +67,9 @@ struct udl_device {
atomic_t bytes_identical; /* saved effort with backbuffer comparison */
atomic_t bytes_sent; /* to usb, after compression including overhead */
atomic_t cpu_kcycles_used; /* transpired during pixel processing */
+
+   struct udl_flip_queue *flip_queue;
+   struct mutex transfer_lock; /* to serialize transfers */
 };
 
 struct udl_gem_object {
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
index 4a65003..6dd9a49 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
@@ -82,7 +82,7 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int 
y,
 {
struct drm_device *dev = fb->base.dev;
struct udl_device *udl = dev->dev_private;
-   int i, ret;
+   int i, ret = 0;
char *cmd;
cycles_t start_cycles, end_cycles;
int bytes_sent = 0;
@@ -91,18 +91,22 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
int aligned_x;
int bpp = fb->base.format->cpp[0];
 
+   mutex_lock(>transfer_lock);
+
if (!fb->active_16)
-   return 0;
+   goto out;
 
if (!fb->obj->vmapping) {
ret = udl_gem_vmap(fb->obj);
if (ret == -ENOMEM) {
DRM_ERROR("failed to vmap fb\n");
-   return 0;
+   ret = 0;
+   goto out;
}
if (!fb->obj->vmapping) {
DRM_ERROR("failed to vmapping\n");
-   return 0;
+   ret = 0;
+   goto out;
}
}
 
@@ -112,14 +116,18 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
 
if ((width <= 0) ||
(x + width > fb->base.width) ||
-   (y + height > fb->base.height))
-   return -EINVAL;
+   (y + height > fb->base.height)) {
+   ret = -EINVAL;
+   goto out;
+   }
 
start_cycles = get_cycles();
 
urb = udl_get_urb(dev);
-   if (!urb)
-   return 0;
+   if (!urb) {
+   ret = 0;
+   goto out;
+   }
cmd = urb->transfer_buffer;
 
for (i = y; i < y + height ; i++) {
@@ -151,7 +159,9 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
>> 10)), /* Kcycles */
   >cpu_kcycles_used);
 
-   return 0;
+out:
+   mutex_unlock(>transfer_lock);
+   return ret;
 }
 
 static int udl_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
index a9d93b8..d376233 100644
--- a/drivers/gpu/drm/udl/udl_main.c
+++ b/drivers/gpu/drm/udl/udl_main.c
@@ -319,6 +319,8 @@ int udl_driver_load(struct drm_device *dev, unsigned long 
flags)
if (!udl)
r

[PATCH] drm/udl: Make page_flip asynchronous

2017-06-21 Thread Dawid Kurek
In page_flip vblank is sent with no delay. Driver does not know when the
actual update is present on the display and has no means for getting
this information from a device. It is practically impossible to say
exactly *when* as there is also i.e. a usb delay.

When we are unable to determine when the vblank actually happens we may
assume it will behave accordingly, i.e. it will present frames with
proper timing. In the worst case scenario it should take up to duration
of one frame (we may get new frame in the device just after presenting
current one so we would need to wait for the whole frame).

Because of the asynchronous nature of the delay we need to synchronize:
 * read/write vrefresh/page_flip data when changing mode and
   preparing/executing vblank
 * USB requests to prevent interleaved access to URBs for two different
   frame buffers

All those changes are backports from ChromeOS:
  1. https://chromium-review.googlesource.com/250622
  2. https://chromium-review.googlesource.com/249450
  partially, only change in udl_modeset.c for 'udl_flip_queue'
  3. https://chromium-review.googlesource.com/321378
  4. https://chromium-review.googlesource.com/324119
+ fixes for checkpatch and latest drm changes

Cc: h...@chromium.org
Cc: marc...@chromium.org
Cc: za...@chromium.org
Cc: db...@google.com
Signed-off-by: Dawid Kurek <dawid.ku...@displaylink.com>
---
 drivers/gpu/drm/udl/udl_drv.h |   4 +
 drivers/gpu/drm/udl/udl_fb.c  |  28 ---
 drivers/gpu/drm/udl/udl_main.c|   3 +
 drivers/gpu/drm/udl/udl_modeset.c | 160 ++
 4 files changed, 171 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index 2a75ab8..b93fb8d 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -47,6 +47,7 @@ struct urb_list {
 };
 
 struct udl_fbdev;
+struct udl_flip_queue;
 
 struct udl_device {
struct device *dev;
@@ -66,6 +67,9 @@ struct udl_device {
atomic_t bytes_identical; /* saved effort with backbuffer comparison */
atomic_t bytes_sent; /* to usb, after compression including overhead */
atomic_t cpu_kcycles_used; /* transpired during pixel processing */
+
+   struct udl_flip_queue *flip_queue;
+   struct mutex transfer_lock; /* to serialize transfers */
 };
 
 struct udl_gem_object {
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
index 4a65003..6dd9a49 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
@@ -82,7 +82,7 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int 
y,
 {
struct drm_device *dev = fb->base.dev;
struct udl_device *udl = dev->dev_private;
-   int i, ret;
+   int i, ret = 0;
char *cmd;
cycles_t start_cycles, end_cycles;
int bytes_sent = 0;
@@ -91,18 +91,22 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
int aligned_x;
int bpp = fb->base.format->cpp[0];
 
+   mutex_lock(>transfer_lock);
+
if (!fb->active_16)
-   return 0;
+   goto out;
 
if (!fb->obj->vmapping) {
ret = udl_gem_vmap(fb->obj);
if (ret == -ENOMEM) {
DRM_ERROR("failed to vmap fb\n");
-   return 0;
+   ret = 0;
+   goto out;
}
if (!fb->obj->vmapping) {
DRM_ERROR("failed to vmapping\n");
-   return 0;
+   ret = 0;
+   goto out;
}
}
 
@@ -112,14 +116,18 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
 
if ((width <= 0) ||
(x + width > fb->base.width) ||
-   (y + height > fb->base.height))
-   return -EINVAL;
+   (y + height > fb->base.height)) {
+   ret = -EINVAL;
+   goto out;
+   }
 
start_cycles = get_cycles();
 
urb = udl_get_urb(dev);
-   if (!urb)
-   return 0;
+   if (!urb) {
+   ret = 0;
+   goto out;
+   }
cmd = urb->transfer_buffer;
 
for (i = y; i < y + height ; i++) {
@@ -151,7 +159,9 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
>> 10)), /* Kcycles */
   >cpu_kcycles_used);
 
-   return 0;
+out:
+   mutex_unlock(>transfer_lock);
+   return ret;
 }
 
 static int udl_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
index a9d93b8..d376233 100644
--- a/drivers/gpu/drm/udl/udl_main.c
+++ b/drivers/gpu/drm/udl/udl_main.c
@@ -319,6 +319,8 @@ int udl_driver_load(struct drm_device *dev, unsigned long 
flags)
   

[PATCH] drm/udl: Make page_flip asynchronous

2017-06-21 Thread Dawid Kurek
In page_flip vblank is sent with no delay. Driver does not know when the
actual update is present on the display and has no means for getting
this information from a device. It is practically impossible to say
exactly *when* as there is also i.e. a usb delay.

When we are unable to determine when the vblank actually happens we may
assume it will behave accordingly, i.e. it will present frames with
proper timing. In the worst case scenario it should take up to duration
of one frame (we may get new frame in the device just after presenting
current one so we would need to wait for the whole frame).

Because of the asynchronous nature of the delay we need to synchronize:
 * read/write vrefresh/page_flip data when changing mode and
   preparing/executing vblank
 * USB requests to prevent interleaved access to URBs for two different
   frame buffers

All those changes are backports from ChromeOS:
  1. https://chromium-review.googlesource.com/250622
  2. https://chromium-review.googlesource.com/249450
  partially, only change in udl_modeset.c for 'udl_flip_queue'
  3. https://chromium-review.googlesource.com/321378
  4. https://chromium-review.googlesource.com/324119
+ fixes for checkpatch and latest drm changes

Cc: h...@chromium.org
Cc: marc...@chromium.org
Cc: za...@chromium.org
Cc: db...@google.com
Signed-off-by: Dawid Kurek 
---
 drivers/gpu/drm/udl/udl_drv.h |   4 +
 drivers/gpu/drm/udl/udl_fb.c  |  28 ---
 drivers/gpu/drm/udl/udl_main.c|   3 +
 drivers/gpu/drm/udl/udl_modeset.c | 160 ++
 4 files changed, 171 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index 2a75ab8..b93fb8d 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -47,6 +47,7 @@ struct urb_list {
 };
 
 struct udl_fbdev;
+struct udl_flip_queue;
 
 struct udl_device {
struct device *dev;
@@ -66,6 +67,9 @@ struct udl_device {
atomic_t bytes_identical; /* saved effort with backbuffer comparison */
atomic_t bytes_sent; /* to usb, after compression including overhead */
atomic_t cpu_kcycles_used; /* transpired during pixel processing */
+
+   struct udl_flip_queue *flip_queue;
+   struct mutex transfer_lock; /* to serialize transfers */
 };
 
 struct udl_gem_object {
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
index 4a65003..6dd9a49 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
@@ -82,7 +82,7 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int 
y,
 {
struct drm_device *dev = fb->base.dev;
struct udl_device *udl = dev->dev_private;
-   int i, ret;
+   int i, ret = 0;
char *cmd;
cycles_t start_cycles, end_cycles;
int bytes_sent = 0;
@@ -91,18 +91,22 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
int aligned_x;
int bpp = fb->base.format->cpp[0];
 
+   mutex_lock(>transfer_lock);
+
if (!fb->active_16)
-   return 0;
+   goto out;
 
if (!fb->obj->vmapping) {
ret = udl_gem_vmap(fb->obj);
if (ret == -ENOMEM) {
DRM_ERROR("failed to vmap fb\n");
-   return 0;
+   ret = 0;
+   goto out;
}
if (!fb->obj->vmapping) {
DRM_ERROR("failed to vmapping\n");
-   return 0;
+   ret = 0;
+   goto out;
}
}
 
@@ -112,14 +116,18 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
 
if ((width <= 0) ||
(x + width > fb->base.width) ||
-   (y + height > fb->base.height))
-   return -EINVAL;
+   (y + height > fb->base.height)) {
+   ret = -EINVAL;
+   goto out;
+   }
 
start_cycles = get_cycles();
 
urb = udl_get_urb(dev);
-   if (!urb)
-   return 0;
+   if (!urb) {
+   ret = 0;
+   goto out;
+   }
cmd = urb->transfer_buffer;
 
for (i = y; i < y + height ; i++) {
@@ -151,7 +159,9 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, 
int y,
>> 10)), /* Kcycles */
   >cpu_kcycles_used);
 
-   return 0;
+out:
+   mutex_unlock(>transfer_lock);
+   return ret;
 }
 
 static int udl_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
index a9d93b8..d376233 100644
--- a/drivers/gpu/drm/udl/udl_main.c
+++ b/drivers/gpu/drm/udl/udl_main.c
@@ -319,6 +319,8 @@ int udl_driver_load(struct drm_device *dev, unsigned long 
flags)
if (!udl)
r

[PATCH v3] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
Smaller scope reduces visibility of variable and makes usage of
uninitialized variable less possible.

Changes in v2:
- separate declaration and initialization
Changes in v3:
- add missing signed-off-by tag

Signed-off-by: Dawid Kurek <dawi...@gmail.com>
---
 drivers/gpu/drm/drm_atomic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index f32506a..5e0d1e1 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -108,9 +108,10 @@ struct drm_atomic_state *
 drm_atomic_state_alloc(struct drm_device *dev)
 {
struct drm_mode_config *config = >mode_config;
-   struct drm_atomic_state *state;
 
if (!config->funcs->atomic_state_alloc) {
+   struct drm_atomic_state *state;
+
state = kzalloc(sizeof(*state), GFP_KERNEL);
if (!state)
return NULL;
-- 
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH v3] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
Smaller scope reduces visibility of variable and makes usage of
uninitialized variable less possible.

Changes in v2:
- separate declaration and initialization
Changes in v3:
- add missing signed-off-by tag

Signed-off-by: Dawid Kurek 
---
 drivers/gpu/drm/drm_atomic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index f32506a..5e0d1e1 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -108,9 +108,10 @@ struct drm_atomic_state *
 drm_atomic_state_alloc(struct drm_device *dev)
 {
struct drm_mode_config *config = >mode_config;
-   struct drm_atomic_state *state;
 
if (!config->funcs->atomic_state_alloc) {
+   struct drm_atomic_state *state;
+
state = kzalloc(sizeof(*state), GFP_KERNEL);
if (!state)
return NULL;
-- 
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [PATCH v2] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
On 15/06/17, Sean Paul wrote:
> On Thu, Jun 15, 2017 at 04:04:36PM +0200, Dawid Kurek wrote:
> > Smaller scope reduces visibility of variable and makes usage of
> > uninitialized variable less possible.
> > 
> > Changes in v2:
> > - separate declaration and initialization
> 
> Your patch is missing Signed-off-by tag
> 
Right... Missed it. v3 on the way.

Dawid

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [PATCH v2] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
On 15/06/17, Sean Paul wrote:
> On Thu, Jun 15, 2017 at 04:04:36PM +0200, Dawid Kurek wrote:
> > Smaller scope reduces visibility of variable and makes usage of
> > uninitialized variable less possible.
> > 
> > Changes in v2:
> > - separate declaration and initialization
> 
> Your patch is missing Signed-off-by tag
> 
Right... Missed it. v3 on the way.

Dawid

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [PATCH] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
On 15/06/17, Jani Nikula wrote:
> On Thu, 15 Jun 2017, Dawid Kurek <dawi...@gmail.com> wrote:
> > On 15/06/17, Jani Nikula wrote:
> >> Separate declaration and initialization would lead to a cleaner patch
> >> and result.
> >
> > I saw combining declaration and initialization is quite common, i.e. in
> > drm_atomic file. Personally, I also prefer those in one statement. But yes, 
> > it
> > looks cleaner here, in two lines.
> 
> I'd say the rule of thumb is that combined declaration and
> initialization is fine if the initialization is trivial, in particular
> can never fail. If you need to check the return value, like in this
> case, I'd prefer separate initialization.
> 
Yeah, makes sense. If you need to check then it exceeds simple initialization,
and then it is not declare Yes, now I see it.

Thanks a lot,
Dawid

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [PATCH] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
On 15/06/17, Jani Nikula wrote:
> On Thu, 15 Jun 2017, Dawid Kurek  wrote:
> > On 15/06/17, Jani Nikula wrote:
> >> Separate declaration and initialization would lead to a cleaner patch
> >> and result.
> >
> > I saw combining declaration and initialization is quite common, i.e. in
> > drm_atomic file. Personally, I also prefer those in one statement. But yes, 
> > it
> > looks cleaner here, in two lines.
> 
> I'd say the rule of thumb is that combined declaration and
> initialization is fine if the initialization is trivial, in particular
> can never fail. If you need to check the return value, like in this
> case, I'd prefer separate initialization.
> 
Yeah, makes sense. If you need to check then it exceeds simple initialization,
and then it is not declare Yes, now I see it.

Thanks a lot,
Dawid

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [PATCH] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
On 15/06/17, Jani Nikula wrote:
> On Thu, 15 Jun 2017, Dawid Kurek <dawi...@gmail.com> wrote:
> > Smaller scope reduces visibility of variable and makes usage of
> > uninitialized variable less possible.
> > ---
> >  drivers/gpu/drm/drm_atomic.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> > index f32506a..ea5a9a7 100644
> > --- a/drivers/gpu/drm/drm_atomic.c
> > +++ b/drivers/gpu/drm/drm_atomic.c
> > @@ -108,10 +108,11 @@ struct drm_atomic_state *
> >  drm_atomic_state_alloc(struct drm_device *dev)
> >  {
> > struct drm_mode_config *config = >mode_config;
> > -   struct drm_atomic_state *state;
> >  
> > if (!config->funcs->atomic_state_alloc) {
> > -   state = kzalloc(sizeof(*state), GFP_KERNEL);
> > +   struct drm_atomic_state *state
> > +   = kzalloc(sizeof(*state), GFP_KERNEL);
> 
> Separate declaration and initialization would lead to a cleaner patch
> and result.

I saw combining declaration and initialization is quite common, i.e. in
drm_atomic file. Personally, I also prefer those in one statement. But yes, it
looks cleaner here, in two lines.

v2 sent :)

Thanks,
Dawid

> 
> BR,
> Jani.
> 
> > +
> > if (!state)
> > return NULL;
> > if (drm_atomic_state_init(dev, state) < 0) {
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [PATCH] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
On 15/06/17, Jani Nikula wrote:
> On Thu, 15 Jun 2017, Dawid Kurek  wrote:
> > Smaller scope reduces visibility of variable and makes usage of
> > uninitialized variable less possible.
> > ---
> >  drivers/gpu/drm/drm_atomic.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> > index f32506a..ea5a9a7 100644
> > --- a/drivers/gpu/drm/drm_atomic.c
> > +++ b/drivers/gpu/drm/drm_atomic.c
> > @@ -108,10 +108,11 @@ struct drm_atomic_state *
> >  drm_atomic_state_alloc(struct drm_device *dev)
> >  {
> > struct drm_mode_config *config = >mode_config;
> > -   struct drm_atomic_state *state;
> >  
> > if (!config->funcs->atomic_state_alloc) {
> > -   state = kzalloc(sizeof(*state), GFP_KERNEL);
> > +   struct drm_atomic_state *state
> > +   = kzalloc(sizeof(*state), GFP_KERNEL);
> 
> Separate declaration and initialization would lead to a cleaner patch
> and result.

I saw combining declaration and initialization is quite common, i.e. in
drm_atomic file. Personally, I also prefer those in one statement. But yes, it
looks cleaner here, in two lines.

v2 sent :)

Thanks,
Dawid

> 
> BR,
> Jani.
> 
> > +
> > if (!state)
> > return NULL;
> > if (drm_atomic_state_init(dev, state) < 0) {
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH v2] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
Smaller scope reduces visibility of variable and makes usage of
uninitialized variable less possible.

Changes in v2:
- separate declaration and initialization
---
 drivers/gpu/drm/drm_atomic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index f32506a..5e0d1e1 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -108,9 +108,10 @@ struct drm_atomic_state *
 drm_atomic_state_alloc(struct drm_device *dev)
 {
struct drm_mode_config *config = >mode_config;
-   struct drm_atomic_state *state;
 
if (!config->funcs->atomic_state_alloc) {
+   struct drm_atomic_state *state;
+
state = kzalloc(sizeof(*state), GFP_KERNEL);
if (!state)
return NULL;
-- 
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH v2] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
Smaller scope reduces visibility of variable and makes usage of
uninitialized variable less possible.

Changes in v2:
- separate declaration and initialization
---
 drivers/gpu/drm/drm_atomic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index f32506a..5e0d1e1 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -108,9 +108,10 @@ struct drm_atomic_state *
 drm_atomic_state_alloc(struct drm_device *dev)
 {
struct drm_mode_config *config = >mode_config;
-   struct drm_atomic_state *state;
 
if (!config->funcs->atomic_state_alloc) {
+   struct drm_atomic_state *state;
+
state = kzalloc(sizeof(*state), GFP_KERNEL);
if (!state)
return NULL;
-- 
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
Smaller scope reduces visibility of variable and makes usage of
uninitialized variable less possible.
---
 drivers/gpu/drm/drm_atomic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index f32506a..ea5a9a7 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -108,10 +108,11 @@ struct drm_atomic_state *
 drm_atomic_state_alloc(struct drm_device *dev)
 {
struct drm_mode_config *config = >mode_config;
-   struct drm_atomic_state *state;
 
if (!config->funcs->atomic_state_alloc) {
-   state = kzalloc(sizeof(*state), GFP_KERNEL);
+   struct drm_atomic_state *state
+   = kzalloc(sizeof(*state), GFP_KERNEL);
+
if (!state)
return NULL;
if (drm_atomic_state_init(dev, state) < 0) {
-- 
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] drm: Reduce scope of 'state' variable

2017-06-15 Thread Dawid Kurek
Smaller scope reduces visibility of variable and makes usage of
uninitialized variable less possible.
---
 drivers/gpu/drm/drm_atomic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index f32506a..ea5a9a7 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -108,10 +108,11 @@ struct drm_atomic_state *
 drm_atomic_state_alloc(struct drm_device *dev)
 {
struct drm_mode_config *config = >mode_config;
-   struct drm_atomic_state *state;
 
if (!config->funcs->atomic_state_alloc) {
-   state = kzalloc(sizeof(*state), GFP_KERNEL);
+   struct drm_atomic_state *state
+   = kzalloc(sizeof(*state), GFP_KERNEL);
+
if (!state)
return NULL;
if (drm_atomic_state_init(dev, state) < 0) {
-- 
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] drm: Remove duplicate forward declaration

2017-06-14 Thread Dawid Kurek
Forward declarations in C are great but I'm pretty sure one is enough.

Signed-off-by: Dawid Kurek <dawi...@gmail.com>
---
 include/drm/drm_connector.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 4eeda12..930222c 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -29,8 +29,6 @@
 
 #include 
 
-struct drm_device;
-
 struct drm_connector_helper_funcs;
 struct drm_modeset_acquire_ctx;
 struct drm_device;
-- 
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] drm: Remove duplicate forward declaration

2017-06-14 Thread Dawid Kurek
Forward declarations in C are great but I'm pretty sure one is enough.

Signed-off-by: Dawid Kurek 
---
 include/drm/drm_connector.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 4eeda12..930222c 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -29,8 +29,6 @@
 
 #include 
 
-struct drm_device;
-
 struct drm_connector_helper_funcs;
 struct drm_modeset_acquire_ctx;
 struct drm_device;
-- 
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] staging: gdm724x: Remove one blank line in sequence

2016-11-26 Thread Dawid Kurek
Remove one blank line in sequence of two empty lines.

Signed-off-by: Dawid Kurek <dawi...@gmail.com>
---
 drivers/staging/gdm724x/gdm_tty.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/gdm724x/gdm_tty.h 
b/drivers/staging/gdm724x/gdm_tty.h
index 297438b..195c590 100644
--- a/drivers/staging/gdm724x/gdm_tty.h
+++ b/drivers/staging/gdm724x/gdm_tty.h
@@ -17,7 +17,6 @@
 #include 
 #include 

-
 #define TTY_MAX_COUNT  2

 #define MAX_ISSUE_NUM 3
--
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] staging: gdm724x: Remove one blank line in sequence

2016-11-26 Thread Dawid Kurek
Remove one blank line in sequence of two empty lines.

Signed-off-by: Dawid Kurek 
---
 drivers/staging/gdm724x/gdm_tty.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/gdm724x/gdm_tty.h 
b/drivers/staging/gdm724x/gdm_tty.h
index 297438b..195c590 100644
--- a/drivers/staging/gdm724x/gdm_tty.h
+++ b/drivers/staging/gdm724x/gdm_tty.h
@@ -17,7 +17,6 @@
 #include 
 #include 

-
 #define TTY_MAX_COUNT  2

 #define MAX_ISSUE_NUM 3
--
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] staging: gdm724x: Align parameters to parenthesis

2016-11-26 Thread Dawid Kurek
Align parameters to open parenthesis.

Signed-off-by: Dawid Kurek <dawi...@gmail.com>
---
 drivers/staging/gdm724x/gdm_lte.h   | 14 +++---
 drivers/staging/gdm724x/netlink_k.h |  3 ++-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_lte.h 
b/drivers/staging/gdm724x/gdm_lte.h
index 88414e5..7ddeabc 100644
--- a/drivers/staging/gdm724x/gdm_lte.h
+++ b/drivers/staging/gdm724x/gdm_lte.h
@@ -47,15 +47,15 @@ struct phy_dev {
void*priv_dev;
struct net_device *dev[MAX_NIC_TYPE];
int (*send_hci_func)(void *priv_dev, void *data, int len,
-   void (*cb)(void *cb_data), void *cb_data);
+void (*cb)(void *cb_data), void *cb_data);
int (*send_sdu_func)(void *priv_dev, void *data, int len,
-   unsigned int dftEpsId, unsigned int epsId,
-   void (*cb)(void *cb_data), void *cb_data,
-   int dev_idx, int nic_type);
+unsigned int dftEpsId, unsigned int epsId,
+void (*cb)(void *cb_data), void *cb_data,
+int dev_idx, int nic_type);
int (*rcv_func)(void *priv_dev,
-   int (*cb)(void *cb_data, void *data, int len,
- int context),
-   void *cb_data, int context);
+   int (*cb)(void *cb_data, void *data, int len,
+ int context),
+   void *cb_data, int context);
struct gdm_endian * (*get_endian)(void *priv_dev);
 };

diff --git a/drivers/staging/gdm724x/netlink_k.h 
b/drivers/staging/gdm724x/netlink_k.h
index 7cf979b..5ebd731 100644
--- a/drivers/staging/gdm724x/netlink_k.h
+++ b/drivers/staging/gdm724x/netlink_k.h
@@ -18,7 +18,8 @@
 #include 

 struct sock *netlink_init(int unit,
-   void (*cb)(struct net_device *dev, u16 type, void *msg, int len));
+ void (*cb)(struct net_device *dev,
+u16 type, void *msg, int len));
 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);

 #endif /* _NETLINK_K_H_ */
--
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] staging: gdm724x: Align parameters to parenthesis

2016-11-26 Thread Dawid Kurek
Align parameters to open parenthesis.

Signed-off-by: Dawid Kurek 
---
 drivers/staging/gdm724x/gdm_lte.h   | 14 +++---
 drivers/staging/gdm724x/netlink_k.h |  3 ++-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_lte.h 
b/drivers/staging/gdm724x/gdm_lte.h
index 88414e5..7ddeabc 100644
--- a/drivers/staging/gdm724x/gdm_lte.h
+++ b/drivers/staging/gdm724x/gdm_lte.h
@@ -47,15 +47,15 @@ struct phy_dev {
void*priv_dev;
struct net_device *dev[MAX_NIC_TYPE];
int (*send_hci_func)(void *priv_dev, void *data, int len,
-   void (*cb)(void *cb_data), void *cb_data);
+void (*cb)(void *cb_data), void *cb_data);
int (*send_sdu_func)(void *priv_dev, void *data, int len,
-   unsigned int dftEpsId, unsigned int epsId,
-   void (*cb)(void *cb_data), void *cb_data,
-   int dev_idx, int nic_type);
+unsigned int dftEpsId, unsigned int epsId,
+void (*cb)(void *cb_data), void *cb_data,
+int dev_idx, int nic_type);
int (*rcv_func)(void *priv_dev,
-   int (*cb)(void *cb_data, void *data, int len,
- int context),
-   void *cb_data, int context);
+   int (*cb)(void *cb_data, void *data, int len,
+ int context),
+   void *cb_data, int context);
struct gdm_endian * (*get_endian)(void *priv_dev);
 };

diff --git a/drivers/staging/gdm724x/netlink_k.h 
b/drivers/staging/gdm724x/netlink_k.h
index 7cf979b..5ebd731 100644
--- a/drivers/staging/gdm724x/netlink_k.h
+++ b/drivers/staging/gdm724x/netlink_k.h
@@ -18,7 +18,8 @@
 #include 

 struct sock *netlink_init(int unit,
-   void (*cb)(struct net_device *dev, u16 type, void *msg, int len));
+ void (*cb)(struct net_device *dev,
+u16 type, void *msg, int len));
 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);

 #endif /* _NETLINK_K_H_ */
--
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] staging: gdm724x: Align parameters to parenthesis

2016-11-25 Thread Dawid Kurek
Align parameters to open parenthesis. Also remove one blank line in
sequence of two.

Signed-off-by: Dawid Kurek <dawi...@gmail.com>
---
 drivers/staging/gdm724x/gdm_lte.h   | 14 +++---
 drivers/staging/gdm724x/gdm_tty.h   |  1 -
 drivers/staging/gdm724x/netlink_k.h |  3 ++-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_lte.h 
b/drivers/staging/gdm724x/gdm_lte.h
index 88414e5..7ddeabc 100644
--- a/drivers/staging/gdm724x/gdm_lte.h
+++ b/drivers/staging/gdm724x/gdm_lte.h
@@ -47,15 +47,15 @@ struct phy_dev {
void*priv_dev;
struct net_device *dev[MAX_NIC_TYPE];
int (*send_hci_func)(void *priv_dev, void *data, int len,
-   void (*cb)(void *cb_data), void *cb_data);
+void (*cb)(void *cb_data), void *cb_data);
int (*send_sdu_func)(void *priv_dev, void *data, int len,
-   unsigned int dftEpsId, unsigned int epsId,
-   void (*cb)(void *cb_data), void *cb_data,
-   int dev_idx, int nic_type);
+unsigned int dftEpsId, unsigned int epsId,
+void (*cb)(void *cb_data), void *cb_data,
+int dev_idx, int nic_type);
int (*rcv_func)(void *priv_dev,
-   int (*cb)(void *cb_data, void *data, int len,
- int context),
-   void *cb_data, int context);
+   int (*cb)(void *cb_data, void *data, int len,
+ int context),
+   void *cb_data, int context);
struct gdm_endian * (*get_endian)(void *priv_dev);
 };

diff --git a/drivers/staging/gdm724x/gdm_tty.h 
b/drivers/staging/gdm724x/gdm_tty.h
index 297438b..195c590 100644
--- a/drivers/staging/gdm724x/gdm_tty.h
+++ b/drivers/staging/gdm724x/gdm_tty.h
@@ -17,7 +17,6 @@
 #include 
 #include 

-
 #define TTY_MAX_COUNT  2

 #define MAX_ISSUE_NUM 3
diff --git a/drivers/staging/gdm724x/netlink_k.h 
b/drivers/staging/gdm724x/netlink_k.h
index 7cf979b..5ebd731 100644
--- a/drivers/staging/gdm724x/netlink_k.h
+++ b/drivers/staging/gdm724x/netlink_k.h
@@ -18,7 +18,8 @@
 #include 

 struct sock *netlink_init(int unit,
-   void (*cb)(struct net_device *dev, u16 type, void *msg, int len));
+ void (*cb)(struct net_device *dev,
+u16 type, void *msg, int len));
 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);

 #endif /* _NETLINK_K_H_ */
--
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[PATCH] staging: gdm724x: Align parameters to parenthesis

2016-11-25 Thread Dawid Kurek
Align parameters to open parenthesis. Also remove one blank line in
sequence of two.

Signed-off-by: Dawid Kurek 
---
 drivers/staging/gdm724x/gdm_lte.h   | 14 +++---
 drivers/staging/gdm724x/gdm_tty.h   |  1 -
 drivers/staging/gdm724x/netlink_k.h |  3 ++-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_lte.h 
b/drivers/staging/gdm724x/gdm_lte.h
index 88414e5..7ddeabc 100644
--- a/drivers/staging/gdm724x/gdm_lte.h
+++ b/drivers/staging/gdm724x/gdm_lte.h
@@ -47,15 +47,15 @@ struct phy_dev {
void*priv_dev;
struct net_device *dev[MAX_NIC_TYPE];
int (*send_hci_func)(void *priv_dev, void *data, int len,
-   void (*cb)(void *cb_data), void *cb_data);
+void (*cb)(void *cb_data), void *cb_data);
int (*send_sdu_func)(void *priv_dev, void *data, int len,
-   unsigned int dftEpsId, unsigned int epsId,
-   void (*cb)(void *cb_data), void *cb_data,
-   int dev_idx, int nic_type);
+unsigned int dftEpsId, unsigned int epsId,
+void (*cb)(void *cb_data), void *cb_data,
+int dev_idx, int nic_type);
int (*rcv_func)(void *priv_dev,
-   int (*cb)(void *cb_data, void *data, int len,
- int context),
-   void *cb_data, int context);
+   int (*cb)(void *cb_data, void *data, int len,
+ int context),
+   void *cb_data, int context);
struct gdm_endian * (*get_endian)(void *priv_dev);
 };

diff --git a/drivers/staging/gdm724x/gdm_tty.h 
b/drivers/staging/gdm724x/gdm_tty.h
index 297438b..195c590 100644
--- a/drivers/staging/gdm724x/gdm_tty.h
+++ b/drivers/staging/gdm724x/gdm_tty.h
@@ -17,7 +17,6 @@
 #include 
 #include 

-
 #define TTY_MAX_COUNT  2

 #define MAX_ISSUE_NUM 3
diff --git a/drivers/staging/gdm724x/netlink_k.h 
b/drivers/staging/gdm724x/netlink_k.h
index 7cf979b..5ebd731 100644
--- a/drivers/staging/gdm724x/netlink_k.h
+++ b/drivers/staging/gdm724x/netlink_k.h
@@ -18,7 +18,8 @@
 #include 

 struct sock *netlink_init(int unit,
-   void (*cb)(struct net_device *dev, u16 type, void *msg, int len));
+ void (*cb)(struct net_device *dev,
+u16 type, void *msg, int len));
 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);

 #endif /* _NETLINK_K_H_ */
--
2.10.0


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus