Re: [RFC PATCH 0/5] Move IPUv3 core out of staging, add CSI support

2014-02-26 Thread Dan Carpenter

Please fix the following static checker complaints before moving out of
staging:

drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c:164 ipu_dmfc_setup_channel() warn: 
variable dereferenced before check 'dmfc' (see line 157)
drivers/staging/imx-drm/imx-ldb.c:109 imx_ldb_connector_get_modes() error: 
potential null dereference 'mode'.  (drm_mode_create returns null)
drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string 
overflow. buf_size: 16 length: 18
probably 18 is theory and not real life, but 16 is based on
theory as well.
drivers/staging/imx-drm/parallel-display.c:64 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)
drivers/staging/imx-drm/parallel-display.c:73 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)

drivers/staging/imx-drm/ipuv3-plane.c: In function ‘ipu_plane_set_base’:
drivers/staging/imx-drm/ipuv3-plane.c:75:2: warning: format ‘%x’ expects 
argument of type ‘unsigned int’, but argument 4 has type ‘dma_addr_t’ [-Wformat]
cast it to u64 and use %llx
drivers/staging/imx-drm/imx-drm-core.c:89:21: warning: symbol 
'imx_drm_find_crtc' was not declared. Should it be static?

regards,
dan carpenter
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC only] staging: dgap: fix OOPS on open of port

2014-02-26 Thread Dan Carpenter
On Tue, Feb 25, 2014 at 02:35:39PM -0500, Mark Hounschell wrote:
> On 02/25/2014 01:40 PM, Mark Hounschell wrote:
> 
> >
> >>>+struct dgap_port {
> >>>+struct tty_port port;
> >>>+};
> >>
> >>Do you really need a wrapping structure here?
> >>
> >
> >I may be incorrect, but I think so. I will investigate this further
> >before I make a patch.
> >
> 
> It looks to me like this is how it should be done. As future serial
> changes are done won't additional things be required to be added to
> dgap_port? port_ops? I certainly don't know what those future
> changes are but looking at other drivers (moxa.c) it looks so. What
> am I missing?

In the kernel we hate baggage like this.  Maybe it's a wrapper for
some historical reason, to support some other operating system or some
future reason; we hate it all.  Don't try to plan ahead, just write it
as it exists now because no one can predict the future.  Changing it
later is easier than everyone assumes.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: make functions as static

2014-02-26 Thread Daeseok Youn

These functions are only referenced in this file scope
so it can be marked static.
And remove space between function name and open parenthesis.

Signed-off-by: Daeseok Youn 
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|   94 ++--
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index 644a000..0c333cb 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -41,7 +41,7 @@
 #include "o2iblnd.h"
 #include 
 
