The following warnings fixed.
- WARNING: braces {} are not necessary for any arm of this statement
- WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_connector.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_connector.c b/drivers/staging/omapdrm/omap_connector.c
index 38be186..91edb3f 100644
--- a/drivers/staging/omapdrm/omap_connector.c
+++ b/drivers/staging/omapdrm/omap_connector.c
@@ -146,11 +146,10 @@ enum drm_connector_status omap_connector_detect(
enum drm_connector_status ret;
if (dssdrv->detect) {
- if (dssdrv->detect(dssdev)) {
+ if (dssdrv->detect(dssdev))
ret = connector_status_connected;
- } else {
+ else
ret = connector_status_disconnected;
- }
} else {
ret = connector_status_unknown;
}
@@ -383,9 +382,8 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
return connector;
fail:
- if (connector) {
+ if (connector)
omap_connector_destroy(connector);
- }
return NULL;
}
--
1.7.9.5
The following error fixed.
- ERROR: do not initialise statics to 0 or NULL
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_crtc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/omapdrm/omap_crtc.c b/drivers/staging/omapdrm/omap_crtc.c
index 5249223..cbda7e0 100644
--- a/drivers/staging/omapdrm/omap_crtc.c
+++ b/drivers/staging/omapdrm/omap_crtc.c
@@ -114,7 +114,7 @@ static void omap_crtc_load_lut(struct drm_crtc *crtc)
static void vblank_cb(void *arg)
{
- static uint32_t sequence = 0;
+ static uint32_t sequence;
struct drm_crtc *crtc = arg;
struct drm_device *dev = crtc->dev;
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
--
1.7.9.5
The following warning fixed.
- WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_crtc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_crtc.c b/drivers/staging/omapdrm/omap_crtc.c
index cbda7e0..d87bd84 100644
--- a/drivers/staging/omapdrm/omap_crtc.c
+++ b/drivers/staging/omapdrm/omap_crtc.c
@@ -263,8 +263,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
return crtc;
fail:
- if (crtc) {
+ if (crtc)
omap_crtc_destroy(crtc);
- }
+
return NULL;
}
--
1.7.9.5
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_drv.c | 36 ++++++++++++++----------------------
1 file changed, 14 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_drv.c b/drivers/staging/omapdrm/omap_drv.c
index 6ae2f76..d4823fd 100644
--- a/drivers/staging/omapdrm/omap_drv.c
+++ b/drivers/staging/omapdrm/omap_drv.c
@@ -51,9 +51,8 @@ static void omap_fb_output_poll_changed(struct drm_device *dev)
{
struct omap_drm_private *priv = dev->dev_private;
DBG("dev=%p", dev);
- if (priv->fbdev) {
+ if (priv->fbdev)
drm_fb_helper_hotplug_event(priv->fbdev);
- }
}
static const struct drm_mode_config_funcs omap_mode_config_funcs = {
@@ -85,9 +84,9 @@ static int omap_drm_notifier(struct notifier_block *nb,
case OMAP_DSS_HOTPLUG_DISCONNECT: {
struct drm_device *dev = drm_device;
DBG("hotplug event: evt=%d, dev=%p", evt, dev);
- if (dev) {
+ if (dev)
drm_sysfs_hotplug_event(dev);
- }
+
return NOTIFY_OK;
}
default: /* don't care about other events for now */
@@ -211,9 +210,9 @@ static int create_crtc(struct drm_device *dev, struct omap_overlay *ovl,
struct drm_encoder *encoder =
omap_connector_attached_encoder(
priv->connectors[*j]);
- if (encoder) {
+ if (encoder)
mgr = omap_encoder_get_manager(encoder);
- }
+
}
(*j)++;
}
@@ -232,9 +231,9 @@ static int create_crtc(struct drm_device *dev, struct omap_overlay *ovl,
struct drm_encoder *encoder =
omap_connector_attached_encoder(
priv->connectors[idx]);
- if (encoder) {
+ if (encoder)
mgr = omap_encoder_get_manager(encoder);
- }
+
}
(*j)++;
}
@@ -353,9 +352,8 @@ static int omap_modeset_init(struct drm_device *dev)
*/
int max_overlays = min(omap_dss_get_num_overlays(), num_crtc);
- for (i = 0; i < omap_dss_get_num_overlay_managers(); i++) {
+ for (i = 0; i < omap_dss_get_num_overlay_managers(); i++)
create_encoder(dev, omap_dss_get_overlay_manager(i));
- }
for_each_dss_dev(dssdev) {
create_connector(dev, dssdev);
@@ -468,15 +466,13 @@ static int ioctl_gem_cpu_prep(struct drm_device *dev, void *data,
VERB("%p:%p: handle=%d, op=%x", dev, file_priv, args->handle, args->op);
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
- if (!obj) {
+ if (!obj)
return -ENOENT;
- }
ret = omap_gem_op_sync(obj, args->op);
- if (!ret) {
+ if (!ret)
ret = omap_gem_op_start(obj, args->op);
- }
drm_gem_object_unreference_unlocked(obj);
@@ -493,16 +489,14 @@ static int ioctl_gem_cpu_fini(struct drm_device *dev, void *data,
VERB("%p:%p: handle=%d", dev, file_priv, args->handle);
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
- if (!obj) {
+ if (!obj)
return -ENOENT;
- }
/* XXX flushy, flushy */
ret = 0;
- if (!ret) {
+ if (!ret)
ret = omap_gem_op_finish(obj, args->op);
- }
drm_gem_object_unreference_unlocked(obj);
@@ -519,9 +513,8 @@ static int ioctl_gem_info(struct drm_device *dev, void *data,
DBG("%p:%p: handle=%d", dev, file_priv, args->handle);
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
- if (!obj) {
+ if (!obj)
return -ENOENT;
- }
args->size = omap_gem_mmap_size(obj);
args->offset = omap_gem_mmap_offset(obj);
@@ -595,9 +588,8 @@ static int dev_load(struct drm_device *dev, unsigned long flags)
drm_kms_helper_poll_init(dev);
ret = drm_vblank_init(dev, priv->num_crtcs);
- if (ret) {
+ if (ret)
dev_warn(dev->dev, "could not init vblank\n");
- }
return 0;
}
--
1.7.9.5
The following errors fixed.
- ERROR: "foo * bar" should be "foo *bar"
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_drv.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h
index 8f7c447..8f41098 100644
--- a/drivers/staging/omapdrm/omap_drv.h
+++ b/drivers/staging/omapdrm/omap_drv.h
@@ -191,9 +191,9 @@ size_t omap_gem_mmap_size(struct drm_gem_object *obj);
int omap_gem_tiled_size(struct drm_gem_object *obj, uint16_t *w, uint16_t *h);
int omap_gem_tiled_stride(struct drm_gem_object *obj, uint32_t orient);
-struct dma_buf * omap_gem_prime_export(struct drm_device *dev,
+struct dma_buf *omap_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *obj, int flags);
-struct drm_gem_object * omap_gem_prime_import(struct drm_device *dev,
+struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
struct dma_buf *buffer);
static inline int align_pitch(int pitch, int width, int bpp)
--
1.7.9.5
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_drv.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h
index 8f41098..1d4aea5 100644
--- a/drivers/staging/omapdrm/omap_drv.h
+++ b/drivers/staging/omapdrm/omap_drv.h
@@ -218,17 +218,17 @@ static inline int objects_lookup(struct drm_device *dev,
for (i = 0; i < n; i++) {
bos[i] = drm_gem_object_lookup(dev, filp, handles[i]);
- if (!bos[i]) {
+ if (!bos[i])
goto fail;
- }
+
}
return 0;
fail:
- while (--i > 0) {
+ while (--i > 0)
drm_gem_object_unreference_unlocked(bos[i]);
- }
+
return -ENOENT;
}
--
1.7.9.5
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_encoder.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_encoder.c b/drivers/staging/omapdrm/omap_encoder.c
index 31c735d..5341d5e 100644
--- a/drivers/staging/omapdrm/omap_encoder.c
+++ b/drivers/staging/omapdrm/omap_encoder.c
@@ -72,9 +72,9 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
for (i = 0; i < priv->num_connectors; i++) {
struct drm_connector *connector = priv->connectors[i];
- if (connector->encoder == encoder) {
+ if (connector->encoder == encoder)
omap_connector_mode_set(connector, mode);
- }
+
}
}
@@ -163,9 +163,8 @@ struct drm_encoder *omap_encoder_init(struct drm_device *dev,
return encoder;
fail:
- if (encoder) {
+ if (encoder)
omap_encoder_destroy(encoder);
- }
return NULL;
}
--
1.7.9.5
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_fb.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_fb.c b/drivers/staging/omapdrm/omap_fb.c
index 75d2ff1..09028e9 100644
--- a/drivers/staging/omapdrm/omap_fb.c
+++ b/drivers/staging/omapdrm/omap_fb.c
@@ -307,17 +307,16 @@ struct drm_connector *omap_framebuffer_get_next_connector(
struct list_head *connector_list = &dev->mode_config.connector_list;
struct drm_connector *connector = from;
- if (!from) {
+ if (!from)
return list_first_entry(connector_list, typeof(*from), head);
- }
list_for_each_entry_from(connector, connector_list, head) {
if (connector != from) {
struct drm_encoder *encoder = connector->encoder;
struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
- if (crtc && crtc->fb == fb) {
+ if (crtc && crtc->fb == fb)
return connector;
- }
+
}
}
@@ -466,8 +465,8 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
return fb;
fail:
- if (fb) {
+ if (fb)
omap_framebuffer_destroy(fb);
- }
+
return ERR_PTR(ret);
}
--
1.7.9.5
The following error fixed.
- ERROR: "foo ** bar" should be "foo **bar"
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c
index 8a9b1ce..94c04a5 100644
--- a/drivers/staging/omapdrm/omap_gem.c
+++ b/drivers/staging/omapdrm/omap_gem.c
@@ -25,7 +25,7 @@
#include "omap_dmm_tiler.h"
/* remove these once drm core helpers are merged */
-struct page ** _drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
+struct page **_drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
void _drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
bool dirty, bool accessed);
int _drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
--
1.7.9.5
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_gem.c | 38 ++++++++++++++----------------------
1 file changed, 15 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c
index 94c04a5..e615871 100644
--- a/drivers/staging/omapdrm/omap_gem.c
+++ b/drivers/staging/omapdrm/omap_gem.c
@@ -521,9 +521,8 @@ int omap_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
/* if a shmem backed object, make sure we have pages attached now */
ret = get_pages(obj, &pages);
- if (ret) {
+ if (ret)
goto fail;
- }
/* where should we do corresponding put_pages().. we are mapping
* the original page, rather than thru a GART, so we can't rely
@@ -1146,9 +1145,8 @@ int omap_gem_op_sync(struct drm_gem_object *obj, enum omap_gem_op op)
struct omap_gem_sync_waiter *waiter =
kzalloc(sizeof(*waiter), GFP_KERNEL);
- if (!waiter) {
+ if (!waiter)
return -ENOMEM;
- }
waiter->omap_obj = omap_obj;
waiter->op = op;
@@ -1177,9 +1175,8 @@ int omap_gem_op_sync(struct drm_gem_object *obj, enum omap_gem_op op)
}
spin_unlock(&sync_lock);
- if (waiter) {
+ if (waiter)
kfree(waiter);
- }
}
return ret;
}
@@ -1201,9 +1198,8 @@ int omap_gem_op_async(struct drm_gem_object *obj, enum omap_gem_op op,
struct omap_gem_sync_waiter *waiter =
kzalloc(sizeof(*waiter), GFP_ATOMIC);
- if (!waiter) {
+ if (!waiter)
return -ENOMEM;
- }
waiter->omap_obj = omap_obj;
waiter->op = op;
@@ -1285,9 +1281,8 @@ void omap_gem_free_object(struct drm_gem_object *obj)
list_del(&omap_obj->mm_list);
- if (obj->map_list.map) {
+ if (obj->map_list.map)
drm_gem_free_mmap_offset(obj);
- }
/* this means the object is still pinned.. which really should
* not happen. I think..
@@ -1296,9 +1291,9 @@ void omap_gem_free_object(struct drm_gem_object *obj)
/* don't free externally allocated backing memory */
if (!(omap_obj->flags & OMAP_BO_EXT_MEM)) {
- if (omap_obj->pages) {
+ if (omap_obj->pages)
omap_gem_detach_pages(obj);
- }
+
if (!is_shmem(obj)) {
dma_free_writecombine(dev->dev, obj->size,
omap_obj->vaddr, omap_obj->paddr);
@@ -1308,9 +1303,8 @@ void omap_gem_free_object(struct drm_gem_object *obj)
}
/* don't free externally allocated syncobj */
- if (!(omap_obj->flags & OMAP_BO_EXT_SYNC)) {
+ if (!(omap_obj->flags & OMAP_BO_EXT_SYNC))
kfree(omap_obj->sync);
- }
drm_gem_object_release(obj);
@@ -1395,9 +1389,9 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
*/
omap_obj->vaddr = dma_alloc_writecombine(dev->dev, size,
&omap_obj->paddr, GFP_KERNEL);
- if (omap_obj->vaddr) {
+ if (omap_obj->vaddr)
flags |= OMAP_BO_DMA;
- }
+
}
omap_obj->flags = flags;
@@ -1407,22 +1401,20 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
omap_obj->height = gsize.tiled.height;
}
- if (flags & (OMAP_BO_DMA|OMAP_BO_EXT_MEM)) {
+ if (flags & (OMAP_BO_DMA|OMAP_BO_EXT_MEM))
ret = drm_gem_private_object_init(dev, obj, size);
- } else {
+ else
ret = drm_gem_object_init(dev, obj, size);
- }
- if (ret) {
+ if (ret)
goto fail;
- }
return obj;
fail:
- if (obj) {
+ if (obj)
omap_gem_free_object(obj);
- }
+
return NULL;
}
--
1.7.9.5
The following errors fixed.
- ERROR: space prohibited after that '!' (ctx:BxW)
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_gem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c
index e615871..c38992b 100644
--- a/drivers/staging/omapdrm/omap_gem.c
+++ b/drivers/staging/omapdrm/omap_gem.c
@@ -952,7 +952,7 @@ int omap_gem_put_pages(struct drm_gem_object *obj)
void *omap_gem_vaddr(struct drm_gem_object *obj)
{
struct omap_gem_object *omap_obj = to_omap_bo(obj);
- WARN_ON(! mutex_is_locked(&obj->dev->struct_mutex));
+ WARN_ON(!mutex_is_locked(&obj->dev->struct_mutex));
if (!omap_obj->vaddr) {
struct page **pages;
int ret = get_pages(obj, &pages);
@@ -971,7 +971,7 @@ void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m)
struct omap_gem_object *omap_obj = to_omap_bo(obj);
uint64_t off = 0;
- WARN_ON(! mutex_is_locked(&dev->struct_mutex));
+ WARN_ON(!mutex_is_locked(&dev->struct_mutex));
if (obj->map_list.map)
off = (uint64_t)obj->map_list.hash.key;
--
1.7.9.5
The following errors fixed.
- ERROR: "foo * bar" should be "foo *bar"
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_gem_dmabuf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_gem_dmabuf.c b/drivers/staging/omapdrm/omap_gem_dmabuf.c
index c6f3ef6..9a30206 100644
--- a/drivers/staging/omapdrm/omap_gem_dmabuf.c
+++ b/drivers/staging/omapdrm/omap_gem_dmabuf.c
@@ -191,13 +191,13 @@ struct dma_buf_ops omap_dmabuf_ops = {
.mmap = omap_gem_dmabuf_mmap,
};
-struct dma_buf * omap_gem_prime_export(struct drm_device *dev,
+struct dma_buf *omap_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *obj, int flags)
{
return dma_buf_export(obj, &omap_dmabuf_ops, obj->size, 0600);
}
-struct drm_gem_object * omap_gem_prime_import(struct drm_device *dev,
+struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
struct dma_buf *buffer)
{
struct drm_gem_object *obj;
--
1.7.9.5
The following error fixed.
- ERROR: "foo ** bar" should be "foo **bar"
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_gem_helpers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/omapdrm/omap_gem_helpers.c b/drivers/staging/omapdrm/omap_gem_helpers.c
index f895363..1b54110 100644
--- a/drivers/staging/omapdrm/omap_gem_helpers.c
+++ b/drivers/staging/omapdrm/omap_gem_helpers.c
@@ -32,7 +32,7 @@
* @obj: obj in question
* @gfpmask: gfp mask of requested pages
*/
-struct page ** _drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask)
+struct page **_drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask)
{
struct inode *inode;
struct address_space *mapping;
--
1.7.9.5
The following warning fixed.
- WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_gem_helpers.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_gem_helpers.c b/drivers/staging/omapdrm/omap_gem_helpers.c
index 1b54110..ffb8cce 100644
--- a/drivers/staging/omapdrm/omap_gem_helpers.c
+++ b/drivers/staging/omapdrm/omap_gem_helpers.c
@@ -80,9 +80,9 @@ struct page **_drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask)
return pages;
fail:
- while (i--) {
+ while (i--)
page_cache_release(pages[i]);
- }
+
drm_free_large(pages);
return ERR_CAST(p);
}
--
1.7.9.5
The following warning fixed.
- WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_plane.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_plane.c b/drivers/staging/omapdrm/omap_plane.c
index 1b3a9fe..25d78ca 100644
--- a/drivers/staging/omapdrm/omap_plane.c
+++ b/drivers/staging/omapdrm/omap_plane.c
@@ -551,8 +551,8 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
return plane;
fail:
- if (plane) {
+ if (plane)
omap_plane_destroy(plane);
- }
+
return NULL;
}
--
1.7.9.5
The following errors and warnings fixed.
- ERROR: code indent should use tabs where possible
- WARNING: please, no spaces at the start of a line
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/omapdrm/omap_plane.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/omapdrm/omap_plane.c b/drivers/staging/omapdrm/omap_plane.c
index 25d78ca..2a8e5ba 100644
--- a/drivers/staging/omapdrm/omap_plane.c
+++ b/drivers/staging/omapdrm/omap_plane.c
@@ -436,8 +436,8 @@ void omap_plane_install_properties(struct drm_plane *plane,
drm_object_attach_property(obj, prop, 0);
}
- prop = priv->zorder_prop;
- if (!prop) {
+ prop = priv->zorder_prop;
+ if (!prop) {
prop = drm_property_create_range(dev, 0, "zorder", 0, 3);
if (prop == NULL)
return;
--
1.7.9.5