-lnd_t the_o2iblnd = {
+static lnd_t the_o2iblnd = {
.lnd_type   = O2IBLND,
.lnd_startup= kiblnd_startup,
.lnd_shutdown   = kiblnd_shutdown,
@@ -53,8 +53,8 @@ lnd_t the_o2iblnd = {
 
 kib_data_t   kiblnd_data;
 
-__u32
-kiblnd_cksum (void *ptr, int nob)
+static __u32
+kiblnd_cksum(void *ptr, int nob)
 {
char  *c  = ptr;
__u32  sum = 0;
@@ -368,7 +368,7 @@ kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, 
lnet_nid_t nid)
 }
 
 void
-kiblnd_destroy_peer (kib_peer_t *peer)
+kiblnd_destroy_peer(kib_peer_t *peer)
 {
kib_net_t *net = peer->ibp_ni->ni_data;
 
@@ -390,7 +390,7 @@ kiblnd_destroy_peer (kib_peer_t *peer)
 }
 
 kib_peer_t *
-kiblnd_find_peer_locked (lnet_nid_t nid)
+kiblnd_find_peer_locked(lnet_nid_t nid)
 {
/* the caller is responsible for accounting the additional reference
 * that this creates */
@@ -419,7 +419,7 @@ kiblnd_find_peer_locked (lnet_nid_t nid)
 }
 
 void
-kiblnd_unlink_peer_locked (kib_peer_t *peer)
+kiblnd_unlink_peer_locked(kib_peer_t *peer)
 {
LASSERT (list_empty(&peer->ibp_conns));
 
@@ -429,8 +429,8 @@ kiblnd_unlink_peer_locked (kib_peer_t *peer)
kiblnd_peer_decref(peer);
 }
 
-int
-kiblnd_get_peer_info (lnet_ni_t *ni, int index,
+static int
+kiblnd_get_peer_info(lnet_ni_t *ni, int index,
  lnet_nid_t *nidp, int *count)
 {
kib_peer_t  *peer;
@@ -468,8 +468,8 @@ kiblnd_get_peer_info (lnet_ni_t *ni, int index,
return -ENOENT;
 }
 
-void
-kiblnd_del_peer_locked (kib_peer_t *peer)
+static void
+kiblnd_del_peer_locked(kib_peer_t *peer)
 {
struct list_head   *ctmp;
struct list_head   *cnxt;
@@ -489,8 +489,8 @@ kiblnd_del_peer_locked (kib_peer_t *peer)
 * last ref on it. */
 }
 
-int
-kiblnd_del_peer (lnet_ni_t *ni, lnet_nid_t nid)
+static int
+kiblnd_del_peer(lnet_ni_t *ni, lnet_nid_t nid)
 {
LIST_HEAD(zombies);
struct list_head*ptmp;
@@ -543,8 +543,8 @@ kiblnd_del_peer (lnet_ni_t *ni, lnet_nid_t nid)
return rc;
 }
 
-kib_conn_t *
-kiblnd_get_conn_by_idx (lnet_ni_t *ni, int index)
+static kib_conn_t *
+kiblnd_get_conn_by_idx(lnet_ni_t *ni, int index)
 {
kib_peer_t  *peer;
struct list_head*ptmp;
@@ -584,16 +584,16 @@ kiblnd_get_conn_by_idx (lnet_ni_t *ni, int index)
return NULL;
 }
 
-void
-kiblnd_debug_rx (kib_rx_t *rx)
+static void
+kiblnd_debug_rx(kib_rx_t *rx)
 {
CDEBUG(D_CONSOLE, "  %p status %d msg_type %x cred %d\n",
   rx, rx->rx_status, rx->rx_msg->ibm_type,
   rx->rx_msg->ibm_credits);
 }
 
-void
-kiblnd_debug_tx (kib_tx_t *tx)
+static void
+kiblnd_debug_tx(kib_tx_t *tx)
 {
CDEBUG(D_CONSOLE, "  %p snd %d q %d w %d rc %d dl %lx "
   "cookie "LPX64" msg %s%s type %x cred %d\n",
@@ -604,8 +604,8 @@ kiblnd_debug_tx (kib_tx_t *tx)
   tx->tx_msg->ibm_type, tx->tx_msg->ibm_credits);
 }
 
-void
-kiblnd_debug_conn (kib_conn_t *conn)
+static void
+kiblnd_debug_conn(kib_conn_t *conn)
 {
struct list_head*tmp;
int i;
@@ -920,7 +920,7 @@ kiblnd_create_conn(kib_peer_t *peer, struct rdma_cm_id 
*cmid,
 }
 
 void
-kiblnd_destroy_conn (kib_conn_t *conn)
+kiblnd_destroy_conn(kib_conn_t *conn)
 {
struct rdma_cm_id *cmid = conn->ibc_cmid;
kib_peer_t  *peer = conn->ibc_peer;
@@ -988,7 +988,7 @@ kiblnd_destroy_conn (kib_conn_t *conn)
 }
 
 int
-kiblnd_close_peer_conns_locked (kib_peer_t *peer, int why)
+kiblnd_close_peer_conns_locked(kib_peer_t *peer, int why)
 {
kib_conn_t   *conn;
struct list_head *ctmp;
@@ -1011,7 +1011,7 @@ kiblnd_close_peer_conns_locked (kib_peer_t *peer, int why)
 }
 
 int
-kiblnd_close_stale_conns_locked (kib_peer_t *peer,
+kiblnd_close_stale_conns_locked(kib_peer_t *peer,
 int version, __u64 incarnation)
 {
kib_conn_t   *conn;
@@ -1039,8 +1039,8 @@ kiblnd_close_stale_conns_locked (kib_peer_t *peer,
return count;
 }
 
-int
-kiblnd_close_matching_conns (lnet_ni_t *ni, lnet_nid_t nid)
+static int
+kiblnd_close_matching_conns(lnet_ni_t *ni, lnet_nid_t nid)
 {
kib_peer_t   *peer;
struct list_head *ptmp;
@@ -1142,7 +1142,7 @@ kiblnd_ctl(lnet_ni_

Re: [PATCH] staging: lustre: make functions as static

2014-02-26 Thread Dan Carpenter
On Wed, Feb 26, 2014 at 06:17:59PM +0900, Daeseok Youn wrote:
> 
> These functions are only referenced in this file scope
> so it can be marked static.
> And remove space between function name and open parenthesis.

If it's on the same line as a "static" change then it's fine, otherwise
it should go in a separate patch.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4 2/2] hyperv-fb: kick off efifb early

2014-02-26 Thread Gerd Hoffmann
  Hi,

> > diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c index
> > b7b3dd0..1b11886 100644
> > --- a/drivers/video/hyperv_fb.c
> > +++ b/drivers/video/hyperv_fb.c
> > @@ -683,6 +683,7 @@ static int hvfb_getmem(struct fb_info *info)
> > info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
> > info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
> > }
> > +   remove_conflicting_framebuffers(info->apertures,
> > KBUILD_MODNAME,
> > +false);
> 
> Thanks for the updates. I'm concerned about, after removing efifb, 
> if synthvid_send_config(hdev) fails, then there will be no video driver
> available.

That may happen, yes.

> Is there a way to bring the generic driver back if 
> synthvid_send_config(hdev) fails?

Not that I know of.

> If no way to recover the generic driver, please limit the early
> remove_conflicting_framebuffers() to Gen2 VM only.

I'll send updated patches once they are tested.

cheers,
  Gerd


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC PATCH 0/5] Move IPUv3 core out of staging, add CSI support

2014-02-26 Thread Russell King - ARM Linux
On Wed, Feb 26, 2014 at 11:39:03AM +0300, Dan Carpenter wrote:
> 
> Please fix the following static checker complaints before moving out of
> staging:
> 
> drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c:164 ipu_dmfc_setup_channel() warn: 
> variable dereferenced before check 'dmfc' (see line 157)

Note that what's being talked about being moved out is only the above,
not the files in drivers/staging/imx-drm.  DRM people have not yet
reviewed imx-drm itself, which is a necessary step - but nevertheless,
thanks for running a static checker on this stuff.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v5 0/2] hyperv-fb: add support for generation 2 virtual machines

2014-02-26 Thread Gerd Hoffmann
  Hi,

This patch series adds support for uefi-based gen2 virtual machines
to the hyperv-fb driver.  It depends on a few vmbus changes which are
staged in Greg's char-misc tree (and linux-next).

Patch #1 implements gen2 vm support for hyperv-fb.

Patch #2 unregisters efifb early to make sure the framebuffer isn't used
any more while hyperv-fb initialization is in progress.

v5 changes:
 - call remove_conflicting_framebuffers() only on gen2
   virtual machines.

v4 changes:
 - use KBUILD_MODNAME everywhere for consistent naming.
 - drop the two patches which Greg has staged in char-misc.

please apply,
  Gerd

Gerd Hoffmann (2):
  hyperv-fb: add support for generation 2 virtual machines.
  hyperv-fb: kick off efifb early

 drivers/video/hyperv_fb.c | 88 +--
 1 file changed, 62 insertions(+), 26 deletions(-)

-- 
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v5 1/2] hyperv-fb: add support for generation 2 virtual machines.

2014-02-26 Thread Gerd Hoffmann
UEFI-based generation 2 virtual machines support vmbus devices only.
There is no pci bus.  Thus they use a different mechanism for the
graphics framebuffer:  Instead of using the vga pci bar a chunk of
memory muct be allocated from the hyperv mmio region declared using
APCI.  This patch implements support for it.

Based on a patch by Haiyang Zhang 

Signed-off-by: Gerd Hoffmann 
---
 drivers/video/hyperv_fb.c | 86 +--
 1 file changed, 60 insertions(+), 26 deletions(-)

diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
index 130708f..b7b3dd0 100644
--- a/drivers/video/hyperv_fb.c
+++ b/drivers/video/hyperv_fb.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -212,6 +213,7 @@ struct synthvid_msg {
 
 struct hvfb_par {
struct fb_info *info;
+   struct resource mem;
bool fb_ready; /* fb device is ready */
struct completion wait;
u32 synthvid_version;
@@ -460,13 +462,13 @@ static int synthvid_connect_vsp(struct hv_device *hdev)
goto error;
}
 
-   if (par->synthvid_version == SYNTHVID_VERSION_WIN7) {
+   if (par->synthvid_version == SYNTHVID_VERSION_WIN7)
screen_depth = SYNTHVID_DEPTH_WIN7;
-   screen_fb_size = SYNTHVID_FB_SIZE_WIN7;
-   } else {
+   else
screen_depth = SYNTHVID_DEPTH_WIN8;
-   screen_fb_size = SYNTHVID_FB_SIZE_WIN8;
-   }
+
+   screen_fb_size = hdev->channel->offermsg.offer.
+   mmio_megabytes * 1024 * 1024;
 
return 0;
 
@@ -627,26 +629,46 @@ static void hvfb_get_option(struct fb_info *info)
 /* Get framebuffer memory from Hyper-V video pci space */
 static int hvfb_getmem(struct fb_info *info)
 {
-   struct pci_dev *pdev;
-   ulong fb_phys;
+   struct hvfb_par *par = info->par;
+   struct pci_dev *pdev  = NULL;
void __iomem *fb_virt;
+   int gen2vm = efi_enabled(EFI_BOOT);
+   int ret;
 
-   pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
+   par->mem.name = KBUILD_MODNAME;
+   par->mem.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+   if (gen2vm) {
+   ret = allocate_resource(&hyperv_mmio, &par->mem,
+   screen_fb_size,
+   0, -1,
+   screen_fb_size,
+   NULL, NULL);
+   if (ret != 0) {
+   pr_err("Unable to allocate framebuffer memory\n");
+   return -ENODEV;
+   }
+   } else {
+   pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
  PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
-   if (!pdev) {
-   pr_err("Unable to find PCI Hyper-V video\n");
-   return -ENODEV;
-   }
+   if (!pdev) {
+   pr_err("Unable to find PCI Hyper-V video\n");
+   return -ENODEV;
+   }
 
-   if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
-   pci_resource_len(pdev, 0) < screen_fb_size)
-   goto err1;
+   if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
+   pci_resource_len(pdev, 0) < screen_fb_size)
+   goto err1;
 
-   fb_phys = pci_resource_end(pdev, 0) - screen_fb_size + 1;
-   if (!request_mem_region(fb_phys, screen_fb_size, KBUILD_MODNAME))
-   goto err1;
+   par->mem.end = pci_resource_end(pdev, 0);
+   par->mem.start = par->mem.end - screen_fb_size + 1;
+   ret = request_resource(&pdev->resource[0], &par->mem);
+   if (ret != 0) {
+   pr_err("Unable to request framebuffer memory\n");
+   goto err1;
+   }
+   }
 
-   fb_virt = ioremap(fb_phys, screen_fb_size);
+   fb_virt = ioremap(par->mem.start, screen_fb_size);
if (!fb_virt)
goto err2;
 
@@ -654,30 +676,42 @@ static int hvfb_getmem(struct fb_info *info)
if (!info->apertures)
goto err3;
 
-   info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
-   info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
-   info->fix.smem_start = fb_phys;
+   if (gen2vm) {
+   info->apertures->ranges[0].base = screen_info.lfb_base;
+   info->apertures->ranges[0].size = screen_info.lfb_size;
+   } else {
+   info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
+   info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
+   }
+
+   info->fix.smem_start = par->mem.start;
info->fix.smem_len = screen_fb_size;
info->screen_base = fb_virt;
info->screen_size = screen_fb_size;
 
-   pci_dev_put(pdev);
+   if (!gen2vm)
+   pci_dev_

[PATCH v5 2/2] hyperv-fb: kick off efifb early

2014-02-26 Thread Gerd Hoffmann
Remove firmware framebuffer before initializing hyperv-fb.  Needed
on gen2 virtual machines.   Letting register_framebuffer handle the
switchover results in efifb still being active while hyperv graphics
are initialized, which in turn can make the linux kernel hang.

Signed-off-by: Gerd Hoffmann 
---
 drivers/video/hyperv_fb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
index b7b3dd0..e23392e 100644
--- a/drivers/video/hyperv_fb.c
+++ b/drivers/video/hyperv_fb.c
@@ -679,6 +679,8 @@ static int hvfb_getmem(struct fb_info *info)
if (gen2vm) {
info->apertures->ranges[0].base = screen_info.lfb_base;
info->apertures->ranges[0].size = screen_info.lfb_size;
+   remove_conflicting_framebuffers(info->apertures,
+   KBUILD_MODNAME, false);
} else {
info->apertures->ranges[0].base = pci_resource_start(pdev, 0);
info->apertures->ranges[0].size = pci_resource_len(pdev, 0);
-- 
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: make functions as static

2014-02-26 Thread DaeSeok Youn
Actually , I saw some code like this file which is seperate line
between return value and function name.
So I didn't make one line of them.

Ok, I will make another patch after merge this one.
Thanks.
Daeseok Youn.

2014-02-26 18:20 GMT+09:00, Dan Carpenter :
> On Wed, Feb 26, 2014 at 06:17:59PM +0900, Daeseok Youn wrote:
>>
>> These functions are only referenced in this file scope
>> so it can be marked static.
>> And remove space between function name and open parenthesis.
>
> If it's on the same line as a "static" change then it's fine, otherwise
> it should go in a separate patch.
>
> regards,
> dan carpenter
>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: make functions as static

2014-02-26 Thread Dan Carpenter
On Wed, Feb 26, 2014 at 08:11:40PM +0900, DaeSeok Youn wrote:
> Actually , I saw some code like this file which is seperate line
> between return value and function name.
> So I didn't make one line of them.
> 
> Ok, I will make another patch after merge this one.

No, you are misunderstanding what I am saying.  Those type of function
declarations are allowed in the kernel so the original code is fine.
What I am saying is this patch is doing two thing but it should be doing
only one thing.

>  @@ -53,8 +53,8 @@ lnd_t the_o2iblnd = {
>  
>  kib_data_t kiblnd_data;
>  
> -__u32
> -kiblnd_cksum (void *ptr, int nob)
> +static __u32
> +kiblnd_cksum(void *ptr, int nob)
>  {
>   char  *c  = ptr;
>   __u32  sum = 0;

Changing the white space here is OK because it is a minor related
white space change.

> @@ -368,7 +368,7 @@ kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, 
> lnet_nid_t nid)
>  }
>  
>  void
> -kiblnd_destroy_peer (kib_peer_t *peer)
> +kiblnd_destroy_peer(kib_peer_t *peer)
> {

This is a random unrelated white space change, so do it in a separate
patch.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: make functions as static

2014-02-26 Thread DaeSeok Youn
Oh.. sorry.
Ok, I will seperate this patch as you said.

Thanks.
Daeseok Youn.

2014-02-26 20:31 GMT+09:00, Dan Carpenter :
> On Wed, Feb 26, 2014 at 08:11:40PM +0900, DaeSeok Youn wrote:
>> Actually , I saw some code like this file which is seperate line
>> between return value and function name.
>> So I didn't make one line of them.
>>
>> Ok, I will make another patch after merge this one.
>
> No, you are misunderstanding what I am saying.  Those type of function
> declarations are allowed in the kernel so the original code is fine.
> What I am saying is this patch is doing two thing but it should be doing
> only one thing.
>
>>  @@ -53,8 +53,8 @@ lnd_t the_o2iblnd = {
>>
>>  kib_data_tkiblnd_data;
>>
>> -__u32
>> -kiblnd_cksum (void *ptr, int nob)
>> +static __u32
>> +kiblnd_cksum(void *ptr, int nob)
>>  {
>>  char  *c  = ptr;
>>  __u32  sum = 0;
>
> Changing the white space here is OK because it is a minor related
> white space change.
>
>> @@ -368,7 +368,7 @@ kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp,
>> lnet_nid_t nid)
>>  }
>>
>>  void
>> -kiblnd_destroy_peer (kib_peer_t *peer)
>> +kiblnd_destroy_peer(kib_peer_t *peer)
>> {
>
> This is a random unrelated white space change, so do it in a separate
> patch.
>
> regards,
> dan carpenter
>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgap: fix kernel oops on port open

2014-02-26 Thread Mark Hounschell
This patch addresses the follow error message followed
by a kernel oops:

dgap: driver does not set tty->port. This will crash the kernel later. Fix the 
driver

It also renames the main function this patch addresses because
its name is misleading.

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/dgap/dgap.c | 47 -
 drivers/staging/dgap/dgap.h |  3 ++-
 2 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 7cb1ad5..192f63a 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -223,7 +223,7 @@ static void dgap_get_vpd(struct board_t *brd);
 static void dgap_do_reset_board(struct board_t *brd);
 static void dgap_do_wait_for_bios(struct board_t *brd);
 static void dgap_do_wait_for_fep(struct board_t *brd);
-static void dgap_sysfs_create(struct board_t *brd);
+static int dgap_tty_register_ports(struct board_t *brd);
 static int dgap_firmware_load(struct pci_dev *pdev, int card_type);
 
 /* Driver load/unload functions */
@@ -1098,7 +1098,9 @@ static int dgap_firmware_load(struct pci_dev *pdev, int 
card_type)
return ret;
}
 
-   dgap_sysfs_create(brd);
+   ret = dgap_tty_register_ports(brd);
+   if (ret)
+   return ret;
 
brd->state = BOARD_READY;
brd->dpastatus = BD_RUNNING;
@@ -1730,6 +1732,7 @@ static void dgap_tty_uninit(struct board_t *brd)
dgap_BoardsByMajor[brd->SerialDriver->major] = NULL;
brd->dgap_Serial_Major = 0;
for (i = 0; i < brd->nasync; i++) {
+   tty_port_destroy(&brd->SerialPorts[i]);

dgap_remove_tty_sysfs(brd->channels[i]->ch_tun.un_sysfs);
tty_unregister_device(brd->SerialDriver, i);
}
@@ -1737,6 +1740,7 @@ static void dgap_tty_uninit(struct board_t *brd)
kfree(brd->SerialDriver->ttys);
brd->SerialDriver->ttys = NULL;
put_tty_driver(brd->SerialDriver);
+   kfree(brd->SerialPorts);
brd->dgap_Major_Serial_Registered = FALSE;
}
 
@@ -1744,6 +1748,7 @@ static void dgap_tty_uninit(struct board_t *brd)
dgap_BoardsByMajor[brd->PrintDriver->major] = NULL;
brd->dgap_TransparentPrint_Major = 0;
for (i = 0; i < brd->nasync; i++) {
+   tty_port_destroy(&brd->PrinterPorts[i]);

dgap_remove_tty_sysfs(brd->channels[i]->ch_pun.un_sysfs);
tty_unregister_device(brd->PrintDriver, i);
}
@@ -1751,6 +1756,7 @@ static void dgap_tty_uninit(struct board_t *brd)
kfree(brd->PrintDriver->ttys);
brd->PrintDriver->ttys = NULL;
put_tty_driver(brd->PrintDriver);
+   kfree(brd->PrinterPorts);
brd->dgap_Major_TransparentPrint_Registered = FALSE;
}
 }
@@ -4813,25 +4819,48 @@ static int dgap_after_config_loaded(int board)
 /*
  * Create pr and tty device entries
  */
-static void dgap_sysfs_create(struct board_t *brd)
+static int dgap_tty_register_ports(struct board_t *brd)
 {
struct channel_t *ch;
-   int j = 0;
+   int i;
+
+   brd->SerialPorts = kcalloc(brd->nasync, sizeof(*brd->SerialPorts),
+   GFP_KERNEL);
+   if (brd->SerialPorts == NULL) {
+   pr_err("dgap: Cannot allocate serial port memory\n");
+   return -ENOMEM;
+   }
+   for (i = 0; i < brd->nasync; i++)
+   tty_port_init(&brd->SerialPorts[i]);
+
+   brd->PrinterPorts = kcalloc(brd->nasync, sizeof(*brd->PrinterPorts),
+   GFP_KERNEL);
+   if (brd->PrinterPorts == NULL) {
+   pr_err("dgap: Cannot allocate printer port memory\n");
+   return -ENOMEM;
+   }
+   for (i = 0; i < brd->nasync; i++)
+   tty_port_init(&brd->PrinterPorts[i]);
 
ch = brd->channels[0];
-   for (j = 0; j < brd->nasync; j++, ch = brd->channels[j]) {
+   for (i = 0; i < brd->nasync; i++, ch = brd->channels[i]) {
struct device *classp;
-   classp = tty_register_device(brd->SerialDriver, j,
-   &(ch->ch_bd->pdev->dev));
+
+   classp = tty_port_register_device(&brd->SerialPorts[i],
+   brd->SerialDriver, brd->firstminor + i, NULL);
+
ch->ch_tun.un_sysfs = classp;
dgap_create_tty_sysfs(&ch->ch_tun, classp);
 
-   classp = tty_register_device(brd->PrintDriver, j,
-   &(ch->ch_bd->pdev->dev));
+   classp = tty_port_register_device(&brd->PrinterPorts[i],
+   brd->PrintDriver, brd->firstminor + i, NULL);
+

Re: [PATCH] staging: dgap: fix kernel oops on port open

2014-02-26 Thread Dan Carpenter
On Wed, Feb 26, 2014 at 08:41:38AM -0500, Mark Hounschell wrote:
> -static void dgap_sysfs_create(struct board_t *brd)
> +static int dgap_tty_register_ports(struct board_t *brd)
>  {
>   struct channel_t *ch;
> - int j = 0;
> + int i;
> +
> + brd->SerialPorts = kcalloc(brd->nasync, sizeof(*brd->SerialPorts),
> + GFP_KERNEL);
> + if (brd->SerialPorts == NULL) {
> + pr_err("dgap: Cannot allocate serial port memory\n");

Don't add these error messages here.  kcalloc() already prints a much
better error message.

> + return -ENOMEM;
> + }
> + for (i = 0; i < brd->nasync; i++)
> + tty_port_init(&brd->SerialPorts[i]);
> +
> + brd->PrinterPorts = kcalloc(brd->nasync, sizeof(*brd->PrinterPorts),
> + GFP_KERNEL);
> + if (brd->PrinterPorts == NULL) {
> + pr_err("dgap: Cannot allocate printer port memory\n");

kfree(brd->SerialPorts);

> + return -ENOMEM;
> + }
> + for (i = 0; i < brd->nasync; i++)
> + tty_port_init(&brd->PrinterPorts[i]);
>  
>   ch = brd->channels[0];
> - for (j = 0; j < brd->nasync; j++, ch = brd->channels[j]) {
> + for (i = 0; i < brd->nasync; i++, ch = brd->channels[i]) {
>   struct device *classp;

Put a blank line after the declaration block.

> - classp = tty_register_device(brd->SerialDriver, j,
> - &(ch->ch_bd->pdev->dev));
> +
> + classp = tty_port_register_device(&brd->SerialPorts[i],
> + brd->SerialDriver, brd->firstminor + i, NULL);


The more traditional way to break up the long lines is:

classp = tty_port_register_device(&brd->SerialPorts[i],
  brd->SerialDriver,
  brd->firstminor + i, NULL);
dgap_create_tty_sysfs(&ch->ch_tun, classp);
ch->ch_tun.un_sysfs = classp;

classp = tty_port_register_device(&brd->PrinterPorts[i],
  brd->PrintDriver,
  brd->firstminor + i,
  NULL);
dgap_create_tty_sysfs(&ch->ch_pun, classp);
ch->ch_pun.un_sysfs = classp;

(also i re-ordered the last two lines).

(also I wouldn't have sent this email at all if there hadn't been that
missing kfree()).

regards,
dan carpenter

> +
>   ch->ch_tun.un_sysfs = classp;
>   dgap_create_tty_sysfs(&ch->ch_tun, classp);
>  
> - classp = tty_register_device(brd->PrintDriver, j,
> - &(ch->ch_bd->pdev->dev));
> + classp = tty_port_register_device(&brd->PrinterPorts[i],
> + brd->PrintDriver, brd->firstminor + i, NULL);
> +
>   ch->ch_pun.un_sysfs = classp;
>   dgap_create_tty_sysfs(&ch->ch_pun, classp);
>   }
>   dgap_create_ports_sysfiles(brd);
> +
> + return 0;

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgap: fix kernel oops on port open

2014-02-26 Thread Mark Hounschell

On 02/26/2014 09:01 AM, Dan Carpenter wrote:

On Wed, Feb 26, 2014 at 08:41:38AM -0500, Mark Hounschell wrote:

-static void dgap_sysfs_create(struct board_t *brd)
+static int dgap_tty_register_ports(struct board_t *brd)
  {
struct channel_t *ch;
-   int j = 0;
+   int i;
+
+   brd->SerialPorts = kcalloc(brd->nasync, sizeof(*brd->SerialPorts),
+   GFP_KERNEL);
+   if (brd->SerialPorts == NULL) {
+   pr_err("dgap: Cannot allocate serial port memory\n");


Don't add these error messages here.  kcalloc() already prints a much
better error message.



OK


+   return -ENOMEM;
+   }
+   for (i = 0; i < brd->nasync; i++)
+   tty_port_init(&brd->SerialPorts[i]);
+
+   brd->PrinterPorts = kcalloc(brd->nasync, sizeof(*brd->PrinterPorts),
+   GFP_KERNEL);
+   if (brd->PrinterPorts == NULL) {
+   pr_err("dgap: Cannot allocate printer port memory\n");


kfree(brd->SerialPorts);


+   return -ENOMEM;
+   }
+   for (i = 0; i < brd->nasync; i++)
+   tty_port_init(&brd->PrinterPorts[i]);

ch = brd->channels[0];
-   for (j = 0; j < brd->nasync; j++, ch = brd->channels[j]) {
+   for (i = 0; i < brd->nasync; i++, ch = brd->channels[i]) {
struct device *classp;


Put a blank line after the declaration block.



OK


-   classp = tty_register_device(brd->SerialDriver, j,
-   &(ch->ch_bd->pdev->dev));
+
+   classp = tty_port_register_device(&brd->SerialPorts[i],
+   brd->SerialDriver, brd->firstminor + i, NULL);



The more traditional way to break up the long lines is:

classp = tty_port_register_device(&brd->SerialPorts[i],
  brd->SerialDriver,
  brd->firstminor + i, NULL);
dgap_create_tty_sysfs(&ch->ch_tun, classp);
ch->ch_tun.un_sysfs = classp;

classp = tty_port_register_device(&brd->PrinterPorts[i],
  brd->PrintDriver,
  brd->firstminor + i,
  NULL);
dgap_create_tty_sysfs(&ch->ch_pun, classp);
ch->ch_pun.un_sysfs = classp;

(also i re-ordered the last two lines).



OK again.


(also I wouldn't have sent this email at all if there hadn't been that
missing kfree()).

regards,
dan carpenter


Thanks. I'll fix and resend

Mark

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: dgap: fix kernel oops on port open

2014-02-26 Thread Mark Hounschell
This patch addresses the follow error message followed
by a kernel oops:

dgap: driver does not set tty->port. This will crash the kernel later. Fix the 
driver

It also renames the main function this patch addresses because
its name is misleading.

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/dgap/dgap.c | 52 +++--
 drivers/staging/dgap/dgap.h |  3 ++-
 2 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 7cb1ad5..f9adf8a 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -223,7 +223,7 @@ static void dgap_get_vpd(struct board_t *brd);
 static void dgap_do_reset_board(struct board_t *brd);
 static void dgap_do_wait_for_bios(struct board_t *brd);
 static void dgap_do_wait_for_fep(struct board_t *brd);
-static void dgap_sysfs_create(struct board_t *brd);
+static int dgap_tty_register_ports(struct board_t *brd);
 static int dgap_firmware_load(struct pci_dev *pdev, int card_type);
 
 /* Driver load/unload functions */
@@ -1098,7 +1098,9 @@ static int dgap_firmware_load(struct pci_dev *pdev, int 
card_type)
return ret;
}
 
-   dgap_sysfs_create(brd);
+   ret = dgap_tty_register_ports(brd);
+   if (ret)
+   return ret;
 
brd->state = BOARD_READY;
brd->dpastatus = BD_RUNNING;
@@ -1730,6 +1732,7 @@ static void dgap_tty_uninit(struct board_t *brd)
dgap_BoardsByMajor[brd->SerialDriver->major] = NULL;
brd->dgap_Serial_Major = 0;
for (i = 0; i < brd->nasync; i++) {
+   tty_port_destroy(&brd->SerialPorts[i]);

dgap_remove_tty_sysfs(brd->channels[i]->ch_tun.un_sysfs);
tty_unregister_device(brd->SerialDriver, i);
}
@@ -1737,6 +1740,7 @@ static void dgap_tty_uninit(struct board_t *brd)
kfree(brd->SerialDriver->ttys);
brd->SerialDriver->ttys = NULL;
put_tty_driver(brd->SerialDriver);
+   kfree(brd->SerialPorts);
brd->dgap_Major_Serial_Registered = FALSE;
}
 
@@ -1744,6 +1748,7 @@ static void dgap_tty_uninit(struct board_t *brd)
dgap_BoardsByMajor[brd->PrintDriver->major] = NULL;
brd->dgap_TransparentPrint_Major = 0;
for (i = 0; i < brd->nasync; i++) {
+   tty_port_destroy(&brd->PrinterPorts[i]);

dgap_remove_tty_sysfs(brd->channels[i]->ch_pun.un_sysfs);
tty_unregister_device(brd->PrintDriver, i);
}
@@ -1751,6 +1756,7 @@ static void dgap_tty_uninit(struct board_t *brd)
kfree(brd->PrintDriver->ttys);
brd->PrintDriver->ttys = NULL;
put_tty_driver(brd->PrintDriver);
+   kfree(brd->PrinterPorts);
brd->dgap_Major_TransparentPrint_Registered = FALSE;
}
 }
@@ -4813,25 +4819,49 @@ static int dgap_after_config_loaded(int board)
 /*
  * Create pr and tty device entries
  */
-static void dgap_sysfs_create(struct board_t *brd)
+static int dgap_tty_register_ports(struct board_t *brd)
 {
struct channel_t *ch;
-   int j = 0;
+   int i;
+
+   brd->SerialPorts = kcalloc(brd->nasync, sizeof(*brd->SerialPorts),
+   GFP_KERNEL);
+   if (brd->SerialPorts == NULL)
+   return -ENOMEM;
+   for (i = 0; i < brd->nasync; i++)
+   tty_port_init(&brd->SerialPorts[i]);
+
+   brd->PrinterPorts = kcalloc(brd->nasync, sizeof(*brd->PrinterPorts),
+   GFP_KERNEL);
+   if (brd->PrinterPorts == NULL) {
+   kfree(brd->SerialPorts);
+   return -ENOMEM;
+   }
+   for (i = 0; i < brd->nasync; i++)
+   tty_port_init(&brd->PrinterPorts[i]);
 
ch = brd->channels[0];
-   for (j = 0; j < brd->nasync; j++, ch = brd->channels[j]) {
+   for (i = 0; i < brd->nasync; i++, ch = brd->channels[i]) {
+
struct device *classp;
-   classp = tty_register_device(brd->SerialDriver, j,
-   &(ch->ch_bd->pdev->dev));
-   ch->ch_tun.un_sysfs = classp;
+
+   classp = tty_port_register_device(&brd->SerialPorts[i],
+   brd->SerialDriver,
+   brd->firstminor + i, NULL);
+
dgap_create_tty_sysfs(&ch->ch_tun, classp);
+   ch->ch_tun.un_sysfs = classp;
+
+   classp = tty_port_register_device(&brd->PrinterPorts[i],
+   brd->PrintDriver,
+   brd->firstminor + i, NULL);
 
-   classp = tty_register_device(brd->PrintDriver, j,
-

Re: [PATCH v2] staging: dgap: fix kernel oops on port open

2014-02-26 Thread Dan Carpenter
On Wed, Feb 26, 2014 at 10:18:26AM -0500, Mark Hounschell wrote:
> This patch addresses the follow error message followed
> by a kernel oops:
> 
> dgap: driver does not set tty->port. This will crash the kernel later. Fix 
> the driver
> 
> It also renames the main function this patch addresses because
> its name is misleading.
> 

Thanks.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v5 2/2] hyperv-fb: kick off efifb early

2014-02-26 Thread Haiyang Zhang


> -Original Message-
> From: Gerd Hoffmann [mailto:kra...@redhat.com]
> Sent: Wednesday, February 26, 2014 5:51 AM
> To: linux-fb...@vger.kernel.org
> Cc: linux-ker...@vger.kernel.org; gre...@linuxfoundation.org; KY Srinivasan;
> Abhishek Gupta (LIS); Haiyang Zhang; jasow...@redhat.com;
> tomi.valkei...@ti.com; de...@linuxdriverproject.org; Gerd Hoffmann; Jean-
> Christophe Plagniol-Villard
> Subject: [PATCH v5 2/2] hyperv-fb: kick off efifb early
> 
> Remove firmware framebuffer before initializing hyperv-fb.  Needed
> on gen2 virtual machines.   Letting register_framebuffer handle the
> switchover results in efifb still being active while hyperv graphics
> are initialized, which in turn can make the linux kernel hang.
> 
> Signed-off-by: Gerd Hoffmann 

Thank you!

Signed-off-by: Haiyang Zhang 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v5 1/2] hyperv-fb: add support for generation 2 virtual machines.

2014-02-26 Thread Haiyang Zhang


> -Original Message-
> From: linux-fbdev-ow...@vger.kernel.org [mailto:linux-fbdev-
> ow...@vger.kernel.org] On Behalf Of Gerd Hoffmann
> Sent: Wednesday, February 26, 2014 5:51 AM
> To: linux-fb...@vger.kernel.org
> Cc: linux-ker...@vger.kernel.org; gre...@linuxfoundation.org; KY Srinivasan;
> Abhishek Gupta (LIS); Haiyang Zhang; jasow...@redhat.com;
> tomi.valkei...@ti.com; de...@linuxdriverproject.org; Gerd Hoffmann; Jean-
> Christophe Plagniol-Villard
> Subject: [PATCH v5 1/2] hyperv-fb: add support for generation 2 virtual
> machines.
> 
> UEFI-based generation 2 virtual machines support vmbus devices only.
> There is no pci bus.  Thus they use a different mechanism for the
> graphics framebuffer:  Instead of using the vga pci bar a chunk of
> memory muct be allocated from the hyperv mmio region declared using
> APCI.  This patch implements support for it.
> 
> Based on a patch by Haiyang Zhang 
> 
> Signed-off-by: Gerd Hoffmann 

Thank you!

Signed-off-by: Haiyang Zhang 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv8][ 2/7] staging: imx-drm: Add RGB666 support for parallel display.

2014-02-26 Thread Denis Carikli
Cc: Eric Bénard 
Cc: Greg Kroah-Hartman 
Cc: Shawn Guo 
Cc: de...@driverdev.osuosl.org
Cc: linux-arm-ker...@lists.infradead.org
Signed-off-by: Denis Carikli 
---
ChangeLog v7->v8:
- Shrinked even more the Cc list.

ChangeLog v6->v7:
- Shrinked even more the Cc list.

ChangeLog v5->v6:
- Remove people not concerned by this patch from the Cc list.

ChangeLog v3->v5:
- Use the correct RGB order.

ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Removed the commit message long desciption that was just a copy of the short
  description.
- Rebased the patch.
- Fixed a copy-paste error in the ipu_dc_map_clear parameter.
---
 .../bindings/staging/imx-drm/fsl-imx-drm.txt   |2 +-
 drivers/staging/imx-drm/ipu-v3/ipu-dc.c|9 +
 drivers/staging/imx-drm/parallel-display.c |2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt 
b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
index b876d49..2d24425 100644
--- a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
+++ b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
@@ -29,7 +29,7 @@ Required properties:
 - crtc: the crtc this display is connected to, see below
 Optional properties:
 - interface_pix_fmt: How this display is connected to the
-  crtc. Currently supported types: "rgb24", "rgb565", "bgr666"
+  crtc. Currently supported types: "rgb24", "rgb565", "bgr666", "rgb666"
 - edid: verbatim EDID data block describing attached display.
 - ddc: phandle describing the i2c bus handling the display data
   channel
diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c 
b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
index d0e3bc3..617e65b 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
@@ -92,6 +92,7 @@ enum ipu_dc_map {
IPU_DC_MAP_GBR24, /* TVEv2 */
IPU_DC_MAP_BGR666,
IPU_DC_MAP_BGR24,
+   IPU_DC_MAP_RGB666,
 };
 
 struct ipu_dc {
@@ -155,6 +156,8 @@ static int ipu_pixfmt_to_map(u32 fmt)
return IPU_DC_MAP_BGR666;
case V4L2_PIX_FMT_BGR24:
return IPU_DC_MAP_BGR24;
+   case V4L2_PIX_FMT_RGB666:
+   return IPU_DC_MAP_RGB666;
default:
return -EINVAL;
}
@@ -404,6 +407,12 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,
ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 1, 15, 0xff); /* green */
ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 0, 23, 0xff); /* blue */
 
+   /* rgb666 */
+   ipu_dc_map_clear(priv, IPU_DC_MAP_RGB666);
+   ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 0, 5, 0xfc); /* blue */
+   ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 1, 11, 0xfc); /* green */
+   ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 2, 17, 0xfc); /* red */
+
return 0;
 }
 
diff --git a/drivers/staging/imx-drm/parallel-display.c 
b/drivers/staging/imx-drm/parallel-display.c
index d610f07..12a1b5e 100644
--- a/drivers/staging/imx-drm/parallel-display.c
+++ b/drivers/staging/imx-drm/parallel-display.c
@@ -196,6 +196,8 @@ static int imx_pd_bind(struct device *dev, struct device 
*master, void *data)
imxpd->interface_pix_fmt = V4L2_PIX_FMT_RGB565;
else if (!strcmp(fmt, "bgr666"))
imxpd->interface_pix_fmt = V4L2_PIX_FMT_BGR666;
+   else if (!strcmp(fmt, "rgb666"))
+   imxpd->interface_pix_fmt = V4L2_PIX_FMT_RGB666;
}
 
imxpd->dev = dev;
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv8][ 4/7] staging: imx-drm: Use de-active and pixelclk-active display-timings.

2014-02-26 Thread Denis Carikli
If de-active and/or pixelclk-active properties were set in the
display-timings DT node, they were not used.

Instead the data-enable and the pixel data clock polarity
were hardcoded.

This change is needed for making the eukrea-cpuimx51
  QVGA display work.

Cc: Eric Bénard 
Cc: Greg Kroah-Hartman 
Cc: Shawn Guo 
Cc: de...@driverdev.osuosl.org
Cc: linux-arm-ker...@lists.infradead.org
Signed-off-by: Denis Carikli 
---
ChangeLog v7->v8:
- Changed one Cc

ChangeLog v6->v7:
- Shrinked even more the Cc list.
- Rebased the patch
- val is now initialized in imx_pd_connector_get_modes

ChangeLog v5->v6:
- Remove people not concerned by this patch from the Cc list.
- Removed wrong coments from the code.
- Corrected the code style of the "if (!!val)"

ChangeLog v3->v4:
- The old patch was named "staging: imx-drm: ipuv3-crtc: don't harcode some 
mode".
- Reworked the patch entierly: we now takes the mode flags from the device tree.

ChangeLog v2->v3:
- Added some interested people in the Cc list.
- Ajusted the flags to match the changes in "drm: Add the lacking
  DRM_MODE_FLAG_* for matching the DISPLAY_FLAGS_*"
---
 drivers/staging/imx-drm/imx-drm.h  |3 +++
 drivers/staging/imx-drm/ipuv3-crtc.c   |8 ++--
 drivers/staging/imx-drm/parallel-display.c |   27 +++
 3 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-drm.h 
b/drivers/staging/imx-drm/imx-drm.h
index aa21028..1893890 100644
--- a/drivers/staging/imx-drm/imx-drm.h
+++ b/drivers/staging/imx-drm/imx-drm.h
@@ -5,6 +5,9 @@
 
 #define IPU_PIX_FMT_GBR24  v4l2_fourcc('G', 'B', 'R', '3')
 
+#define IMXDRM_MODE_FLAG_DE_HIGH   (1 << 0)
+#define IMXDRM_MODE_FLAG_PIXDATA_POSEDGE   (1 << 1)
+
 struct device_node;
 struct drm_crtc;
 struct drm_connector;
diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c 
b/drivers/staging/imx-drm/ipuv3-crtc.c
index e646017..08c506a 100644
--- a/drivers/staging/imx-drm/ipuv3-crtc.c
+++ b/drivers/staging/imx-drm/ipuv3-crtc.c
@@ -157,8 +157,12 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
if (mode->flags & DRM_MODE_FLAG_PVSYNC)
sig_cfg.Vsync_pol = 1;
 
-   sig_cfg.enable_pol = 1;
-   sig_cfg.clk_pol = 1;
+   if (mode->private_flags & IMXDRM_MODE_FLAG_DE_HIGH)
+   sig_cfg.enable_pol = 1;
+
+   if (mode->private_flags & IMXDRM_MODE_FLAG_PIXDATA_POSEDGE)
+   sig_cfg.clk_pol = 1;
+
sig_cfg.width = mode->hdisplay;
sig_cfg.height = mode->vdisplay;
sig_cfg.pixel_fmt = out_pixel_fmt;
diff --git a/drivers/staging/imx-drm/parallel-display.c 
b/drivers/staging/imx-drm/parallel-display.c
index 12a1b5e..ac55de5 100644
--- a/drivers/staging/imx-drm/parallel-display.c
+++ b/drivers/staging/imx-drm/parallel-display.c
@@ -69,7 +69,34 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
 
if (np) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
+   struct device_node *timings_np;
+   struct device_node *mode_np;
+   u32 val = 1;
+
of_get_drm_display_mode(np, &imxpd->mode, OF_USE_NATIVE_MODE);
+
+   timings_np = of_get_child_by_name(np, "display-timings");
+   if (timings_np) {
+   /* get the display mode node */
+   mode_np = of_parse_phandle(timings_np,
+  "native-mode", 0);
+   if (!mode_np)
+   mode_np = of_get_next_child(timings_np, NULL);
+
+   /* set de-active to 1 if not set */
+   of_property_read_u32(mode_np, "de-active", &val);
+   if (val) {
+   imxpd->mode.private_flags |=
+   IMXDRM_MODE_FLAG_DE_HIGH;
+   }
+
+   /* set pixelclk-active to 1 if not set */
+   of_property_read_u32(mode_np, "pixelclk-active", &val);
+   if (val) {
+   imxpd->mode.private_flags |=
+   IMXDRM_MODE_FLAG_PIXDATA_POSEDGE;
+   }
+   }
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
drm_mode_probed_add(connector, mode);
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv8][ 5/7] staging: imx-drm: parallel display: add regulator support.

2014-02-26 Thread Denis Carikli
Cc: Alexander Shiyan 
Cc: Eric Bénard 
Cc: Greg Kroah-Hartman 
Cc: driverdev-devel@linuxdriverproject.org
Cc: linux-arm-ker...@lists.infradead.org
Signed-off-by: Denis Carikli 
---
ChangeLog v7->v8:
- Shrinked even more the Cc list.
- Rebased.

ChangeLog v6->v7:
- Shrinked even more the Cc list.
- Rebased the patch and included video/of_display_timing.h
---
 .../bindings/staging/imx-drm/fsl-imx-drm.txt   |1 +
 drivers/staging/imx-drm/parallel-display.c |   13 +
 2 files changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt 
b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
index 2d24425..4dd7ce5 100644
--- a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
+++ b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
@@ -28,6 +28,7 @@ Required properties:
 - compatible: Should be "fsl,imx-parallel-display"
 - crtc: the crtc this display is connected to, see below
 Optional properties:
+- display-supply : phandle to the regulator device tree node if needed.
 - interface_pix_fmt: How this display is connected to the
   crtc. Currently supported types: "rgb24", "rgb565", "bgr666", "rgb666"
 - edid: verbatim EDID data block describing attached display.
diff --git a/drivers/staging/imx-drm/parallel-display.c 
b/drivers/staging/imx-drm/parallel-display.c
index ac55de5..e9fe00e 100644
--- a/drivers/staging/imx-drm/parallel-display.c
+++ b/drivers/staging/imx-drm/parallel-display.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -35,6 +36,7 @@ struct imx_parallel_display {
struct drm_connector connector;
struct drm_encoder encoder;
struct device *dev;
+   struct regulator *disp_reg;
void *edid;
int edid_len;
u32 interface_pix_fmt;
@@ -129,6 +131,9 @@ static void imx_pd_encoder_prepare(struct drm_encoder 
*encoder)
 {
struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
 
+   if (regulator_enable(imxpd->disp_reg))
+   dev_err(imxpd->dev, "Failed to enable regulator.\n");
+
imx_drm_panel_format(encoder, imxpd->interface_pix_fmt);
 }
 
@@ -144,6 +149,10 @@ static void imx_pd_encoder_mode_set(struct drm_encoder 
*encoder,
 
 static void imx_pd_encoder_disable(struct drm_encoder *encoder)
 {
+   struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
+
+   if (regulator_disable(imxpd->disp_reg))
+   dev_err(imxpd->dev, "Failed to disable regulator.\n");
 }
 
 static struct drm_connector_funcs imx_pd_connector_funcs = {
@@ -233,6 +242,10 @@ static int imx_pd_bind(struct device *dev, struct device 
*master, void *data)
if (ret)
return ret;
 
+   imxpd->disp_reg = devm_regulator_get(dev, "display");
+   if (IS_ERR(imxpd->disp_reg))
+   return PTR_ERR(imxpd->disp_reg);
+
dev_set_drvdata(dev, imxpd);
 
return 0;
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv8][ 3/7] staging: imx-drm: Correct BGR666 and the board's dts that use them.

2014-02-26 Thread Denis Carikli
The current BGR666 is not consistent with the other color mapings like BGR24.
BGR666 should be in the same byte order than BGR24.

Cc: Eric Bénard 
Cc: Greg Kroah-Hartman 
Cc: Shawn Guo 
Cc: de...@driverdev.osuosl.org
Cc: linux-arm-ker...@lists.infradead.org
Signed-off-by: Denis Carikli 
---
ChangeLog v7->v8:
- Shrinked even more the Cc list.

ChangeLog v6->v7:
- Shrinked even more the Cc list.

ChangeLog v5->v6:
- Remove people not concerned by this patch from the Cc list.
- Added a better explanation of the change.

ChangeLog v5:
- New patch.
---
 arch/arm/boot/dts/imx51-apf51dev.dts|2 +-
 arch/arm/boot/dts/imx53-m53evk.dts  |2 +-
 drivers/staging/imx-drm/ipu-v3/ipu-dc.c |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/imx51-apf51dev.dts 
b/arch/arm/boot/dts/imx51-apf51dev.dts
index c29cfa9..bff3201 100644
--- a/arch/arm/boot/dts/imx51-apf51dev.dts
+++ b/arch/arm/boot/dts/imx51-apf51dev.dts
@@ -19,7 +19,7 @@
display@di1 {
compatible = "fsl,imx-parallel-display";
crtcs = <&ipu 0>;
-   interface-pix-fmt = "bgr666";
+   interface-pix-fmt = "rgb666";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu_disp1>;
 
diff --git a/arch/arm/boot/dts/imx53-m53evk.dts 
b/arch/arm/boot/dts/imx53-m53evk.dts
index d939ba8..4250e74 100644
--- a/arch/arm/boot/dts/imx53-m53evk.dts
+++ b/arch/arm/boot/dts/imx53-m53evk.dts
@@ -24,7 +24,7 @@
display1: display@di1 {
compatible = "fsl,imx-parallel-display";
crtcs = <&ipu 1>;
-   interface-pix-fmt = "bgr666";
+   interface-pix-fmt = "rgb666";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu_disp1>;
 
diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c 
b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
index 617e65b..b11a2aa 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
@@ -397,9 +397,9 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,
 
/* bgr666 */
ipu_dc_map_clear(priv, IPU_DC_MAP_BGR666);
-   ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 0, 5, 0xfc); /* blue */
+   ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 0, 17, 0xfc); /* blue */
ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 1, 11, 0xfc); /* green */
-   ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 2, 17, 0xfc); /* red */
+   ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 2, 5, 0xfc); /* red */
 
/* bgr24 */
ipu_dc_map_clear(priv, IPU_DC_MAP_BGR24);
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems

2014-02-26 Thread Guennadi Liakhovetski
Hi Russell

(I suspect this my email will be rejected by ALKML too like other my 
recent emails, but at least other MLs will pick it up and individual CCs 
too, so, if replying, maybe it would be good to keep my entire reply, all 
the more that it's going to be very short)

On Thu, 2 Jan 2014, Russell King wrote:

> Subsystems such as ALSA, DRM and others require a single card-level
> device structure to represent a subsystem.  However, firmware tends to
> describe the individual devices and the connections between them.
> 
> Therefore, we need a way to gather up the individual component devices
> together, and indicate when we have all the component devices.
> 
> We do this in DT by providing a "superdevice" node which specifies
> the components, eg:
> 
>   imx-drm {
>   compatible = "fsl,drm";
>   crtcs = <&ipu1>;
>   connectors = <&hdmi>;
>   };

It is a pity linux-media wasn't CC'ed and apparently V4L developers didn't 
notice this and other related patches in a "clean up" series, and now this 
patch is already in the mainline. But at least I'd like to ask whether the 
bindings, defined in 
Documentation/devicetree/bindings/media/video-interfaces.txt and 
implemented in drivers/media/v4l2-core/v4l2-of.c have been considered for 
this job, and - if so - why have they been found unsuitable? Wouldn't it 
have been better to use and - if needed - extend them to cover any 
deficiencies? Even though the implementation is currently located under 
drivers/media/v4l2-code/ it's pretty generic and should be easily 
transferable to a more generic location.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/6] imx-drm: parallel-display: Check 'dmfc' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warnings:

drivers/staging/imx-drm/parallel-display.c:64 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)
drivers/staging/imx-drm/parallel-display.c:73 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
 drivers/staging/imx-drm/parallel-display.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/imx-drm/parallel-display.c 
b/drivers/staging/imx-drm/parallel-display.c
index d610f07..08e47aa 100644
--- a/drivers/staging/imx-drm/parallel-display.c
+++ b/drivers/staging/imx-drm/parallel-display.c
@@ -61,6 +61,8 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
 
if (imxpd->mode_valid) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
drm_mode_probed_add(connector, mode);
@@ -69,6 +71,8 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
 
if (np) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
of_get_drm_display_mode(np, &imxpd->mode, OF_USE_NATIVE_MODE);
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] imx-drm: ipu-dmfc: Check 'dmfc' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c:164 ipu_dmfc_setup_channel() warn: 
variable dereferenced before check 'dmfc' (see line 157)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
 drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c 
b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
index 98070dd..76542d3 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
@@ -157,13 +157,13 @@ static int ipu_dmfc_setup_channel(struct dmfc_channel 
*dmfc, int slots,
struct ipu_dmfc_priv *priv = dmfc->priv;
u32 val, field;
 
+   if (!dmfc)
+   return -EINVAL;
+
dev_dbg(priv->dev,
"dmfc: using %d slots starting from segment %d for IPU 
channel %d\n",
slots, segment, dmfc->data->ipu_channel);
 
-   if (!dmfc)
-   return -EINVAL;
-
switch (slots) {
case 1:
field = DMFC_FIFO_SIZE_64;
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/6] imx-drm: imx-ldb: Check 'mode' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:109 imx_ldb_connector_get_modes() error: 
potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
 drivers/staging/imx-drm/imx-ldb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/imx-drm/imx-ldb.c 
b/drivers/staging/imx-drm/imx-ldb.c
index 5168c76..abf8517 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -106,6 +106,8 @@ static int imx_ldb_connector_get_modes(struct drm_connector 
*connector)
struct drm_display_mode *mode;
 
mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
drm_mode_copy(mode, &imx_ldb_ch->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
drm_mode_probed_add(connector, mode);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] imx-drm: imx-drm-core: Staticize imx_drm_find_crtc()

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-drm-core.c:89:21: warning: symbol 
'imx_drm_find_crtc' was not declared. Should it be static?

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
 drivers/staging/imx-drm/imx-drm-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
b/drivers/staging/imx-drm/imx-drm-core.c
index dcba518..6b91c8e 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -86,7 +86,7 @@ static int imx_drm_driver_unload(struct drm_device *drm)
return 0;
 }
 
-struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
+static struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
 {
struct imx_drm_device *imxdrm = crtc->dev->dev_private;
unsigned i;
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/6] imx-drm: imx-ldb: Fix array length

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string 
overflow. buf_size: 16 length: 18
probably 18 is theory and not real life, but 16 is based on
theory as well.

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
 drivers/staging/imx-drm/imx-ldb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-ldb.c 
b/drivers/staging/imx-drm/imx-ldb.c
index abf8517..d49dcaa5 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -332,7 +332,7 @@ static struct drm_encoder_helper_funcs 
imx_ldb_encoder_helper_funcs = {
 
 static int imx_ldb_get_clk(struct imx_ldb *ldb, int chno)
 {
-   char clkname[16];
+   char clkname[18];
 
sprintf(clkname, "di%d", chno);
ldb->clk[chno] = devm_clk_get(ldb->dev, clkname);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/6] imx-drm: ipuv3-plane: Use %pad to print 'dma_addr_t'

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/ipuv3-plane.c:75:2: warning: format '%x' expects 
argument of type 'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]

Use %pad to print 'dma_addr_t'.

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
 drivers/staging/imx-drm/ipuv3-plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/imx-drm/ipuv3-plane.c 
b/drivers/staging/imx-drm/ipuv3-plane.c
index 34b642a..83b6010 100644
--- a/drivers/staging/imx-drm/ipuv3-plane.c
+++ b/drivers/staging/imx-drm/ipuv3-plane.c
@@ -72,8 +72,8 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct 
drm_framebuffer *fb,
return -EFAULT;
}
 
-   dev_dbg(ipu_plane->base.dev->dev, "phys = 0x%x, x = %d, y = %d",
-   cma_obj->paddr, x, y);
+   dev_dbg(ipu_plane->base.dev->dev, "phys = %pad, x = %d, y = %d",
+   &cma_obj->paddr, x, y);
 
cpmem = ipu_get_cpmem(ipu_plane->ipu_ch);
ipu_cpmem_set_stride(cpmem, fb->pitches[0]);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/6] imx-drm: ipu-dmfc: Check 'dmfc' pointer first

2014-02-26 Thread Dan Carpenter
On Wed, Feb 26, 2014 at 06:44:34PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Fix the following static checker warning:
> 
> drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c:164 ipu_dmfc_setup_channel() warn: 
> variable dereferenced before check 'dmfc' (see line 157)
> 
> Reported-by: Dan Carpenter 
> Signed-off-by: Fabio Estevam 
> ---
>  drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c 
> b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
> index 98070dd..76542d3 100644
> --- a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
> +++ b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
> @@ -157,13 +157,13 @@ static int ipu_dmfc_setup_channel(struct dmfc_channel 
> *dmfc, int slots,
>   struct ipu_dmfc_priv *priv = dmfc->priv;
 ^^

There is another dereference here still...

>   u32 val, field;
>  
> + if (!dmfc)
> + return -EINVAL;
> +

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/6] imx-drm: parallel-display: Check 'dmfc' pointer first

2014-02-26 Thread Dan Carpenter
On Wed, Feb 26, 2014 at 06:44:37PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Fix the following static checker warnings:
> 
> drivers/staging/imx-drm/parallel-display.c:64 imx_pd_connector_get_modes() 
> error: potential null dereference 'mode'.  (drm_mode_create returns null)
> drivers/staging/imx-drm/parallel-display.c:73 imx_pd_connector_get_modes() 
> error: potential null dereference 'mode'.  (drm_mode_create returns null)
> 

Cut and paste error in the subject.

regards,
dan carpenter


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/6] imx-drm: ipu-dmfc: Check 'dmfc' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c:164 ipu_dmfc_setup_channel() warn: 
variable dereferenced before check 'dmfc' (see line 157)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Check 'dmfc' prior to setting the priv pointer

 drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c 
b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
index 98070dd..ce152d9 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
@@ -154,16 +154,18 @@ EXPORT_SYMBOL_GPL(ipu_dmfc_disable_channel);
 static int ipu_dmfc_setup_channel(struct dmfc_channel *dmfc, int slots,
int segment, int burstsize)
 {
-   struct ipu_dmfc_priv *priv = dmfc->priv;
+   struct ipu_dmfc_priv *priv;
u32 val, field;
 
+   if (!dmfc)
+   return -EINVAL;
+
+   priv = dmfc->priv;
+
dev_dbg(priv->dev,
"dmfc: using %d slots starting from segment %d for IPU 
channel %d\n",
slots, segment, dmfc->data->ipu_channel);
 
-   if (!dmfc)
-   return -EINVAL;
-
switch (slots) {
case 1:
field = DMFC_FIFO_SIZE_64;
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/6] imx-drm: imx-ldb: Check 'mode' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:109 imx_ldb_connector_get_modes() error: 
potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 drivers/staging/imx-drm/imx-ldb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/imx-drm/imx-ldb.c 
b/drivers/staging/imx-drm/imx-ldb.c
index 5168c76..abf8517 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -106,6 +106,8 @@ static int imx_ldb_connector_get_modes(struct drm_connector 
*connector)
struct drm_display_mode *mode;
 
mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
drm_mode_copy(mode, &imx_ldb_ch->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
drm_mode_probed_add(connector, mode);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 4/6] imx-drm: parallel-display: Check 'mode' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warnings:

drivers/staging/imx-drm/parallel-display.c:64 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)
drivers/staging/imx-drm/parallel-display.c:73 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Fix typo in Subject

 drivers/staging/imx-drm/parallel-display.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/imx-drm/parallel-display.c 
b/drivers/staging/imx-drm/parallel-display.c
index d610f07..08e47aa 100644
--- a/drivers/staging/imx-drm/parallel-display.c
+++ b/drivers/staging/imx-drm/parallel-display.c
@@ -61,6 +61,8 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
 
if (imxpd->mode_valid) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
drm_mode_probed_add(connector, mode);
@@ -69,6 +71,8 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
 
if (np) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
of_get_drm_display_mode(np, &imxpd->mode, OF_USE_NATIVE_MODE);
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 3/6] imx-drm: imx-ldb: Fix array length

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string 
overflow. buf_size: 16 length: 18
probably 18 is theory and not real life, but 16 is based on
theory as well.

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 drivers/staging/imx-drm/imx-ldb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-ldb.c 
b/drivers/staging/imx-drm/imx-ldb.c
index abf8517..d49dcaa5 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -332,7 +332,7 @@ static struct drm_encoder_helper_funcs 
imx_ldb_encoder_helper_funcs = {
 
 static int imx_ldb_get_clk(struct imx_ldb *ldb, int chno)
 {
-   char clkname[16];
+   char clkname[18];
 
sprintf(clkname, "di%d", chno);
ldb->clk[chno] = devm_clk_get(ldb->dev, clkname);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 6/6] imx-drm: imx-drm-core: Staticize imx_drm_find_crtc()

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-drm-core.c:89:21: warning: symbol 
'imx_drm_find_crtc' was not declared. Should it be static?

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 drivers/staging/imx-drm/imx-drm-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
b/drivers/staging/imx-drm/imx-drm-core.c
index dcba518..6b91c8e 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -86,7 +86,7 @@ static int imx_drm_driver_unload(struct drm_device *drm)
return 0;
 }
 
-struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
+static struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
 {
struct imx_drm_device *imxdrm = crtc->dev->dev_private;
unsigned i;
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 5/6] imx-drm: ipuv3-plane: Use %pad to print 'dma_addr_t'

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/ipuv3-plane.c:75:2: warning: format '%x' expects 
argument of type 'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]

Use %pad to print 'dma_addr_t'.

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 drivers/staging/imx-drm/ipuv3-plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/imx-drm/ipuv3-plane.c 
b/drivers/staging/imx-drm/ipuv3-plane.c
index 34b642a..83b6010 100644
--- a/drivers/staging/imx-drm/ipuv3-plane.c
+++ b/drivers/staging/imx-drm/ipuv3-plane.c
@@ -72,8 +72,8 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct 
drm_framebuffer *fb,
return -EFAULT;
}
 
-   dev_dbg(ipu_plane->base.dev->dev, "phys = 0x%x, x = %d, y = %d",
-   cma_obj->paddr, x, y);
+   dev_dbg(ipu_plane->base.dev->dev, "phys = %pad, x = %d, y = %d",
+   &cma_obj->paddr, x, y);
 
cpmem = ipu_get_cpmem(ipu_plane->ipu_ch);
ipu_cpmem_set_stride(cpmem, fb->pitches[0]);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems

2014-02-26 Thread Russell King - ARM Linux
On Wed, Feb 26, 2014 at 10:00:25PM +0100, Guennadi Liakhovetski wrote:
> Hi Russell
> 
> (I suspect this my email will be rejected by ALKML too like other my 
> recent emails, but at least other MLs will pick it up and individual CCs 
> too, so, if replying, maybe it would be good to keep my entire reply, all 
> the more that it's going to be very short)
> 
> On Thu, 2 Jan 2014, Russell King wrote:
> 
> > Subsystems such as ALSA, DRM and others require a single card-level
> > device structure to represent a subsystem.  However, firmware tends to
> > describe the individual devices and the connections between them.
> > 
> > Therefore, we need a way to gather up the individual component devices
> > together, and indicate when we have all the component devices.
> > 
> > We do this in DT by providing a "superdevice" node which specifies
> > the components, eg:
> > 
> > imx-drm {
> > compatible = "fsl,drm";
> > crtcs = <&ipu1>;
> > connectors = <&hdmi>;
> > };
> 
> It is a pity linux-media wasn't CC'ed and apparently V4L developers didn't 
> notice this and other related patches in a "clean up" series, and now this 
> patch is already in the mainline. But at least I'd like to ask whether the 
> bindings, defined in 
> Documentation/devicetree/bindings/media/video-interfaces.txt and 
> implemented in drivers/media/v4l2-core/v4l2-of.c have been considered for 
> this job, and - if so - why have they been found unsuitable? Wouldn't it 
> have been better to use and - if needed - extend them to cover any 
> deficiencies? Even though the implementation is currently located under 
> drivers/media/v4l2-code/ it's pretty generic and should be easily 
> transferable to a more generic location.

The component helpers have nothing to do with DT apart from solving
the problem of how to deal with subsystems which expect a single device,
but we have a group of devices and their individual drivers to cope with.
Subsystems like DRM and ALSA.

It is completely agnostic to whether you're using platform data, DT or
even ACPI - this code could *not* care less.  None of that comes anywhere
near what this patch does.  It merely provides a way to collect up
individual devices from co-operating drivers, and control their binding
such that a subsystem like DRM or ALSA can be presented with a "card"
level view of the hardware rather than a multi-device medusa with all
the buggy, racy, crap fsckage that people come up to make that kind of
thing work.

Now, as for the binding above, first, what does "eg" mean... and
secondly, how would a binding which refers to crtcs and connectors
have anything to do with ALSA?  Clearly this isn't an example of a
binding for an ALSA use, which was talked about in the very first
line of the above commit commentry.  So it's quite clear that what is
given there is an example of how it /could/ be used.

I suppose I could have instead turned imx-drm into a completely unusable
mess by not coming up with some kind of binding, and instead submitted
a whole pile of completely untested code.  Alternatively, I could've
used the OF binding as you're suggesting, but that would mean radically
changing the /existing/ bindings for the IPU as a whole - something
which others are better suited at as they have a /much/ better
understanding of the complexities of this hardware than I.

So, what I have done is implemented - for a driver in staging which is
still subject to ongoing development and non-stable DT bindings -
something which allows forward progress with a *minimum* of disruption
to the existing DT bindings for everyone, while still allowing forward
progress.

Better bindings for imx-drm are currently being worked on.  Philipp
Zabel of Pengutronix is currently looking at it, and has posted many
RFC patches on this very subject, including moving the V4L2 OF helpers
to a more suitable location.  OF people have been involved in that
discussion over the preceding weeks, and there's a working implementation
of imx-drm using these helpers from v4l2.

I'm finding people who are working in the same area and trying to get
everyone talking to each other so that we /do/ end up with a set of
bindings for the display stuff which are suitable for everyone.  Tomi
from TI has already expressed his input to this ongoing discussion.

You're welcome to get involved in those discussions too.

I hope this makes it clear, and clears up the confusion.

Thanks.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/6] imx-drm: imx-ldb: Fix array length

2014-02-26 Thread Russell King - ARM Linux
On Wed, Feb 26, 2014 at 06:44:36PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Fix the following static checker warning:
> 
> drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string 
> overflow. buf_size: 16 length: 18
> probably 18 is theory and not real life, but 16 is based on
> theory as well.

I think using snprintf() would be better...

snprintf(clkname, sizeof(clkname), "di%d", chno);

rather than increasing the buffer to hold a maximal-size decimal
integer.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


URGENT CLAIM IS MANDATORY.

2014-02-26 Thread DR.DAVID GAK

URGENT CLAIM IS MANDATORY.

M T N global Net-work Online raffle-draw Promotions.
Head Office: Cotonou Benin,
6701 eminent Road apapa Cotonou,
Benin republic,

(dr.david...@netglo.net ( office contact )

I am Dr.David Gak the International online cor-donator.

We wish you success in our M T N global Net-work Online Promotions/Email
Internet Program made today 25th February 2014 which was held on 7th
February 2014.

Your Email Address was attached to Ticket No: 91-24-23-99-51, Drew the
Lucky No: 12-29-40-46-35 + 1 Bonus 44 from 800,000 Email Addresses
consequently won in the 1st Category. You have therefore been approved to
claim a Star Prize of $2.5 million ( U S DOLLARS) in cash credited to File
No: 9-18-28 CASH  (YEAR 2014 WINNINGS).
Below is your Winning Details:


Ball No: 5-32-91-89-12
Jack No: 19-18-78-35-15
File No: 9-18-28 CASH:( 2014 WINNINGS)
Amount Won: ( $2,500,000.00 USD) Two million five hundred thousand U S
dollars.


The Validity period of the winnings is (5) Working Days, of your reply to
the Agency; hence you are expected to make your claims immediately, any
claim not made before this date will be returned as UNCLAIMED."To claim
your winning prize, you are to contact the appointed agent for the
immediate release of your winnings:


For Claiming, Urgently  contact:  Mr. Lamido Usman at ATLANTIQUE BANK OF
BENIN REPUBLIC FOR YOUR IMMEDIATE CLAIM OF YOUR FUND, contact email:
atlantiq...@yahoo.com.ph


You are advised to send the below following information to him to enable
him facilitate the release of your fund.


1. Your Full name:

2. Your Country: 

3. Contact Address:,,

4. Telephone Number:,,,

5. Fax Number: ,

6. Marital Status:

7. Occupation:,, ,,

8. Sex: 

9. Age: ,,

Congratulations'' once again from all our Staff and thank you for being
part of our Promotions Program.

Yours Truly,

Dr.David Gak.

THE INTERNATIONAL ONLINE COORDINATOR.










___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 1/6] imx-drm: ipu-dmfc: Check 'dmfc' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c:164 ipu_dmfc_setup_channel() warn: 
variable dereferenced before check 'dmfc' (see line 157)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v2:
- None
Changes since v1:
- Check 'dmfc' prior to setting the priv pointer

 drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c 
b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
index 98070dd..ce152d9 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
@@ -154,16 +154,18 @@ EXPORT_SYMBOL_GPL(ipu_dmfc_disable_channel);
 static int ipu_dmfc_setup_channel(struct dmfc_channel *dmfc, int slots,
int segment, int burstsize)
 {
-   struct ipu_dmfc_priv *priv = dmfc->priv;
+   struct ipu_dmfc_priv *priv;
u32 val, field;
 
+   if (!dmfc)
+   return -EINVAL;
+
+   priv = dmfc->priv;
+
dev_dbg(priv->dev,
"dmfc: using %d slots starting from segment %d for IPU 
channel %d\n",
slots, segment, dmfc->data->ipu_channel);
 
-   if (!dmfc)
-   return -EINVAL;
-
switch (slots) {
case 1:
field = DMFC_FIFO_SIZE_64;
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 2/6] imx-drm: imx-ldb: Check 'mode' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:109 imx_ldb_connector_get_modes() error: 
potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v2:
- None
Changes since v1:
- None

 drivers/staging/imx-drm/imx-ldb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/imx-drm/imx-ldb.c 
b/drivers/staging/imx-drm/imx-ldb.c
index 5168c76..abf8517 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -106,6 +106,8 @@ static int imx_ldb_connector_get_modes(struct drm_connector 
*connector)
struct drm_display_mode *mode;
 
mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
drm_mode_copy(mode, &imx_ldb_ch->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
drm_mode_probed_add(connector, mode);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 4/6] imx-drm: parallel-display: Check 'mode' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warnings:

drivers/staging/imx-drm/parallel-display.c:64 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)
drivers/staging/imx-drm/parallel-display.c:73 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v2:
- None
Changes since v1:
- Fix typo in Subject

 drivers/staging/imx-drm/parallel-display.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/imx-drm/parallel-display.c 
b/drivers/staging/imx-drm/parallel-display.c
index d610f07..08e47aa 100644
--- a/drivers/staging/imx-drm/parallel-display.c
+++ b/drivers/staging/imx-drm/parallel-display.c
@@ -61,6 +61,8 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
 
if (imxpd->mode_valid) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
drm_mode_probed_add(connector, mode);
@@ -69,6 +71,8 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
 
if (np) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
of_get_drm_display_mode(np, &imxpd->mode, OF_USE_NATIVE_MODE);
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 5/6] imx-drm: ipuv3-plane: Use %pad to print 'dma_addr_t'

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/ipuv3-plane.c:75:2: warning: format '%x' expects 
argument of type 'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]

Use %pad to print 'dma_addr_t'.

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v2:
- None
Changes since v1:
- None

 drivers/staging/imx-drm/ipuv3-plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/imx-drm/ipuv3-plane.c 
b/drivers/staging/imx-drm/ipuv3-plane.c
index 34b642a..83b6010 100644
--- a/drivers/staging/imx-drm/ipuv3-plane.c
+++ b/drivers/staging/imx-drm/ipuv3-plane.c
@@ -72,8 +72,8 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct 
drm_framebuffer *fb,
return -EFAULT;
}
 
-   dev_dbg(ipu_plane->base.dev->dev, "phys = 0x%x, x = %d, y = %d",
-   cma_obj->paddr, x, y);
+   dev_dbg(ipu_plane->base.dev->dev, "phys = %pad, x = %d, y = %d",
+   &cma_obj->paddr, x, y);
 
cpmem = ipu_get_cpmem(ipu_plane->ipu_ch);
ipu_cpmem_set_stride(cpmem, fb->pitches[0]);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 6/6] imx-drm: imx-drm-core: Staticize imx_drm_find_crtc()

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-drm-core.c:89:21: warning: symbol 
'imx_drm_find_crtc' was not declared. Should it be static?

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v2:
- None
Changes since v1:
- None

 drivers/staging/imx-drm/imx-drm-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
b/drivers/staging/imx-drm/imx-drm-core.c
index dcba518..6b91c8e 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -86,7 +86,7 @@ static int imx_drm_driver_unload(struct drm_device *drm)
return 0;
 }
 
-struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
+static struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
 {
struct imx_drm_device *imxdrm = crtc->dev->dev_private;
unsigned i;
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 3/6] imx-drm: imx-ldb: Fix array length

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string 
overflow. buf_size: 16 length: 18
probably 18 is theory and not real life, but 16 is based on
theory as well.

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v2:
- Use snprintf as suggested by Russell
Changes since v1:
- None

 drivers/staging/imx-drm/imx-ldb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-ldb.c 
b/drivers/staging/imx-drm/imx-ldb.c
index abf8517..195c425 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -334,7 +334,7 @@ static int imx_ldb_get_clk(struct imx_ldb *ldb, int chno)
 {
char clkname[16];
 
-   sprintf(clkname, "di%d", chno);
+   snprintf(clkname, sizeof(clkname), "di%d", chno);
ldb->clk[chno] = devm_clk_get(ldb->dev, clkname);
if (IS_ERR(ldb->clk[chno]))
return PTR_ERR(ldb->clk[chno]);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 3/6] imx-drm: imx-ldb: Fix array length

2014-02-26 Thread Fabio Estevam
On Wed, Feb 26, 2014 at 7:44 PM, Fabio Estevam  wrote:
> From: Fabio Estevam 
>
> Fix the following static checker warning:
>
> drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string 
> overflow. buf_size: 16 length: 18
> probably 18 is theory and not real life, but 16 is based on
> theory as well.
>
> Reported-by: Dan Carpenter 
> Signed-off-by: Fabio Estevam 

Ops, I should have changed the Subject.

Will send a v4 tomorrow.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 3/6] imx-drm: imx-ldb: Fix array length

2014-02-26 Thread Russell King - ARM Linux
On Wed, Feb 26, 2014 at 07:44:33PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Fix the following static checker warning:
> 
> drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string 
> overflow. buf_size: 16 length: 18
> probably 18 is theory and not real life, but 16 is based on
> theory as well.

I should've pointed out that there's also:

sprintf(clkname, "di%d_pll", chno);

just below which needs the same treatment.  Sorry.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: lustre: make functions as static

2014-02-26 Thread Daeseok Youn

These functions are only referenced in this file scope
so it can be marked static.
And remove space between function name and open parenthesis.

Signed-off-by: Daeseok Youn 
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|   70 ++--
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index 644a000..0727998 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -41,7 +41,7 @@
 #include "o2iblnd.h"
 #include 
 
-lnd_t the_o2iblnd = {
+static lnd_t the_o2iblnd = {
.lnd_type   = O2IBLND,
.lnd_startup= kiblnd_startup,
.lnd_shutdown   = kiblnd_shutdown,
@@ -53,8 +53,8 @@ lnd_t the_o2iblnd = {
 
 kib_data_t   kiblnd_data;
 
-__u32
-kiblnd_cksum (void *ptr, int nob)
+static __u32
+kiblnd_cksum(void *ptr, int nob)
 {
char  *c  = ptr;
__u32  sum = 0;
@@ -429,8 +429,8 @@ kiblnd_unlink_peer_locked (kib_peer_t *peer)
kiblnd_peer_decref(peer);
 }
 
-int
-kiblnd_get_peer_info (lnet_ni_t *ni, int index,
+static int
+kiblnd_get_peer_info(lnet_ni_t *ni, int index,
  lnet_nid_t *nidp, int *count)
 {
kib_peer_t  *peer;
@@ -468,8 +468,8 @@ kiblnd_get_peer_info (lnet_ni_t *ni, int index,
return -ENOENT;
 }
 
-void
-kiblnd_del_peer_locked (kib_peer_t *peer)
+static void
+kiblnd_del_peer_locked(kib_peer_t *peer)
 {
struct list_head   *ctmp;
struct list_head   *cnxt;
@@ -489,8 +489,8 @@ kiblnd_del_peer_locked (kib_peer_t *peer)
 * last ref on it. */
 }
 
-int
-kiblnd_del_peer (lnet_ni_t *ni, lnet_nid_t nid)
+static int
+kiblnd_del_peer(lnet_ni_t *ni, lnet_nid_t nid)
 {
LIST_HEAD(zombies);
struct list_head*ptmp;
@@ -543,8 +543,8 @@ kiblnd_del_peer (lnet_ni_t *ni, lnet_nid_t nid)
return rc;
 }
 
-kib_conn_t *
-kiblnd_get_conn_by_idx (lnet_ni_t *ni, int index)
+static kib_conn_t *
+kiblnd_get_conn_by_idx(lnet_ni_t *ni, int index)
 {
kib_peer_t  *peer;
struct list_head*ptmp;
@@ -584,16 +584,16 @@ kiblnd_get_conn_by_idx (lnet_ni_t *ni, int index)
return NULL;
 }
 
-void
-kiblnd_debug_rx (kib_rx_t *rx)
+static void
+kiblnd_debug_rx(kib_rx_t *rx)
 {
CDEBUG(D_CONSOLE, "  %p status %d msg_type %x cred %d\n",
   rx, rx->rx_status, rx->rx_msg->ibm_type,
   rx->rx_msg->ibm_credits);
 }
 
-void
-kiblnd_debug_tx (kib_tx_t *tx)
+static void
+kiblnd_debug_tx(kib_tx_t *tx)
 {
CDEBUG(D_CONSOLE, "  %p snd %d q %d w %d rc %d dl %lx "
   "cookie "LPX64" msg %s%s type %x cred %d\n",
@@ -604,8 +604,8 @@ kiblnd_debug_tx (kib_tx_t *tx)
   tx->tx_msg->ibm_type, tx->tx_msg->ibm_credits);
 }
 
-void
-kiblnd_debug_conn (kib_conn_t *conn)
+static void
+kiblnd_debug_conn(kib_conn_t *conn)
 {
struct list_head*tmp;
int i;
@@ -1039,8 +1039,8 @@ kiblnd_close_stale_conns_locked (kib_peer_t *peer,
return count;
 }
 
-int
-kiblnd_close_matching_conns (lnet_ni_t *ni, lnet_nid_t nid)
+static int
+kiblnd_close_matching_conns(lnet_ni_t *ni, lnet_nid_t nid)
 {
kib_peer_t   *peer;
struct list_head *ptmp;
@@ -1440,7 +1440,7 @@ kiblnd_find_rd_dma_mr(kib_hca_dev_t *hdev, 
kib_rdma_desc_t *rd)
return mr;
 }
 
-void
+static void
 kiblnd_destroy_fmr_pool(kib_fmr_pool_t *pool)
 {
LASSERT (pool->fpo_map_count == 0);
@@ -1454,7 +1454,7 @@ kiblnd_destroy_fmr_pool(kib_fmr_pool_t *pool)
LIBCFS_FREE(pool, sizeof(kib_fmr_pool_t));
 }
 
-void
+static void
 kiblnd_destroy_fmr_pool_list(struct list_head *head)
 {
kib_fmr_pool_t *pool;
@@ -1480,7 +1480,7 @@ static int kiblnd_fmr_flush_trigger(int ncpts)
return max(IBLND_FMR_POOL_FLUSH, size);
 }
 
-int
+static int
 kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
 {
/* FMR pool for RDMA */
@@ -1719,7 +1719,7 @@ kiblnd_init_pool(kib_poolset_t *ps, kib_pool_t *pool, int 
size)
pool->po_size = size;
 }
 
-void
+static void
 kiblnd_destroy_pool_list(struct list_head *head)
 {
kib_pool_t *pool;
@@ -2192,7 +2192,7 @@ kiblnd_tx_init(kib_pool_t *pool, struct list_head *node)
tx->tx_cookie = tps->tps_next_tx_cookie ++;
 }
 
-void
+static void
 kiblnd_net_fini_pools(kib_net_t *net)
 {
int i;
@@ -2234,7 +2234,7 @@ kiblnd_net_fini_pools(kib_net_t *net)
}
 }
 
-int
+static int
 kiblnd_net_init_pools(kib_net_t *net, __u32 *cpts, int ncpts)
 {
unsigned long   flags;
@@ -2408,7 +2408,7 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
return -EINVAL;
 }
 
-void
+static void
 kiblnd_hdev_cleanup_mrs(kib_hca_dev_t *hdev)
 {
int i;
@@ -2442,7 +2442,7 @@ kiblnd_hdev_destroy(kib_hca_dev_t *hdev)
LIBCFS_FREE(hdev, sizeof(*

[PATCH v4 4/6] imx-drm: parallel-display: Check 'mode' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warnings:

drivers/staging/imx-drm/parallel-display.c:64 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)
drivers/staging/imx-drm/parallel-display.c:73 imx_pd_connector_get_modes() 
error: potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v3:
- None
Changes since v2:
- None
Changes since v1:
- Fix typo in Subject

 drivers/staging/imx-drm/parallel-display.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/imx-drm/parallel-display.c 
b/drivers/staging/imx-drm/parallel-display.c
index d610f07..08e47aa 100644
--- a/drivers/staging/imx-drm/parallel-display.c
+++ b/drivers/staging/imx-drm/parallel-display.c
@@ -61,6 +61,8 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
 
if (imxpd->mode_valid) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
drm_mode_probed_add(connector, mode);
@@ -69,6 +71,8 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
 
if (np) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
of_get_drm_display_mode(np, &imxpd->mode, OF_USE_NATIVE_MODE);
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 1/6] imx-drm: ipu-dmfc: Check 'dmfc' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c:164 ipu_dmfc_setup_channel() warn: 
variable dereferenced before check 'dmfc' (see line 157)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v3:
- None
Changes since v2:
- None
Changes since v1:
- Check 'dmfc' prior to setting the priv pointer

 drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c 
b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
index 98070dd..ce152d9 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
@@ -154,16 +154,18 @@ EXPORT_SYMBOL_GPL(ipu_dmfc_disable_channel);
 static int ipu_dmfc_setup_channel(struct dmfc_channel *dmfc, int slots,
int segment, int burstsize)
 {
-   struct ipu_dmfc_priv *priv = dmfc->priv;
+   struct ipu_dmfc_priv *priv;
u32 val, field;
 
+   if (!dmfc)
+   return -EINVAL;
+
+   priv = dmfc->priv;
+
dev_dbg(priv->dev,
"dmfc: using %d slots starting from segment %d for IPU 
channel %d\n",
slots, segment, dmfc->data->ipu_channel);
 
-   if (!dmfc)
-   return -EINVAL;
-
switch (slots) {
case 1:
field = DMFC_FIFO_SIZE_64;
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 2/6] imx-drm: imx-ldb: Check 'mode' pointer first

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:109 imx_ldb_connector_get_modes() error: 
potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v3:
- None
Changes since v2:
- None
Changes since v1:
- None

 drivers/staging/imx-drm/imx-ldb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/imx-drm/imx-ldb.c 
b/drivers/staging/imx-drm/imx-ldb.c
index 5168c76..abf8517 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -106,6 +106,8 @@ static int imx_ldb_connector_get_modes(struct drm_connector 
*connector)
struct drm_display_mode *mode;
 
mode = drm_mode_create(connector->dev);
+   if (!mode)
+   return -EINVAL;
drm_mode_copy(mode, &imx_ldb_ch->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
drm_mode_probed_add(connector, mode);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 3/6] imx-drm: imx-ldb: Use snprintf()

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Use snprintf() in order to fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string 
overflow. buf_size: 16 length: 18
probably 18 is theory and not real life, but 16 is based on
theory as well.

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v3:
- Fix Subject
- Also use snprintf in the other ocurrence
Changes since v2:
- Use snprintf as suggested by Russell
Changes since v1:
- None

 drivers/staging/imx-drm/imx-ldb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-ldb.c 
b/drivers/staging/imx-drm/imx-ldb.c
index abf8517..daa54df 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -334,12 +334,12 @@ static int imx_ldb_get_clk(struct imx_ldb *ldb, int chno)
 {
char clkname[16];
 
-   sprintf(clkname, "di%d", chno);
+   snprintf(clkname, sizeof(clkname), "di%d", chno);
ldb->clk[chno] = devm_clk_get(ldb->dev, clkname);
if (IS_ERR(ldb->clk[chno]))
return PTR_ERR(ldb->clk[chno]);
 
-   sprintf(clkname, "di%d_pll", chno);
+   snprintf(clkname, sizeof(clkname), "di%d_pll", chno);
ldb->clk_pll[chno] = devm_clk_get(ldb->dev, clkname);
 
return PTR_ERR_OR_ZERO(ldb->clk_pll[chno]);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 6/6] imx-drm: imx-drm-core: Staticize imx_drm_find_crtc()

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/imx-drm-core.c:89:21: warning: symbol 
'imx_drm_find_crtc' was not declared. Should it be static?

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v3:
- None
Changes since v2:
- None
Changes since v1:
- None

 drivers/staging/imx-drm/imx-drm-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
b/drivers/staging/imx-drm/imx-drm-core.c
index dcba518..6b91c8e 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -86,7 +86,7 @@ static int imx_drm_driver_unload(struct drm_device *drm)
return 0;
 }
 
-struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
+static struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
 {
struct imx_drm_device *imxdrm = crtc->dev->dev_private;
unsigned i;
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 5/6] imx-drm: ipuv3-plane: Use %pad to print 'dma_addr_t'

2014-02-26 Thread Fabio Estevam
From: Fabio Estevam 

Fix the following static checker warning:

drivers/staging/imx-drm/ipuv3-plane.c:75:2: warning: format '%x' expects 
argument of type 'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]

Use %pad to print 'dma_addr_t'.

Reported-by: Dan Carpenter 
Signed-off-by: Fabio Estevam 
---
Changes since v3:
- None
Changes since v2:
- None
Changes since v1:
- None

 drivers/staging/imx-drm/ipuv3-plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/imx-drm/ipuv3-plane.c 
b/drivers/staging/imx-drm/ipuv3-plane.c
index 34b642a..83b6010 100644
--- a/drivers/staging/imx-drm/ipuv3-plane.c
+++ b/drivers/staging/imx-drm/ipuv3-plane.c
@@ -72,8 +72,8 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct 
drm_framebuffer *fb,
return -EFAULT;
}
 
-   dev_dbg(ipu_plane->base.dev->dev, "phys = 0x%x, x = %d, y = %d",
-   cma_obj->paddr, x, y);
+   dev_dbg(ipu_plane->base.dev->dev, "phys = %pad, x = %d, y = %d",
+   &cma_obj->paddr, x, y);
 
cpmem = ipu_get_cpmem(ipu_plane->ipu_ch);
ipu_cpmem_set_stride(cpmem, fb->pitches[0]);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel