[PATCH 11/11] staging: cxt1e1: linux.c: Return negative error codes

2013-09-26 Thread Sachin Kamat
Return negative error codes as is followed in the rest of the
kernel.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/linux.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c
index 598e6ba..9b48373 100644
--- a/drivers/staging/cxt1e1/linux.c
+++ b/drivers/staging/cxt1e1/linux.c
@@ -230,7 +230,7 @@ c4_wq_port_init (mpi_t *pi)
 __func__, name, pi->portnum); /* RLD DEBUG */
 #endif
 if (!(pi->wq_port = create_singlethread_workqueue (name)))
-return ENOMEM;
+return -ENOMEM;
 return 0;   /* success */
 }
 
-- 
1.7.9.5

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


[PATCH 07/11] staging: cxt1e1: sbecrc.c: Use NULL instead of 0

2013-09-26 Thread Sachin Kamat
Pointers should be assigned NULL instead of 0.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/sbecrc.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/cxt1e1/sbecrc.c b/drivers/staging/cxt1e1/sbecrc.c
index 87512a5..81fa8a3 100644
--- a/drivers/staging/cxt1e1/sbecrc.c
+++ b/drivers/staging/cxt1e1/sbecrc.c
@@ -88,7 +88,7 @@ sbeCrc(u_int8_t *buffer,  /* data buffer to crc */
u_int32_t initialCrc,  /* starting CRC */
u_int32_t *result)
 {
-   u_int32_t *tbl = 0;
+   u_int32_t *tbl = NULL;
u_int32_t  temp1, temp2, crc;
 
/*
@@ -102,7 +102,7 @@ sbeCrc(u_int8_t *buffer,  /* data buffer to crc */
genCrcTable(tbl);
 #else
tbl = (u_int32_t *) OS_kmalloc(CRC_TABLE_ENTRIES * 
sizeof(u_int32_t));
-   if (tbl == 0) {
+   if (!tbl) {
*result = 0;   /* dummy up return value due to malloc
* failure */
return;
-- 
1.7.9.5

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


[PATCH 03/11] staging: cxt1e1: sbeid.c: Use NULL instead of 0

2013-09-26 Thread Sachin Kamat
Pointers should be assigned NULL instead of 0.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/sbeid.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/cxt1e1/sbeid.c b/drivers/staging/cxt1e1/sbeid.c
index 791993f..6ec51bc 100644
--- a/drivers/staging/cxt1e1/sbeid.c
+++ b/drivers/staging/cxt1e1/sbeid.c
@@ -22,7 +22,7 @@
 char   *
 sbeid_get_bdname (ci_t *ci)
 {
-char   *np = 0;
+char   *np = NULL;
 
 switch (ci->brd_id)
 {
-- 
1.7.9.5

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


[PATCH 09/11] staging: cxt1e1: musycc.c: Return negative error codes

2013-09-26 Thread Sachin Kamat
Return negative error codes as is followed in the rest of the
kernel.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/musycc.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/cxt1e1/musycc.c b/drivers/staging/cxt1e1/musycc.c
index a2a2af1..0ba8c3a 100644
--- a/drivers/staging/cxt1e1/musycc.c
+++ b/drivers/staging/cxt1e1/musycc.c
@@ -746,7 +746,7 @@ musycc_init(ci_t *ci)
 
 regaddr = OS_kmalloc((INT_QUEUE_SIZE + 1) * sizeof(u_int32_t));
 if (!regaddr)
-   return ENOMEM;
+   return -ENOMEM;
 ci->iqd_p_saved = regaddr;  /* save orig value for free's usage */
 ci->iqd_p = (u_int32_t *) ((unsigned long) (regaddr + INT_QUEUE_BOUNDARY - 
1) &
   (~(INT_QUEUE_BOUNDARY - 1)));/* this 
calculates
@@ -772,7 +772,7 @@ musycc_init(ci_t *ci)
OS_kfree(pi->reg);
pi->reg = NULL;
}
-   return ENOMEM;
+   return -ENOMEM;
}
pi->regram_saved = regaddr; /* save orig value for free's usage */
pi->regram = (struct musycc_groupr *) ((unsigned long) (regaddr + 
GROUP_BOUNDARY - 1) &
-- 
1.7.9.5

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


[PATCH 06/11] staging: cxt1e1: hwprobe.c: Use NULL instead of 0

2013-09-26 Thread Sachin Kamat
Pointers should be assigned NULL instead of 0.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/hwprobe.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 53e9237..2f4f051 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -157,7 +157,7 @@ prep_hdw_info (void)
 hi->pci_slot = 0xff;
 hi->pci_pin[0] = 0;
 hi->pci_pin[1] = 0;
-hi->ndev = 0;
+hi->ndev = NULL;
 hi->addr[0] = 0L;
 hi->addr[1] = 0L;
 hi->addr_mapped[0] = 0L;
@@ -328,7 +328,7 @@ c4hw_attach_all (void)
 break;
 for (j = 0; j < 2; j++)
 {
-if (request_mem_region (hi->addr[j], hi->len[j], hi->devname) == 0)
+   if (!request_mem_region (hi->addr[j], hi->len[j], hi->devname))
 {
 pr_warning("%s: memory in use, addr=0x%lx, len=0x%lx ?\n",
hi->devname, hi->addr[j], hi->len[j]);
-- 
1.7.9.5

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


[PATCH 01/11] staging: cxt1e1: musycc.c: Use NULL instead of 0

2013-09-26 Thread Sachin Kamat
Pointers should be assigned NULL instead of 0.

Signed-off-by: Sachin Kamat 
---
Most of the patches in this series will give checkpatch errors related
to spacing and indentation. This is because the driver does not follow
the spacing/indentation guidelines provided for the kernel. Fixing the
whitespace issues for this driver should be taken up as a separate
exercise, IMHO.
---

 drivers/staging/cxt1e1/musycc.c |   28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/cxt1e1/musycc.c b/drivers/staging/cxt1e1/musycc.c
index 52b6d7f..a2a2af1 100644
--- a/drivers/staging/cxt1e1/musycc.c
+++ b/drivers/staging/cxt1e1/musycc.c
@@ -745,7 +745,7 @@ musycc_init(ci_t *ci)
 #define INT_QUEUE_BOUNDARY  4
 
 regaddr = OS_kmalloc((INT_QUEUE_SIZE + 1) * sizeof(u_int32_t));
-if (regaddr == 0)
+if (!regaddr)
return ENOMEM;
 ci->iqd_p_saved = regaddr;  /* save orig value for free's usage */
 ci->iqd_p = (u_int32_t *) ((unsigned long) (regaddr + INT_QUEUE_BOUNDARY - 
1) &
@@ -766,11 +766,11 @@ musycc_init(ci_t *ci)
 #define GROUP_BOUNDARY   0x800
 
regaddr = OS_kmalloc(sizeof(struct musycc_groupr) + GROUP_BOUNDARY);
-   if (regaddr == 0) {
+   if (!regaddr) {
for (gchan = 0; gchan < i; gchan++) {
pi = &ci->port[gchan];
OS_kfree(pi->reg);
-   pi->reg = 0;
+   pi->reg = NULL;
}
return ENOMEM;
}
@@ -839,12 +839,12 @@ musycc_bh_tx_eom(mpi_t *pi, int gchan)
 volatile u_int32_t status;
 
 ch = pi->chan[gchan];
-if (ch == 0 || ch->state != UP) {
+if (!ch || ch->state != UP) {
if (cxt1e1_log_level >= LOG_ERROR)
pr_info("%s: intr: xmit EOM on uninitialized channel %d\n",
pi->up->devname, gchan);
 }
-if (ch == 0 || ch->mdt == 0)
+if (!ch || !ch->mdt)
return; /* note: mdt==0 implies a malloc()
 * failure w/in chan_up() routine */
 
@@ -907,7 +907,7 @@ musycc_bh_tx_eom(mpi_t *pi, int gchan)
ch->txd_irq_srv = md->snext;
 
md->data = 0;
-   if (md->mem_token != 0) {
+   if (md->mem_token)  {
/* upcount channel */
atomic_sub(OS_mem_token_tlen(md->mem_token), &ch->tx_pending);
/* upcount card */
@@ -931,7 +931,7 @@ musycc_bh_tx_eom(mpi_t *pi, int gchan)
 #endif  /*** CONFIG_SBE_WAN256T3_NCOMM ***/
 
OS_mem_token_free_irq(md->mem_token);
-   md->mem_token = 0;
+   md->mem_token = NULL;
}
md->status = 0;
 #ifdef RLD_TXFULL_DEBUG
@@ -1012,13 +1012,13 @@ musycc_bh_rx_eom(mpi_t *pi, int gchan)
 u_int32_t   error;
 
 ch = pi->chan[gchan];
-if (ch == 0 || ch->state != UP) {
+if (!ch || ch->state != UP) {
if (cxt1e1_log_level > LOG_ERROR)
pr_info("%s: intr: receive EOM on uninitialized channel %d\n",
pi->up->devname, gchan);
return;
 }
-if (ch->mdr == 0)
+if (!ch->mdr)
return; /* can this happen ? */
 
 for (;;) {
@@ -1566,18 +1566,18 @@ musycc_chan_down(ci_t *dummy, int channum)
 pi->regram->rmp[gchan] = 0;
 FLUSH_MEM_WRITE();
 for (i = 0; i < ch->txd_num; i++)
-   if (ch->mdt[i].mem_token != 0)
+   if (ch->mdt[i].mem_token)
OS_mem_token_free(ch->mdt[i].mem_token);
 
 for (i = 0; i < ch->rxd_num; i++)
-   if (ch->mdr[i].mem_token != 0)
+   if (ch->mdr[i].mem_token)
OS_mem_token_free(ch->mdr[i].mem_token);
 
 OS_kfree(ch->mdr);
-ch->mdr = 0;
+ch->mdr = NULL;
 ch->rxd_num = 0;
 OS_kfree(ch->mdt);
-ch->mdt = 0;
+ch->mdt = NULL;
 ch->txd_num = 0;
 
 musycc_update_timeslots(pi);
@@ -1746,7 +1746,7 @@ musycc_start_xmit(ci_t *ci, int channum, void *mem_token)
 #endif
u |= (PADFILL_ENABLE | (ch->p.pad_fill_count << EXTRA_FLAGS));
}
-   md->mem_token = len ? 0 : mem_token;/* Fill in mds on last
+   md->mem_token = len ? NULL : mem_token;/* Fill in mds on last
 * segment, others set ZERO
 * so that entire token is
 * removed ONLY when ALL
-- 
1.7.9.5

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


[PATCH 04/11] staging: cxt1e1: linux.c: Use NULL instead of 0

2013-09-26 Thread Sachin Kamat
Pointers should be assigned NULL instead of 0.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/linux.c |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c
index 142691c..598e6ba 100644
--- a/drivers/staging/cxt1e1/linux.c
+++ b/drivers/staging/cxt1e1/linux.c
@@ -133,7 +133,7 @@ getuserbychan (int channum)
 mch_t  *ch;
 
 ch = c4_find_chan (channum);
-return ch ? ch->user : 0;
+return ch ? ch->user : NULL;
 }
 
 
@@ -245,7 +245,7 @@ c4_wq_port_cleanup (mpi_t *pi)
 {
 destroy_workqueue (pi->wq_port);/* this also calls
  * flush_workqueue() */
-pi->wq_port = 0;
+pi->wq_port = NULL;
 }
 }
 
@@ -420,7 +420,7 @@ create_chan (struct net_device *ndev, ci_t *ci,
 int ret;
 
 if (c4_find_chan (cp->channum))
-return 0;   /* channel already exists */
+return NULL;   /* channel already exists */
 
 {
 struct c4_priv *priv;
@@ -430,14 +430,14 @@ create_chan (struct net_device *ndev, ci_t *ci,
 if (!priv)
 {
 pr_warning("%s: no memory for net_device !\n", ci->devname);
-return 0;
+   return NULL;
 }
 dev = alloc_hdlcdev (priv);
 if (!dev)
 {
 pr_warning("%s: no memory for hdlc_device !\n", ci->devname);
 OS_kfree (priv);
-return 0;
+   return NULL;
 }
 priv->ci = ci;
 priv->channum = cp->channum;
@@ -496,7 +496,7 @@ create_chan (struct net_device *ndev, ci_t *ci,
 pr_info("%s: create_chan[%d] registration error = %d.\n",
 ci->devname, cp->channum, ret);
 free_netdev (dev);  /* cleanup */
-return 0;   /* failed to register */
+   return NULL;/* failed to register */
 }
 return dev;
 }
@@ -744,7 +744,7 @@ do_deluser (struct net_device *ndev, int lockit)
 ch = c4_find_chan (channum);
 if (ch == NULL)
 return -ENOENT;
-ch->user = 0;   /* will be freed, below */
+   ch->user = NULL;/* will be freed, below */
 }
 
 if (lockit)
@@ -959,7 +959,7 @@ c4_add_dev (hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
 {
 pr_warning("%s: no memory for struct net_device !\n", hi->devname);
 error_flag = ENOMEM;
-return 0;
+   return NULL;
 }
 ci = (ci_t *)(netdev_priv(ndev));
 ndev->irq = irq0;
@@ -970,7 +970,7 @@ c4_add_dev (hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
 c4_list = ci;
 ci->brdno = ci->next ? ci->next->brdno + 1 : 0;
 
-if (CI == 0)
+if (!CI)
 CI = ci;/* DEBUG, only board 0 usage */
 
 strcpy (ci->devname, hi->devname);
@@ -996,7 +996,7 @@ c4_add_dev (hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
 OS_kfree (netdev_priv(ndev));
 OS_kfree (ndev);
 error_flag = ENODEV;
-return 0;
+   return NULL;
 }
 /*
  *  int request_irq(unsigned int irq,
@@ -1022,7 +1022,7 @@ c4_add_dev (hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
 OS_kfree (netdev_priv(ndev));
 OS_kfree (ndev);
 error_flag = EIO;
-return 0;
+   return NULL;
 }
 #ifdef CONFIG_SBE_PMCC4_NCOMM
 if (request_irq (irq1, &c4_ebus_interrupt, IRQF_SHARED, ndev->name, ndev))
@@ -1033,7 +1033,7 @@ c4_add_dev (hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
 OS_kfree (netdev_priv(ndev));
 OS_kfree (ndev);
 error_flag = EIO;
-return 0;
+   return NULL;
 }
 #endif
 
@@ -1091,7 +1091,7 @@ c4_add_dev (hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
 free_irq (irq0, ndev);
 OS_kfree (netdev_priv(ndev));
 OS_kfree (ndev);
-return 0;   /* failure, error_flag is set */
+   return NULL;/* failure, error_flag is set */
 }
 return ndev;
 }
-- 
1.7.9.5

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


[PATCH 10/11] staging: cxt1e1: hwprobe.c: Return negative error codes

2013-09-26 Thread Sachin Kamat
Return negative error codes as is followed in the rest of the
kernel.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/hwprobe.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 2f4f051..02b4f8f 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -309,7 +309,7 @@ c4hw_attach_all (void)
 if (!found)
 {
 pr_warning("No boards found\n");
-return ENODEV;
+return -ENODEV;
 }
 /* sanity check for consistent hardware found */
 for (i = 0, hi = hdw_info; i < MAX_BOARDS; i++, hi++)
@@ -318,7 +318,7 @@ c4hw_attach_all (void)
 {
 pr_warning("%s: something very wrong with pci_get_device\n",
hi->devname);
-return EIO;
+return -EIO;
 }
 }
 /* bring board's memory regions on/line */
@@ -333,7 +333,7 @@ c4hw_attach_all (void)
 pr_warning("%s: memory in use, addr=0x%lx, len=0x%lx ?\n",
hi->devname, hi->addr[j], hi->len[j]);
 cleanup_ioremap ();
-return ENOMEM;
+return -ENOMEM;
 }
 hi->addr_mapped[j] = (unsigned long) ioremap (hi->addr[j], 
hi->len[j]);
 if (!hi->addr_mapped[j])
@@ -341,7 +341,7 @@ c4hw_attach_all (void)
 pr_warning("%s: ioremap fails, addr=0x%lx, len=0x%lx ?\n",
hi->devname, hi->addr[j], hi->len[j]);
 cleanup_ioremap ();
-return ENOMEM;
+return -ENOMEM;
 }
 #ifdef SBE_MAP_DEBUG
 pr_warning("%s: io remapped from phys %x to virt %x\n",
@@ -365,7 +365,7 @@ c4hw_attach_all (void)
hi->devname, i, hi->pci_slot);
 cleanup_devs ();
 cleanup_ioremap ();
-return EIO;
+return -EIO;
 }
 pci_set_master (hi->pdev[0]);
 pci_set_master (hi->pdev[1]);
-- 
1.7.9.5

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


[PATCH 02/11] staging: cxt1e1: sbecom_inline_linux.h: Return NULL instead of 0

2013-09-26 Thread Sachin Kamat
Functions returning pointer should return NULL instead of 0.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/sbecom_inline_linux.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/cxt1e1/sbecom_inline_linux.h 
b/drivers/staging/cxt1e1/sbecom_inline_linux.h
index 3c6d1c0..ba3ff3e 100644
--- a/drivers/staging/cxt1e1/sbecom_inline_linux.h
+++ b/drivers/staging/cxt1e1/sbecom_inline_linux.h
@@ -73,7 +73,7 @@ OS_mem_token_alloc (size_t size)
 if (!skb)
 {
 //pr_warning("no mem in OS_mem_token_alloc !\n");
-return 0;
+return NULL;
 }
 return skb;
 }
@@ -103,7 +103,7 @@ OS_mem_token_data (void *token)
 static inline void *
 OS_mem_token_next (void *token)
 {
-return 0;
+return NULL;
 }
 
 
-- 
1.7.9.5

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


[PATCH 05/11] staging: cxt1e1: sbeproc.c: Use NULL instead of 0

2013-09-26 Thread Sachin Kamat
Pointers should be assigned NULL instead of 0.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/sbeproc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/cxt1e1/sbeproc.c b/drivers/staging/cxt1e1/sbeproc.c
index 9361dd8..353c001 100644
--- a/drivers/staging/cxt1e1/sbeproc.c
+++ b/drivers/staging/cxt1e1/sbeproc.c
@@ -44,7 +44,7 @@ void sbecom_proc_brd_cleanup(ci_t *ci)
 static void sbecom_proc_get_brdinfo(ci_t *ci, struct sbe_brd_info *bip)
 {
hdw_info_t *hi = &hdw_info[ci->brdno];
-   u_int8_t *bsn = 0;
+   u_int8_t *bsn = NULL;
 
switch (hi->promfmt)
{
-- 
1.7.9.5

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


[PATCH 08/11] staging: cxt1e1: pmcc4_drv.c: Use NULL instead of 0

2013-09-26 Thread Sachin Kamat
Pointers should be assigned NULL instead of 0.

Signed-off-by: Sachin Kamat 
---
 drivers/staging/cxt1e1/pmcc4_drv.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/cxt1e1/pmcc4_drv.c 
b/drivers/staging/cxt1e1/pmcc4_drv.c
index 2383c60..4028ea1 100644
--- a/drivers/staging/cxt1e1/pmcc4_drv.c
+++ b/drivers/staging/cxt1e1/pmcc4_drv.c
@@ -70,7 +70,7 @@ extern void *memset (void *s, int c, size_t n);
 #endif
 
 int drvr_state = SBE_DRVR_INIT;
-ci_t   *c4_list = 0;
+ci_t   *c4_list = NULL;
 ci_t   *CI; /* dummy pointer to board ZEROE's data -
  * DEBUG USAGE */
 
@@ -119,7 +119,7 @@ c4_find_chan (int channum)
 return ch;
 }
 }
-return 0;
+return NULL;
 }
 
 
@@ -145,7 +145,7 @@ c4_new (void *hi)
 pr_warning("failed CI malloc, size %u.\n",
(unsigned int) sizeof (ci_t));
 
-if (CI == 0)
+if (!CI)
 CI = ci;/* DEBUG, only board 0 usage */
 return ci;
 }
@@ -831,7 +831,7 @@ c4_musycc_rw (ci_t *ci, struct c4_musycc_param *mcp)
 {
 mpi_t  *pi;
 volatile u_int32_t *dph;/* hardware implemented register */
-u_int32_t  *dpr = 0;/* RAM image of registers for group command
+u_int32_t *dpr = NULL; /* RAM image of registers for group command
  * usage */
 int offset = mcp->offset % 0x800;   /* group relative address
  * offset, mcp->portnum is
@@ -1060,7 +1060,7 @@ c4_new_chan (ci_t *ci, int portnum, int channum, void 
*user)
 }
 
 /* save off interface assignments which bound a board */
-if (ci->first_if == 0)  /* first channel registered is assumed to
+if (!ci->first_if) /* first channel registered is assumed to
  * be the lowest channel */
 {
 ci->first_if = ci->last_if = user;
@@ -1392,7 +1392,7 @@ c4_chan_up (ci_t *ci, int channum)
 md->status = HOST_TX_OWNED; /* Host owns TX descriptor ** CODING
  * NOTE: HOST_TX_OWNED = 0 so no need to
  * byteSwap */
-md->mem_token = 0;
+md->mem_token = NULL;
 md->data = 0;
 if (i == (txnum - 1))
 {
@@ -1448,10 +1448,10 @@ errfree:
 OS_mem_token_free (ch->mdr[i].mem_token);
 }
 OS_kfree (ch->mdt);
-ch->mdt = 0;
+ch->mdt = NULL;
 ch->txd_num = 0;
 OS_kfree (ch->mdr);
-ch->mdr = 0;
+ch->mdr = NULL;
 ch->rxd_num = 0;
 ch->state = DOWN;
 return ENOBUFS;
-- 
1.7.9.5

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


Re: [PATCH 31/51] DMA-API: media: omap3isp: use dma_coerce_mask_and_coherent()

2013-09-26 Thread Laurent Pinchart
Hi Russell,

Thank you for the patch.

On Thursday 19 September 2013 22:56:02 Russell King wrote:
> The code sequence:
>   isp->raw_dmamask = DMA_BIT_MASK(32);
>   isp->dev->dma_mask = &isp->raw_dmamask;
>   isp->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> bypasses the architectures check on the DMA mask.  It can be replaced
> with dma_coerce_mask_and_coherent(), avoiding the direct initialization
> of this mask.
> 
> Signed-off-by: Russell King 

Acked-by: Laurent Pinchart 

> ---
>  drivers/media/platform/omap3isp/isp.c |6 +++---
>  drivers/media/platform/omap3isp/isp.h |3 ---
>  2 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index df3a0ec..1c36080 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -2182,9 +2182,9 @@ static int isp_probe(struct platform_device *pdev)
>   isp->pdata = pdata;
>   isp->ref_count = 0;
> 
> - isp->raw_dmamask = DMA_BIT_MASK(32);
> - isp->dev->dma_mask = &isp->raw_dmamask;
> - isp->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(isp->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
> 
>   platform_set_drvdata(pdev, isp);
> 
> diff --git a/drivers/media/platform/omap3isp/isp.h
> b/drivers/media/platform/omap3isp/isp.h index cd3eff4..ce65d3a 100644
> --- a/drivers/media/platform/omap3isp/isp.h
> +++ b/drivers/media/platform/omap3isp/isp.h
> @@ -152,7 +152,6 @@ struct isp_xclk {
>   * @mmio_base_phys: Array with physical L4 bus addresses for ISP register
>   *  regions.
>   * @mmio_size: Array with ISP register regions size in bytes.
> - * @raw_dmamask: Raw DMA mask
>   * @stat_lock: Spinlock for handling statistics
>   * @isp_mutex: Mutex for serializing requests to ISP.
>   * @crashed: Bitmask of crashed entities (indexed by entity ID)
> @@ -190,8 +189,6 @@ struct isp_device {
>   unsigned long mmio_base_phys[OMAP3_ISP_IOMEM_LAST];
>   resource_size_t mmio_size[OMAP3_ISP_IOMEM_LAST];
> 
> - u64 raw_dmamask;
> -
>   /* ISP Obj */
>   spinlock_t stat_lock;   /* common lock for statistic drivers */
>   struct mutex isp_mutex; /* For handling ref_count field */
-- 
Regards,

Laurent Pinchart

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


Award Claims

2013-09-26 Thread Aaward
Your Email Id Have Won 1,000,000.00 GBP From Chevrolet Company Promo Award 
2013.Details required:Full Name,Address,Country/Nationality,Occupation,
Age/Sex,Tel,Identity Proof.(Winning SERIAL NO: 81809/co/npo/uk)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 5/5] staging: dgap: tty.c: removes smatch warning "unsigned '--un->un_open_count' is never less than zero"

2013-09-26 Thread Lidza Louina
On Thu, Sep 26, 2013 at 6:22 AM, Dan Carpenter  wrote:
> On Wed, Sep 25, 2013 at 07:08:54PM -0400, Lidza Louina wrote:
>> This patch removes this smatch warning:
>> unsigned '--un->un_open_count' is never less than zero
>>
>> The code decremented the un_open_count variable
>> and tested to see if it was less than zero. Because
>> un_open_count is unsigned and can't be below zero,
>> this test didn't work.
>>
>> Signed-off-by: Lidza Louina 
>> ---
>>  drivers/staging/dgap/dgap_tty.c | 8 +++-
>>  1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/staging/dgap/dgap_tty.c 
>> b/drivers/staging/dgap/dgap_tty.c
>> index 3e12ddb..c0258db 100644
>> --- a/drivers/staging/dgap/dgap_tty.c
>> +++ b/drivers/staging/dgap/dgap_tty.c
>> @@ -1446,13 +1446,11 @@ static void dgap_tty_close(struct tty_struct *tty, 
>> struct file *file)
>>   APR(("tty->count is 1, un open count is %d\n", 
>> un->un_open_count));
>>   un->un_open_count = 1;
>>   }
>> -
>> - if (--un->un_open_count < 0) {
>> + if (un->un_open_count == 0) {
>>   APR(("bad serial port open count of %d\n", un->un_open_count));
>> - un->un_open_count = 0;
>> + un->un_open_count = 1;
>>   }
>> -
>> - ch->ch_open_count--;
>
> Wait?  Don't delete this line.  We need to decrement both.
>
>> + un->un_open_count--;
>
> regards,
> dan carpenter
>
>

Ahh, I see. I'll resend this patch.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 4/5] staging: dgap: tty.c: changes error handing to tty driver allocations

2013-09-26 Thread Lidza Louina
On Thu, Sep 26, 2013 at 6:19 AM, Dan Carpenter  wrote:
> This one is not right.
>
> On Wed, Sep 25, 2013 at 07:08:53PM -0400, Lidza Louina wrote:
>> This patch changes error handling to the
>> tty_driver allocations in dgap_tty_register.
>>
>> Before, it didn't handle the possibility of an
>> alloc_tty_driver failure. This patch makes
>> dgap_register_driver return -ENOMEM if that fails.
>>
>> This patch also adds handling to the possibility that
>> the brd->SerialDriver->ttys or brd->PrintDriver->ttys
>> allocation will fail. It now calls put_tty_driver on
>> that driver after it fails and returns -ENOMEM.
>>
>> Signed-off-by: Lidza Louina 
>> ---
>>  drivers/staging/dgap/dgap_tty.c | 26 ++
>>  1 file changed, 18 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/staging/dgap/dgap_tty.c 
>> b/drivers/staging/dgap/dgap_tty.c
>> index 59fda2e..3e12ddb 100644
>> --- a/drivers/staging/dgap/dgap_tty.c
>> +++ b/drivers/staging/dgap/dgap_tty.c
>> @@ -220,6 +220,8 @@ int dgap_tty_register(struct board_t *brd)
>>   DPR_INIT(("tty_register start"));
>>
>>   brd->SerialDriver = alloc_tty_driver(MAXPORTS);
>> + if (!brd->SerialDriver)
>> + return -ENOMEM;
>>
>>   snprintf(brd->SerialName, MAXTTYNAMELEN, "tty_dgap_%d_", 
>> brd->boardnum);
>>   brd->SerialDriver->name = brd->SerialName;
>> @@ -234,9 +236,10 @@ int dgap_tty_register(struct board_t *brd)
>>
>>   /* The kernel wants space to store pointers to tty_structs */
>>   brd->SerialDriver->ttys = dgap_driver_kzmalloc(MAXPORTS * 
>> sizeof(struct tty_struct *), GFP_KERNEL);
>> - if (!brd->SerialDriver->ttys)
>> - return(-ENOMEM);
>> -
>> + if (!brd->SerialDriver->ttys){
>> + rc = -ENOMEM;
>> + goto err_put_tty_serial;
>> + }
>>  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
>>   brd->SerialDriver->refcount = brd->TtyRefCnt;
>>  #endif
>> @@ -253,6 +256,8 @@ int dgap_tty_register(struct board_t *brd)
>>* we are when we get into the dgap_tty_open() routine.
>>*/
>>   brd->PrintDriver = alloc_tty_driver(MAXPORTS);
>> + if (!brd->PrintDriver)
>> + return -ENOMEM;
>
> if (!brd->PrintDriver) {
> rc = -ENOMEM:
> goto err_free_serial_ttys;
> }
>
>>
>>   snprintf(brd->PrintName, MAXTTYNAMELEN, "pr_dgap_%d_", brd->boardnum);
>>   brd->PrintDriver->name = brd->PrintName;
>> @@ -267,9 +272,10 @@ int dgap_tty_register(struct board_t *brd)
>>
>>   /* The kernel wants space to store pointers to tty_structs */
>>   brd->PrintDriver->ttys = dgap_driver_kzmalloc(MAXPORTS * sizeof(struct 
>> tty_struct *), GFP_KERNEL);
>> - if (!brd->PrintDriver->ttys)
>> - return(-ENOMEM);
>> -
>> + if (!brd->PrintDriver->ttys){
>> + rc = -ENOMEM;
>> + goto err_put_tty_print;
>> + }
>>  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
>>   brd->PrintDriver->refcount = brd->TtyRefCnt;
>>  #endif
>> @@ -285,7 +291,7 @@ int dgap_tty_register(struct board_t *brd)
>>   rc = tty_register_driver(brd->SerialDriver);
>>   if (rc < 0) {
>>   APR(("Can't register tty device (%d)\n", rc));
>> - return(rc);
>> + goto err_put_tty_serial;
>
> goto err_free_print_ttys;
>
>>   }
>>   brd->dgap_Major_Serial_Registered = TRUE;
>>   dgap_BoardsByMajor[brd->SerialDriver->major] = brd;
>> @@ -297,7 +303,7 @@ int dgap_tty_register(struct board_t *brd)
>>   rc = tty_register_driver(brd->PrintDriver);
>>   if (rc < 0) {
>>   APR(("Can't register Transparent Print device (%d)\n", 
>> rc));
>> - return(rc);
>> + goto err_put_tty_print;
>
> goto err_unregister_serial;
>
>>   }
>>   brd->dgap_Major_TransparentPrint_Registered = TRUE;
>>   dgap_BoardsByMajor[brd->PrintDriver->major] = brd;
>> @@ -307,6 +313,10 @@ int dgap_tty_register(struct board_t *brd)
>>   DPR_INIT(("DGAP REGISTER TTY: MAJORS: %d %d\n", 
>> brd->SerialDriver->major,
>>   brd->PrintDriver->major));
>
> Your patch frees everything by mistake on the success path.  It should
> be:
>
> return 0;
>
> err_unregister_serial:
> tty_unregister_driver(brd->SerialDriver);
> err_free_print_ttys:
> kfree(brd->PrintDriver->ttys);
> err_put_tty_print:
> put_tty_driver(brd->PrintDriver);
> err_free_serial_ttys:
> kfree(brd->SerialDriver->ttys);
> err_put_tty_serial:
> put_tty_driver(brd->SerialDriver);
>
> return rc;
> }
>
> regards,
> dan carpenter

Okay, I'll resend this patch. Thanks.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-dev

RE: [PATCH 00/13] hv: clean up dev_attr usage

2013-09-26 Thread KY Srinivasan
Greg,

I am currently travelling; when I get back I will take a look.

K. Y

> -Original Message-
> From: Greg Kroah-Hartman [mailto:gre...@linuxfoundation.org]
> Sent: Thursday, September 26, 2013 9:00 AM
> To: KY Srinivasan
> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux-ker...@vger.kernel.org
> Subject: Re: [PATCH 00/13] hv: clean up dev_attr usage
> 
> On Tue, Sep 17, 2013 at 06:42:30PM +, KY Srinivasan wrote:
> >
> >
> > > -Original Message-
> > > From: Greg Kroah-Hartman [mailto:gre...@linuxfoundation.org]
> > > Sent: Friday, September 13, 2013 11:33 AM
> > > To: KY Srinivasan; Haiyang Zhang
> > > Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org
> > > Subject: [PATCH 00/13] hv: clean up dev_attr usage
> > >
> > > Hi,
> > >
> > > Here's a set of 13 patches to get rid of the dev_attrs use in the hv bus
> > > code, as it will be going away soon.  It's _way_ bigger than all other
> > > conversions I've had to do so far in the kernel, as you were using a
> > > "multiplexor" function for all of these files.
> > >
> > > So, I've broken it up into individual show/store sysfs functions, and
> > > cleaned up a bunch of debug structures that aren't needed and shouldn't
> > > be exported to the rest of the kernel.
> > >
> > > I've also fixed up some void * usage in the hv core, in patch 07, to
> > > make things simpler and not so "magic" when dealing with these pages.
> > > If you could review that one closely to ensure I didn't mess anything
> > > up, I would appreciate it.
> > >
> > > Also, are all of these files really needed for sysfs?  They seem to be
> > > all debugging stuff, shouldn't they go into debugfs if you really
> > > need/use them anymore?
> > >
> > > KY, could you test these out?  I don't have access to a hv system at the
> > > moment.  I'll wait for your ack before applying them to any of my trees.
> >
> > The patches look good and I tested them. The guest comes up and is 
> > functional.
> > I did notice though that the pending state appears to be a signed entity now
> which was not the
> > the case  before - I see a negative sign when I cat the client/server 
> > pending
> state.
> 
> Which exact file is that?  I didn't change the % modifiers for any of
> the data types, or at least I sure shouldn't have, if so, that's a bug
> on my side.
> 
> Thanks for testing, I'll queue these up, and if you can tell me which
> sysfs file is different, I'll verify the code conversion again, but I
> just reviewed it and can't seem to find anything.
> 
> thanks,
> 
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 00/51] DMA mask changes

2013-09-26 Thread Rafał Miłecki
2013/9/19 Russell King - ARM Linux :
> This email is only being sent to the mailing lists in question, not to
> anyone personally.  The list of individuals is far to great to do that.
> I'm hoping no mailing lists reject the patches based on the number of
> recipients.

Huh, I think it was enough to send only 3 patches to the b43-dev@. Like:
[PATCH 01/51] DMA-API: provide a helper to set both DMA and coherent DMA masks
[PATCH 14/51] DMA-API: net: b43: (...)
[PATCH 15/51] DMA-API: net: b43legacy: (...)
;)

I believe Joe has some nice script for doing it that way. When fixing
some coding style / formatting, he sends only related patches to the
given ML.

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


[PATCH] staging: comedi: 8253.h: tidy up the i8253_cascade_ns_to_timer*() users

2013-09-26 Thread H Hartley Sweeten
Introduce a couple defines for the common 8254 oscillator base values
used in the comedi drivers and remove the custom defines and open
coded values.

Change the i8253_cascade_ns_to_timer_2div() calls in the drivers to
the more generic i8253_cascade_ns_to_timer(). They are identical due
to the #define in the 8253.h header.

Remove the extra mask by TRIG_ROUND_MASK of the 'round_mode' parameter
to i8253_cascade_ns_to_timer(). That function already handles the mask.

Tidy up all the calls to i8253_cascade_ns_to_timer().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/8253.h |  9 ++
 drivers/staging/comedi/drivers/adl_pci9111.c  | 11 +++
 drivers/staging/comedi/drivers/adl_pci9118.c  | 17 ++-
 drivers/staging/comedi/drivers/adv_pci1710.c  | 15 -
 drivers/staging/comedi/drivers/amplc_pci224.c | 36 ++
 drivers/staging/comedi/drivers/cb_das16_cs.c  | 12 
 drivers/staging/comedi/drivers/cb_pcidas.c| 43 --
 drivers/staging/comedi/drivers/das16.c| 35 ++---
 drivers/staging/comedi/drivers/das16m1.c  | 18 +--
 drivers/staging/comedi/drivers/das1800.c  | 44 +++
 drivers/staging/comedi/drivers/das800.c   | 10 +++---
 drivers/staging/comedi/drivers/ni_labpc.c | 23 ++
 drivers/staging/comedi/drivers/pcl711.c   |  4 +--
 drivers/staging/comedi/drivers/pcl812.c   | 37 +++---
 drivers/staging/comedi/drivers/pcl816.c   | 13 
 drivers/staging/comedi/drivers/pcl818.c   | 15 -
 16 files changed, 161 insertions(+), 181 deletions(-)

diff --git a/drivers/staging/comedi/drivers/8253.h 
b/drivers/staging/comedi/drivers/8253.h
index 3abedcd..e3d737c 100644
--- a/drivers/staging/comedi/drivers/8253.h
+++ b/drivers/staging/comedi/drivers/8253.h
@@ -21,6 +21,15 @@
 
 #include "../comedi.h"
 
+/*
+ * Common oscillator base values in nanoseconds
+ */
+#define I8254_OSC_BASE_10MHZ   100
+#define I8254_OSC_BASE_5MHZ200
+#define I8254_OSC_BASE_4MHZ250
+#define I8254_OSC_BASE_2MHZ500
+#define I8254_OSC_BASE_1MHZ1000
+
 #define i8253_cascade_ns_to_timer i8253_cascade_ns_to_timer_2div
 
 static inline void i8253_cascade_ns_to_timer_2div_old(int i8253_osc_base,
diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c 
b/drivers/staging/comedi/drivers/adl_pci9111.c
index 89ca507..4db46f0 100644
--- a/drivers/staging/comedi/drivers/adl_pci9111.c
+++ b/drivers/staging/comedi/drivers/adl_pci9111.c
@@ -86,8 +86,6 @@ TODO:
 #define PCI9111_AI_INSTANT_READ_UDELAY_US  2
 #define PCI9111_AI_INSTANT_READ_TIMEOUT100
 
-#define PCI9111_8254_CLOCK_PERIOD_NS   500
-
 /*
  * IO address map and bit defines
  */
@@ -393,11 +391,10 @@ static int pci9111_ai_do_cmd_test(struct comedi_device 
*dev,
 
if (cmd->convert_src == TRIG_TIMER) {
tmp = cmd->convert_arg;
-   i8253_cascade_ns_to_timer_2div(PCI9111_8254_CLOCK_PERIOD_NS,
-  &dev_private->div1,
-  &dev_private->div2,
-  &cmd->convert_arg,
-  cmd->flags & TRIG_ROUND_MASK);
+   i8253_cascade_ns_to_timer(I8254_OSC_BASE_2MHZ,
+ &dev_private->div1,
+ &dev_private->div2,
+ &cmd->convert_arg, cmd->flags);
if (tmp != cmd->convert_arg)
error++;
}
diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index f50dbea..bd5c8bb 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -792,7 +792,8 @@ static void pci9118_calc_divisors(char mode, struct 
comedi_device *dev,
case 4:
if (*tim2 < this_board->ai_ns_min)
*tim2 = this_board->ai_ns_min;
-   i8253_cascade_ns_to_timer(devpriv->i8254_osc_base, div1, div2,
+   i8253_cascade_ns_to_timer(devpriv->i8254_osc_base,
+ div1, div2,
  tim2, flags & TRIG_ROUND_NEAREST);
break;
case 2:
@@ -1277,9 +1278,9 @@ static int pci9118_ai_cmdtest(struct comedi_device *dev,
 
if (cmd->scan_begin_src == TRIG_TIMER) {
tmp = cmd->scan_begin_arg;
-   i8253_cascade_ns_to_timer(devpriv->i8254_osc_base, &divisor1,
- &divisor2, &cmd->scan_begin_arg,
- cmd->flags & TRIG_ROUND_MASK);
+   i8253_cascade_ns_to_timer(devpriv->i8254_osc_base,
+ 

staging: comedi: pcl726: rename interrupt (async cmd) support functions

2013-09-26 Thread H Hartley Sweeten
Rename these functions so they have namespace associated with the driver.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl726.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl726.c 
b/drivers/staging/comedi/drivers/pcl726.c
index 152f1db..cf9568e 100644
--- a/drivers/staging/comedi/drivers/pcl726.c
+++ b/drivers/staging/comedi/drivers/pcl726.c
@@ -160,7 +160,7 @@ struct pcl726_private {
unsigned int cmd_running:1;
 };
 
-static int pcl818_intr_insn_bits(struct comedi_device *dev,
+static int pcl726_intr_insn_bits(struct comedi_device *dev,
 struct comedi_subdevice *s,
 struct comedi_insn *insn,
 unsigned int *data)
@@ -169,7 +169,7 @@ static int pcl818_intr_insn_bits(struct comedi_device *dev,
return insn->n;
 }
 
-static int pcl818_intr_cmdtest(struct comedi_device *dev,
+static int pcl726_intr_cmdtest(struct comedi_device *dev,
   struct comedi_subdevice *s,
   struct comedi_cmd *cmd)
 {
@@ -211,7 +211,7 @@ static int pcl818_intr_cmdtest(struct comedi_device *dev,
return 0;
 }
 
-static int pcl818_intr_cmd(struct comedi_device *dev,
+static int pcl726_intr_cmd(struct comedi_device *dev,
   struct comedi_subdevice *s)
 {
struct pcl726_private *devpriv = dev->private;
@@ -221,7 +221,7 @@ static int pcl818_intr_cmd(struct comedi_device *dev,
return 0;
 }
 
-static int pcl818_intr_cancel(struct comedi_device *dev,
+static int pcl726_intr_cancel(struct comedi_device *dev,
  struct comedi_subdevice *s)
 {
struct pcl726_private *devpriv = dev->private;
@@ -231,14 +231,14 @@ static int pcl818_intr_cancel(struct comedi_device *dev,
return 0;
 }
 
-static irqreturn_t pcl818_interrupt(int irq, void *d)
+static irqreturn_t pcl726_interrupt(int irq, void *d)
 {
struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->read_subdev;
struct pcl726_private *devpriv = dev->private;
 
if (devpriv->cmd_running) {
-   pcl818_intr_cancel(dev, s);
+   pcl726_intr_cancel(dev, s);
 
comedi_buf_put(s->async, 0);
s->async->events |= (COMEDI_CB_BLOCK | COMEDI_CB_EOS);
@@ -363,7 +363,7 @@ static int pcl726_attach(struct comedi_device *dev,
 * user config option is valid and the board supports interrupts.
 */
if (it->options[1] && (board->irq_mask & (1 << it->options[1]))) {
-   ret = request_irq(it->options[1], pcl818_interrupt, 0,
+   ret = request_irq(it->options[1], pcl726_interrupt, 0,
  dev->board_name, dev);
if (ret == 0) {
/* External trigger source is from Pin-17 of CN3 */
@@ -429,10 +429,10 @@ static int pcl726_attach(struct comedi_device *dev,
s->n_chan   = 1;
s->maxdata  = 1;
s->range_table  = &range_digital;
-   s->insn_bits= pcl818_intr_insn_bits;
-   s->do_cmdtest   = pcl818_intr_cmdtest;
-   s->do_cmd   = pcl818_intr_cmd;
-   s->cancel   = pcl818_intr_cancel;
+   s->insn_bits= pcl726_intr_insn_bits;
+   s->do_cmdtest   = pcl726_intr_cmdtest;
+   s->do_cmd   = pcl726_intr_cmd;
+   s->cancel   = pcl726_intr_cancel;
}
 
return 0;
-- 
1.8.3.2

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


staging: comedi: Kconfig: COMEDI_NI_ATMIO should select COMEDI_FC

2013-09-26 Thread H Hartley Sweeten
As pointed out by the kbuild test robot, the ni_atmio driver includes
ni_mio_common.c which uses the helper functions in the comedi_fc module.

Select the COMEDI_FC module when COMEDI_NI_ATMIO is enabled to fix the
following build error:

ERROR: "cfc_write_array_to_buffer" [drivers/staging/comedi/drivers/ni_atmio.ko] 
undefined!

Signed-off-by: H Hartley Sweeten 
Reported-by: Fengguang Wu 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
index f73287e..24f3cf2 100644
--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -485,6 +485,7 @@ config COMEDI_NI_ATMIO
tristate "NI AT-MIO E series ISA-PNP card support"
select COMEDI_8255
select COMEDI_NI_TIO
+   select COMEDI_FC
---help---
  Enable support for National Instruments AT-MIO E series cards
  National Instruments AT-MIO-16E-1 (ni_atmio),
-- 
1.8.3.2

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


staging: comedi: dt2801: fix using uninitialized variable warnings

2013-09-26 Thread H Hartley Sweeten
As pointed out by Fengguang Wu, the calls to dt2801_readdata() return the
data read thru a pointer (the address of a local variable) passed as a
parameter. If this local variable is not initialized it produces a warning
during the build of the form:

drivers/staging/comedi/drivers/dt2801.c: In function 'dt2801_ai_insn_read':
drivers/staging/comedi/drivers/dt2801.c:273:14: warning: 'hb' is used
  uninitialized in this function [-Wuninitialized]

Fix these warning by making sure the local variables are initialized.

Signed-off-by: H Hartley Sweeten 
Reported-by: Fengguang Wu 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2801.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2801.c 
b/drivers/staging/comedi/drivers/dt2801.c
index 1a2b0e4..811c8c5 100644
--- a/drivers/staging/comedi/drivers/dt2801.c
+++ b/drivers/staging/comedi/drivers/dt2801.c
@@ -260,7 +260,8 @@ static int dt2801_readdata(struct comedi_device *dev, int 
*data)
 
 static int dt2801_readdata2(struct comedi_device *dev, int *data)
 {
-   int lb, hb;
+   int lb = 0;
+   int hb = 0;
int ret;
 
ret = dt2801_readdata(dev, &lb);
@@ -532,7 +533,7 @@ static int dt2801_dio_insn_bits(struct comedi_device *dev,
unsigned int *data)
 {
int which = (s == &dev->subdevices[3]) ? 1 : 0;
-   unsigned int val;
+   unsigned int val = 0;
 
if (comedi_dio_update_state(s, data)) {
dt2801_writecmd(dev, DT_C_WRITE_DIG);
-- 
1.8.3.2

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


Re: [PATCH v2 1/5] staging: dgap: driver.c: removes smatch warning "redundant null check"

2013-09-26 Thread Greg KH
On Wed, Sep 25, 2013 at 07:08:50PM -0400, Lidza Louina wrote:
> This patch removes these smatch warnings from dgap_driver.c:
> 
> redundant null check on dgap_config_buf calling kfree()
> redundant null check on brd->flipbuf calling kfree()
> redundant null check on brd->flipflagbuf calling kfree()
> 
> Signed-off-by: Lidza Louina 
> ---
>  drivers/staging/dgap/dgap_driver.c | 9 +++--
>  1 file changed, 3 insertions(+), 6 deletions(-)

I've applied this already yesterday, no need to resend it :)

thanks,

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


Re: [PATCH v2 3/5] staging: dgap: tty.c: removes smatch warnings "redundant null check"

2013-09-26 Thread Greg KH
On Wed, Sep 25, 2013 at 07:08:52PM -0400, Lidza Louina wrote:
> This patch removes these smatch warnings:
> redundant null check on dgap_TmpWriteBuf calling kfree()
> redundant null check on brd->SerialDriver->ttys calling kfree()
> redundant null check on brd->PrintDriver->ttys calling kfree()
> 
> The code checked to see if these variables are null
> before freeing. This check isn't needed.
> 
> Signed-off-by: Lidza Louina 
> ---
>  drivers/staging/dgap/dgap_tty.c | 18 ++
>  1 file changed, 6 insertions(+), 12 deletions(-)

And I've applied this one too.

thanks,

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


Re: [PATCH v2 2/5] staging: dgap: tty.c: removes smatch warning "ignoring unreachable code"

2013-09-26 Thread Greg KH
On Wed, Sep 25, 2013 at 07:08:51PM -0400, Lidza Louina wrote:
> This patch removes this smatch warning:
> info: ignoring unreachable code.
> 
> There were instances where there was extra code after
> the default action in switch statements. These default
> actions ended with a break so the code wasn't being run
> at anytime. This patch removes that extra code.
> Signed-off-by: Lidza Louina 
> ---
>  drivers/staging/dgap/dgap_tty.c | 13 -
>  1 file changed, 13 deletions(-)

I've already applied this one, thanks.

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


Re: [PATCH 00/19] staging: comedi: pcl726: cleanup driver

2013-09-26 Thread Greg Kroah-Hartman
On Thu, Sep 26, 2013 at 04:19:49PM +, Hartley Sweeten wrote:
> On Thursday, September 26, 2013 2:45 AM, Ian Abbott wrote:
> > On 2013-09-25 23:34, H Hartley Sweeten wrote:
> >> Cleanup another comedi driver.
> >>
> >> Add support for the external interrupt on the ACL-6126 board.
> >>
> >> H Hartley Sweeten (19):
> >>staging: comedi: pcl726: convert boardinfo declaration to C99 format
> >>staging: comedi: core: introduce comedi_chan_range_is_{bi,uni}polar()
> >>staging: comedi: pcl726: remove 'bipolar' from the private data
> >>staging: comedi: pcl726: tidy up pcl726_ao_insn()
> >>staging: comedi: pcl726: tidy up pcl726_ao_insn_read()
> >>staging: comedi: pcl726: remove all '= 0' boardinfo
> >>staging: comedi: pcl726: enable the interrupt support code
> >>staging: comedi: pcl726: fix the analog output range_table_list 
> >> initialization
> >>staging: comedi: pcl726: tidy up pcl726_attach()
> >>staging: comedi: pcl726: remove digital i/o register offsets from 
> >> boardinfo
> >>staging: comedi: pcl726: tidy up the comedi_lrange code
> >>staging: comedi: pcl726: rename boardinfo 'IRQbits'
> >>staging: comedi: pcl726: remove unnecessary comments in boardinfo 
> >> definition
> >>staging: comedi: pcl726: remove the *_SIZE defines
> >>staging: comedi: pcl726: final tidy up of boardinfo
> >>staging: comedi: pcl726: add support for the external interrupt signal
> >>staging: comedi: pcl726: tidy up multi-line comments
> >>staging: comedi: pcl726: update MODULE_DESCRIPTION
> >>staging: comedi: pcl726: rename 'boardtypes'
> >>
> >>   drivers/staging/comedi/comedidev.h  |  14 +
> >>   drivers/staging/comedi/drivers/pcl726.c | 581 
> >> +++-
> >>   2 files changed, 359 insertions(+), 236 deletions(-)
> >
> > Looks okay.  The various identifiers prefixed with "pcl818_" (patches 07 
> > and 16) seems a poor choice though.
> 
> I was trying to make it obvious that the interrupt support was really just for
> the ACL-6126 board. I'm not sure why I ended up prefixing them with pcl818_.
> I blame my daughters... they are both currently sick.
> 
> They should just be prefixed with pcl726_ to match the namespace of the
> rest of the driver. I can either rebase this series to fix it or post a new 
> patch
> after Greg applies these.

Just send another patch after I apply these in a few minutes...

thanks,

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


RE: [PATCH 0/3] staging: comedi: pcl711: fix up AI command support

2013-09-26 Thread Hartley Sweeten
On Thursday, September 26, 2013 2:17 AM, Ian Abbott wrote:
> As noted by Hartley in
> http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2013-September/041560.html
> async command support (for the AI subdevice) is broken.  This small
> series of patches should get it working.
>
> 1) staging: comedi: pcl711: add AI cancel handler
> 2) staging: comedi: pcl711: handle cmd->stop_src and stop_arg
> 3) staging: comedi: pcl711: put acquired data in buffer for AI command
>
>  drivers/staging/comedi/drivers/pcl711.c | 35 
> +++--
>  1 file changed, 29 insertions(+), 6 deletions(-)

Thanks for fixing this.

Reviewed-by: H Hartley Sweeten 

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


RE: [PATCH 00/19] staging: comedi: pcl726: cleanup driver

2013-09-26 Thread Hartley Sweeten
On Thursday, September 26, 2013 2:45 AM, Ian Abbott wrote:
> On 2013-09-25 23:34, H Hartley Sweeten wrote:
>> Cleanup another comedi driver.
>>
>> Add support for the external interrupt on the ACL-6126 board.
>>
>> H Hartley Sweeten (19):
>>staging: comedi: pcl726: convert boardinfo declaration to C99 format
>>staging: comedi: core: introduce comedi_chan_range_is_{bi,uni}polar()
>>staging: comedi: pcl726: remove 'bipolar' from the private data
>>staging: comedi: pcl726: tidy up pcl726_ao_insn()
>>staging: comedi: pcl726: tidy up pcl726_ao_insn_read()
>>staging: comedi: pcl726: remove all '= 0' boardinfo
>>staging: comedi: pcl726: enable the interrupt support code
>>staging: comedi: pcl726: fix the analog output range_table_list 
>> initialization
>>staging: comedi: pcl726: tidy up pcl726_attach()
>>staging: comedi: pcl726: remove digital i/o register offsets from 
>> boardinfo
>>staging: comedi: pcl726: tidy up the comedi_lrange code
>>staging: comedi: pcl726: rename boardinfo 'IRQbits'
>>staging: comedi: pcl726: remove unnecessary comments in boardinfo 
>> definition
>>staging: comedi: pcl726: remove the *_SIZE defines
>>staging: comedi: pcl726: final tidy up of boardinfo
>>staging: comedi: pcl726: add support for the external interrupt signal
>>staging: comedi: pcl726: tidy up multi-line comments
>>staging: comedi: pcl726: update MODULE_DESCRIPTION
>>staging: comedi: pcl726: rename 'boardtypes'
>>
>>   drivers/staging/comedi/comedidev.h  |  14 +
>>   drivers/staging/comedi/drivers/pcl726.c | 581 
>> +++-
>>   2 files changed, 359 insertions(+), 236 deletions(-)
>
> Looks okay.  The various identifiers prefixed with "pcl818_" (patches 07 
> and 16) seems a poor choice though.

I was trying to make it obvious that the interrupt support was really just for
the ACL-6126 board. I'm not sure why I ended up prefixing them with pcl818_.
I blame my daughters... they are both currently sick.

They should just be prefixed with pcl726_ to match the namespace of the
rest of the driver. I can either rebase this series to fix it or post a new 
patch
after Greg applies these.

> Reviewed-by: Ian Abbott 

Thanks,
Hartley

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


[PATCH 0/4] Fix typo in staging/rtl8188eu

2013-09-26 Thread Masanari Iida
Fix spelling typo in comments.

Masanari Iida (4):
  staging: rtl8188eu: Fix typo in rtl8188eu/include
  staging: rtl8188eu: Fix typo in rtl8188eu/core
  staging: rtl8188eu: Fix typo in rtl8188eu/hal
  staging: rtl8188eu: Fix typo in rtl8188eu/os_dep

 drivers/staging/rtl8188eu/core/rtw_ap.c  |  2 +-
 drivers/staging/rtl8188eu/core/rtw_br_ext.c  |  2 +-
 drivers/staging/rtl8188eu/core/rtw_cmd.c |  2 +-
 drivers/staging/rtl8188eu/core/rtw_efuse.c   |  4 ++--
 drivers/staging/rtl8188eu/core/rtw_ieee80211.c   |  2 +-
 drivers/staging/rtl8188eu/core/rtw_mlme.c| 20 ++--
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c|  6 +++---
 drivers/staging/rtl8188eu/core/rtw_security.c|  2 +-
 drivers/staging/rtl8188eu/hal/HalPwrSeqCmd.c |  2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c |  8 
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c|  4 ++--
 drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c  |  8 
 drivers/staging/rtl8188eu/hal/rtl8188e_rf6052.c  | 10 +-
 drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c   |  2 +-
 drivers/staging/rtl8188eu/hal/usb_halinit.c  | 10 +-
 drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h   |  2 +-
 drivers/staging/rtl8188eu/include/odm_debug.h|  2 +-
 drivers/staging/rtl8188eu/include/rtw_cmd.h  |  2 +-
 drivers/staging/rtl8188eu/include/rtw_led.h  |  4 ++--
 drivers/staging/rtl8188eu/include/rtw_mlme.h | 12 ++--
 drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |  2 +-
 .../staging/rtl8188eu/include/rtw_mp_phy_regdef.h|  2 +-
 drivers/staging/rtl8188eu/include/rtw_rf.h   |  2 +-
 drivers/staging/rtl8188eu/include/sta_info.h |  2 +-
 drivers/staging/rtl8188eu/include/wifi.h |  2 +-
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c   | 12 ++--
 drivers/staging/rtl8188eu/os_dep/os_intfs.c  |  2 +-
 drivers/staging/rtl8188eu/os_dep/osdep_service.c |  2 +-
 28 files changed, 66 insertions(+), 66 deletions(-)

-- 
1.8.4.474.g128a96c

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


Re: [PATCH 00/13] hv: clean up dev_attr usage

2013-09-26 Thread Greg Kroah-Hartman
On Tue, Sep 17, 2013 at 06:42:30PM +, KY Srinivasan wrote:
> 
> 
> > -Original Message-
> > From: Greg Kroah-Hartman [mailto:gre...@linuxfoundation.org]
> > Sent: Friday, September 13, 2013 11:33 AM
> > To: KY Srinivasan; Haiyang Zhang
> > Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org
> > Subject: [PATCH 00/13] hv: clean up dev_attr usage
> > 
> > Hi,
> > 
> > Here's a set of 13 patches to get rid of the dev_attrs use in the hv bus
> > code, as it will be going away soon.  It's _way_ bigger than all other
> > conversions I've had to do so far in the kernel, as you were using a
> > "multiplexor" function for all of these files.
> > 
> > So, I've broken it up into individual show/store sysfs functions, and
> > cleaned up a bunch of debug structures that aren't needed and shouldn't
> > be exported to the rest of the kernel.
> > 
> > I've also fixed up some void * usage in the hv core, in patch 07, to
> > make things simpler and not so "magic" when dealing with these pages.
> > If you could review that one closely to ensure I didn't mess anything
> > up, I would appreciate it.
> > 
> > Also, are all of these files really needed for sysfs?  They seem to be
> > all debugging stuff, shouldn't they go into debugfs if you really
> > need/use them anymore?
> > 
> > KY, could you test these out?  I don't have access to a hv system at the
> > moment.  I'll wait for your ack before applying them to any of my trees.
> 
> The patches look good and I tested them. The guest comes up and is functional.
> I did notice though that the pending state appears to be a signed entity now 
> which was not the
> the case  before - I see a negative sign when I cat the client/server pending 
> state.

Which exact file is that?  I didn't change the % modifiers for any of
the data types, or at least I sure shouldn't have, if so, that's a bug
on my side.

Thanks for testing, I'll queue these up, and if you can tell me which
sysfs file is different, I'll verify the code conversion again, but I
just reviewed it and can't seem to find anything.

thanks,

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


[PATCH 3/4] staging: rtl8188eu: Fix typo in rtl8188eu/hal

2013-09-26 Thread Masanari Iida
Correct spelling typo in rtl8188eu/hal

Signed-off-by: Masanari Iida 
---
 drivers/staging/rtl8188eu/hal/HalPwrSeqCmd.c  |  2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c  |  8 
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c |  4 ++--
 drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c   |  8 
 drivers/staging/rtl8188eu/hal/rtl8188e_rf6052.c   | 10 +-
 drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c|  2 +-
 drivers/staging/rtl8188eu/hal/usb_halinit.c   | 10 +-
 7 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/HalPwrSeqCmd.c 
b/drivers/staging/rtl8188eu/hal/HalPwrSeqCmd.c
index e913a22..5700dbc 100644
--- a/drivers/staging/rtl8188eu/hal/HalPwrSeqCmd.c
+++ b/drivers/staging/rtl8188eu/hal/HalPwrSeqCmd.c
@@ -85,7 +85,7 @@ u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, 
u8 fab_vers,
value &= ~(GET_PWR_CFG_MASK(pwrcfgcmd));
value |= (GET_PWR_CFG_VALUE(pwrcfgcmd) & 
GET_PWR_CFG_MASK(pwrcfgcmd));
 
-   /*  Write the value back to sytem register */
+   /*  Write the value back to system register */
rtw_write8(padapter, offset, value);
break;
case PWR_CMD_POLLING:
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
index 8c858775..0b0c68c 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
@@ -484,7 +484,7 @@ static void ConstructProbeRsp(struct adapter *adapt, u8 
*pframe, u32 *pLength, u
*pLength = pktlen;
 }
 
-/*  To check if reserved page content is destroyed by beacon beacuse beacon is 
too large. */
+/*  To check if reserved page content is destroyed by beacon because beacon is 
too large. */
 /*  2010.06.23. Added by tynli. */
 void CheckFwRsvdPageContent(struct adapter *Adapter)
 {
@@ -496,9 +496,9 @@ void CheckFwRsvdPageContent(struct adapter *Adapter)
 /* (1)Beacon, (2)Ps-poll, (3)Null data, (4)ProbeRsp. */
 /* Input: */
 /* bDLFinished - false: At the first time we will send all the packets 
as a large packet to Hw, */
-/* so we need to set the packet 
length to total lengh. */
+/* so we need to set the packet 
length to total length. */
 /*   true: At the second time, we should send the 
first packet (default:beacon) */
-/* to Hw again and set the lengh 
in descriptor to the real beacon lengh. */
+/* to Hw again and set the length 
in descriptor to the real beacon length. */
 /*  2009.10.15 by tynli. */
 static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
 {
@@ -671,7 +671,7 @@ _func_enter_;
DBG_88E("%s: 1 Download RSVD success! DLBcnCount:%u, 
poll:%u\n", __func__, DLBcnCount, poll);
/*  */
/*  We just can send the reserved page twice during the time 
that Tx thread is stopped (e.g. pnpsetpower) */
-   /*  becuase we need to free the Tx BCN Desc which is used by 
the first reserved page packet. */
+   /*  because we need to free the Tx BCN Desc which is used by 
the first reserved page packet. */
/*  At run time, we cannot get the Tx Desc until it is released 
in TxHandleInterrupt() so we will return */
/*  the beacon TCB in the following code. 2011.11.23. by tynli. 
*/
/*  */
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
index 390ab39..51f03c3 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
@@ -1651,7 +1651,7 @@ hal_EfusePgCheckAvailableAddr(
 {
u16 efuse_max_available_len = 0;
 
-   /* Change to check TYPE_EFUSE_MAP_LEN , beacuse 8188E raw 256, logic 
map over 256. */
+   /* Change to check TYPE_EFUSE_MAP_LEN , because 8188E raw 256, logic 
map over 256. */
EFUSE_GetEfuseDefinition(pAdapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, 
(void *)&efuse_max_available_len, false);
 
if (Efuse_GetCurrentSize(pAdapter, efuseType, bPseudoTest) >= 
efuse_max_available_len)
@@ -2098,7 +2098,7 @@ static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
if (chnl <= 14) {
bIn24G = true;
 
-   if (chnl < 3)   /*  Chanel 1-2 */
+   if (chnl < 3)   /*  Channel 1-2 */
*pGroup = 0;
else if (chnl < 6)  /*  Channel 3-5 */
*pGroup = 1;
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c 
b/drivers/st

[PATCH 4/4] staging: rtl8188eu: Fix typo in rtl8188eu/os_dep

2013-09-26 Thread Masanari Iida
Correct spelling typo in rtl8188eu/os_dep

Signed-off-by: Masanari Iida 
---
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c   | 12 ++--
 drivers/staging/rtl8188eu/os_dep/os_intfs.c  |  2 +-
 drivers/staging/rtl8188eu/os_dep/osdep_service.c |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 1138ed1..070bd75 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -1074,7 +1074,7 @@ static int rtw_wx_get_range(struct net_device *dev,
 
 /*  The following code will proivde the security capability to network 
manager. */
 /*  If the driver doesn't provide this capability to network manager, */
-/*  the WPA/WPA2 routers can't be choosen in the network manager. */
+/*  the WPA/WPA2 routers can't be chosen in the network manager. */
 
 /*
 #define IW_SCAN_CAPA_NONE  0x00
@@ -1373,7 +1373,7 @@ _func_enter_;
}
}
 
-   /* it has still some scan paramater to parse, we only 
do this now... */
+   /* it has still some scan parameter to parse, we only 
do this now... */
_status = rtw_set_802_11_bssid_list_scan(padapter, 
ssid, RTW_SSID_SCAN_AMOUNT);
} else {
_status = rtw_set_802_11_bssid_list_scan(padapter, 
NULL, 0);
@@ -2961,7 +2961,7 @@ static int rtw_p2p_get_status(struct net_device *dev,
 
 /* Commented by Albert 20110520 */
 /* This function will return the config method description */
-/* This config method description will show us which config method the 
remote P2P device is intented to use */
+/* This config method description will show us which config method the 
remote P2P device is intended to use */
 /* by sending the provisioning discovery request frame. */
 
 static int rtw_p2p_get_req_cm(struct net_device *dev,
@@ -3413,7 +3413,7 @@ static int rtw_p2p_get_invitation_procedure(struct 
net_device *dev,
/*  +8 is for the str "InvProc =", we have to clear it at 
wrqu->data.pointer */
 
/*  Commented by Ouden 20121226 */
-   /*  The application wants to know P2P initation procedure is 
support or not. */
+   /*  The application wants to know P2P initiation procedure is 
supported or not. */
/*  Format: iwpriv wlanx p2p_get2 InvProc = 00:E0:4C:00:00:05 */
 
DBG_88E("[%s] data = %s\n", __func__, (char *)extra);
@@ -6145,7 +6145,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
 
for (jj = 0, kk = 0; jj < cnts; jj++, kk += 2)
setdata[jj] = key_2char2num(tmp[2][kk], tmp[2][kk + 1]);
-   /* Change to check TYPE_EFUSE_MAP_LEN, beacuse 8188E raw 256, 
logic map over 256. */
+   /* Change to check TYPE_EFUSE_MAP_LEN, because 8188E raw 256, 
logic map over 256. */
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, 
TYPE_EFUSE_MAP_LEN, (void *)&max_available_size, false);
if ((addr+cnts) > max_available_size) {
DBG_88E("%s: addr(0x%X)+cnts(%d) parameter error!\n", 
__func__, addr, cnts);
@@ -6220,7 +6220,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
 
for (jj = 0, kk = 0; jj < cnts; jj++, kk += 2)
setdata[jj] = key_2char2num(tmp[1][kk], tmp[1][kk + 1]);
-   /* Change to check TYPE_EFUSE_MAP_LEN, beacuse 8188E raw 256, 
logic map over 256. */
+   /* Change to check TYPE_EFUSE_MAP_LEN, because 8188E raw 256, 
logic map over 256. */
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, 
TYPE_EFUSE_MAP_LEN, (void *)&max_available_size, false);
if ((addr+cnts) > max_available_size) {
DBG_88E("%s: addr(0x%X)+cnts(%d) parameter error!\n", 
__func__, addr, cnts);
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c 
b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index 63bc913..da9f0d5 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -85,7 +85,7 @@ static int rtw_uapsd_acvi_en;
 static int rtw_uapsd_acvo_en;
 
 int rtw_ht_enable = 1;
-int rtw_cbw40_enable = 3; /*  0 :diable, bit(0): enable 2.4g, bit(1): enable 
5g */
+int rtw_cbw40_enable = 3; /*  0 :disable, bit(0): enable 2.4g, bit(1): enable 
5g */
 int rtw_ampdu_enable = 1;/* for enable tx_ampdu */
 static int rtw_rx_stbc = 1;/*  0: disable, bit(0):enable 2.4g, bit(1):enable 
5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */
 static int rtw_ampdu_amsdu;/*  0: disabled, 1:enabled, 2:auto */
diff --git a/drivers/staging/rtl8188eu/os_dep/osdep_service.c 
b/drivers/staging/rtl8188eu/os_dep/osdep_service.c
index 51a1f6f..5a9e9e4 100644
--- a/drivers/staging/rtl8188eu/os_dep/osdep_service.c
+++ b/drivers/stag

[PATCH 2/4] staging: rtl8188eu: Fix typo in rtl8188eu/core

2013-09-26 Thread Masanari Iida
Correct spelling typo in rtl8188eu/core

Signed-off-by: Masanari Iida 

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
# On branch rtl8188eu-typo2
# Changes to be committed:
#   modified:   drivers/staging/rtl8188eu/core/rtw_ap.c
#   modified:   drivers/staging/rtl8188eu/core/rtw_br_ext.c
#   modified:   drivers/staging/rtl8188eu/core/rtw_cmd.c
#   modified:   drivers/staging/rtl8188eu/core/rtw_efuse.c
#   modified:   drivers/staging/rtl8188eu/core/rtw_ieee80211.c
#   modified:   drivers/staging/rtl8188eu/core/rtw_mlme.c
#   modified:   drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
#   modified:   drivers/staging/rtl8188eu/core/rtw_security.c
#
---
 drivers/staging/rtl8188eu/core/rtw_ap.c|  2 +-
 drivers/staging/rtl8188eu/core/rtw_br_ext.c|  2 +-
 drivers/staging/rtl8188eu/core/rtw_cmd.c   |  2 +-
 drivers/staging/rtl8188eu/core/rtw_efuse.c |  4 ++--
 drivers/staging/rtl8188eu/core/rtw_ieee80211.c |  2 +-
 drivers/staging/rtl8188eu/core/rtw_mlme.c  | 20 ++--
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c  |  6 +++---
 drivers/staging/rtl8188eu/core/rtw_security.c  |  2 +-
 8 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 2c73823..2c678f4 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -348,7 +348,7 @@ voidexpire_timeout_chk(struct adapter *padapter)
 
if (psta->state & WIFI_SLEEP_STATE) {
if (!(psta->state & WIFI_STA_ALIVE_CHK_STATE)) {
-   /* to check if alive by another methods 
if staion is at ps mode. */
+   /* to check if alive by another methods 
if station is at ps mode. */
psta->expire_to = pstapriv->expire_to;
psta->state |= WIFI_STA_ALIVE_CHK_STATE;
 
diff --git a/drivers/staging/rtl8188eu/core/rtw_br_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_br_ext.c
index 63564f7..9f40742 100644
--- a/drivers/staging/rtl8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_br_ext.c
@@ -527,7 +527,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff 
*skb, int method)
case NAT25_CHECK:
return -1;
case NAT25_INSERT:
-   /* some muticast with source IP is all zero, maybe 
other case is illegal */
+   /* some multicast with source IP is all zero, maybe 
other case is illegal */
/* in class A, B, C, host address is all zero or all 
one is illegal */
if (iph->saddr == 0)
return 0;
diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c 
b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 9632ef4..06be02c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -1162,7 +1162,7 @@ _func_enter_;
else
memcpy(&psetstakey_para->key, 
&psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
 
-   /* jeff: set this becasue at least sw key is ready */
+   /* jeff: set this because at least sw key is ready */
padapter->securitypriv.busetkipkey = true;
 
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c 
b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index ad1c174..806f56f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -159,7 +159,7 @@ Efuse_CalculateWordCnts(u8 word_en)
 /*  */
 /* Description: */
 /* Execute E-Fuse read byte operation. */
-/* Refered from SD1 Richard. */
+/* Referred from SD1 Richard. */
 /*  */
 /* Assumption: */
 /* 1. Boot from E-Fuse and successfully auto-load. */
@@ -214,7 +214,7 @@ ReadEFuseByte(
 /* Description: */
 /* 1. Execute E-Fuse read byte operation according as map offset 
and */
 /* save to E-Fuse table. */
-/* 2. Refered from SD1 Richard. */
+/* 2. Referred from SD1 Richard. */
 /*  */
 /* Assumption: */
 /* 1. Boot from E-Fuse and successfully auto-load. */
diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c 
b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 6fc7742..e6f98fb 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -1129,7 +1129,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
mac[3] = 0x87;
mac[4] = 0x00;
mac[5] = 0x00;
-   /*  use default mac addresss */
+ 

[PATCH 1/4] staging: rtl8188eu: Fix typo in rtl8188eu/include

2013-09-26 Thread Masanari Iida
Correct spelling typo in rtl8188eu/include

Signed-off-by: Masanari Iida 
---
 drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h|  2 +-
 drivers/staging/rtl8188eu/include/odm_debug.h |  2 +-
 drivers/staging/rtl8188eu/include/rtw_cmd.h   |  2 +-
 drivers/staging/rtl8188eu/include/rtw_led.h   |  4 ++--
 drivers/staging/rtl8188eu/include/rtw_mlme.h  | 12 ++--
 drivers/staging/rtl8188eu/include/rtw_mlme_ext.h  |  2 +-
 drivers/staging/rtl8188eu/include/rtw_mp_phy_regdef.h |  2 +-
 drivers/staging/rtl8188eu/include/rtw_rf.h|  2 +-
 drivers/staging/rtl8188eu/include/sta_info.h  |  2 +-
 drivers/staging/rtl8188eu/include/wifi.h  |  2 +-
 10 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h 
b/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
index 0e06d29..9f2969b 100644
--- a/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
+++ b/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
@@ -26,7 +26,7 @@
 /*  2. 0x800/0x900/0xA00/0xC00/0xD00/0xE00 */
 /*  3. RF register 0x00-2E */
 /*  4. Bit Mask for BB/RF register */
-/*  5. Other defintion for BB/RF R/W */
+/*  5. Other definition for BB/RF R/W */
 /*  */
 
 
diff --git a/drivers/staging/rtl8188eu/include/odm_debug.h 
b/drivers/staging/rtl8188eu/include/odm_debug.h
index a9ba6df..622f4c1 100644
--- a/drivers/staging/rtl8188eu/include/odm_debug.h
+++ b/drivers/staging/rtl8188eu/include/odm_debug.h
@@ -27,7 +27,7 @@
 /* Define the debug levels */
 /*  */
 /* 1. DBG_TRACE and DBG_LOUD are used for normal cases. */
-/* They can help SW engineer to develope or trace states changed */
+/* They can help SW engineer to develop or trace states changed */
 /* and also help HW enginner to trace every operation to and from HW, */
 /* e.g IO, Tx, Rx. */
 /*  */
diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h 
b/drivers/staging/rtl8188eu/include/rtw_cmd.h
index 819285b..8cafd7a 100644
--- a/drivers/staging/rtl8188eu/include/rtw_cmd.h
+++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h
@@ -745,7 +745,7 @@ struct TDLSoption_param
 
 Result:
 0x00: success
-0x01: sucess, and check Response.
+0x01: success, and check Response.
 0x02: cmd ignored due to duplicated sequcne number
 0x03: cmd dropped due to invalid cmd code
 0x04: reserved.
diff --git a/drivers/staging/rtl8188eu/include/rtw_led.h 
b/drivers/staging/rtl8188eu/include/rtw_led.h
index 2e61804..d0da4fd 100644
--- a/drivers/staging/rtl8188eu/include/rtw_led.h
+++ b/drivers/staging/rtl8188eu/include/rtw_led.h
@@ -163,14 +163,14 @@ enum LED_STRATEGY_871x {
 void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE  
LedAction);
 
 struct led_priv{
-   /* add for led controll */
+   /* add for led control */
struct LED_871x SwLed0;
struct LED_871x SwLed1;
enum LED_STRATEGY_871x  LedStrategy;
u8  bRegUseLed;
void (*LedControlHandler)(struct adapter *padapter,
  enum LED_CTL_MODE LedAction);
-   /* add for led controll */
+   /* add for led control */
 };
 
 #define rtw_led_control(adapt, action) \
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h 
b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index 22538e6..4a7143e 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -53,11 +53,11 @@
 #defineWIFI_SITE_MONITOR   0x0800  /* to indicate 
the station is under site surveying */
 
 #defineWIFI_MP_STATE   0x0001
-#defineWIFI_MP_CTX_BACKGROUND  0x0002  /*  in 
continous tx background */
-#defineWIFI_MP_CTX_ST  0x0004  /*  in 
continous tx with single-tone */
-#defineWIFI_MP_CTX_BACKGROUND_PENDING  0x0008  /*  pending in 
continous tx background due to out of skb */
-#defineWIFI_MP_CTX_CCK_HW  0x0010  /*  in 
continous tx */
-#defineWIFI_MP_CTX_CCK_CS  0x0020  /*  in 
continous tx with carrier suppression */
+#defineWIFI_MP_CTX_BACKGROUND  0x0002  /*  in 
continuous tx background */
+#defineWIFI_MP_CTX_ST  0x0004  /*  in 
continuous tx with single-tone */
+#defineWIFI_MP_CTX_BACKGROUND_PENDING  0x0008  /*  pending in 
continuous tx background due to out of skb */
+#defineWIFI_MP_CTX_CCK_HW  0x0010  /*  in 
continuous tx */
+#defineWIFI_MP_CTX_CCK_CS  0x0020  /*  in 
continuous tx with carrier suppression */
 #define WIFI_MP_LPBK_STATE 0x0040
 
 #define _FW_UNDER_LINKING  WIFI_UNDER_LINKING
@@ -239,7 +239,7 @@ struct wifidirect_info {
u8 profileindex; /* Used to point to the index of profileinfo array */
u8 peer_operating

Re: [PATCH 5/7] staging: usbip: Add encryption support to kernel

2013-09-26 Thread Dan Carpenter
On Thu, Sep 26, 2013 at 12:18:34PM +0200, Dominik Paulus wrote:
> > I think a return of zero should mean total = -EBADMSG;.  In other words
> > this check should be "if (ret < 0) {" and we hit the next else if.
> > Same below again.
> 
> As we are wrapping kernel_recvmsg here, we wanted to leave the semantics
> intact as far as possible. The calling code already checks for the correct
> size.

Hm...  Ok.  Sometimes zero is interpretted as a connection closed and
sometimes reading less than expected is considered a TCP error.

> No, currently, the caller (usbip_sendmsg() / usbip_recvmsg() are the
> only functions calling usbip_crypt(), which itself is static) ensures
> this.
> Admittedly, this isn't great design. We added a check for packetsize <
> USBIP_AUTHSIZE and an appropiate return here.
> 
> > > + if (encrypt)
> > > + ret = crypto_aead_encrypt(req);
> > > + else
> > > + ret = crypto_aead_decrypt(req);
> > > +
> > 
> > Good on you for figuring out what crypto_aead_en/decrypt() returns.
> > Where are these functions documented?
> > 
> > > +switch (ret) {
> > > +case 0: /* Success */
> > > +break;
> > > +case -EINPROGRESS:
> > > +case -EBUSY:
> > > +wait_for_completion(&result.completion);
> > > +break;
> > > +default:
> > > +aead_request_free(req);
> > > +return ret;
> > > +}
> > > +
> 
> They aren't, actually. Documentation/crypto/api-intro.txt refers to the
> regression test module, which uses exactly those return-values in
> crypto/testmgr.c.

Well that sucks.

> We noticed that wait_for_completion might not be the best idea, since it could
> hang indefinitely, testmgr.c uses wait_for_completion_interruptible. Do we
> want 'interruptible' or 'killable' here?

I think you want the interruptible one wait_for_completion_interruptible()

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


Re: [PATCH] add exFAT driver

2013-09-26 Thread Dan Carpenter
On Thu, Sep 26, 2013 at 12:48:35PM +0200, Alexander Holler wrote:
> Am 26.09.2013 12:41, schrieb Dan Carpenter:
> >Anton, I already told you politely in a private email that you are being
> >offtopic.  This is professional email list for programmers.  Most of us
> >are forbidden to discuss laws except with our corporate legal dept.
> >None of us are lawyers.  We're not qualified to read any of your links
> >or interpret how they apply to anyone.  We can't help you or respond to
> >you.
> >
> >In other words, shut the fuck up.  Let's not continue this thread.
> 
> First my first name is Alexander and not Anton, and second I haven't
> respond to any mail on that topic after I received your private
> mail.

No, Alexander, you're cool.  The email was meant specifically for Aton.
:P

regards,
dan carpenter

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


Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-26 Thread Archit Taneja

Hi,

On Friday 20 September 2013 04:41 AM, Russell King wrote:

The correct way for a driver to specify the coherent DMA mask is
not to directly access the field in the struct device, but to use
dma_set_coherent_mask().  Only arch and bus code should access this
member directly.

Convert all direct write accesses to using the correct API.

Signed-off-by: Russell King 
---
  drivers/ata/pata_ixp4xx_cf.c |5 -
  drivers/gpu/drm/exynos/exynos_drm_drv.c  |6 +-
  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |5 +++--
  3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 1ec53f8..ddf470c 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -144,6 +144,7 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
struct ata_host *host;
struct ata_port *ap;
struct ixp4xx_pata_data *data = dev_get_platdata(&pdev->dev);
+   int ret;

cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -157,7 +158,9 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
return -ENOMEM;

/* acquire resources and fill host */
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;

data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000);
data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index bb82ef7..81192d0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -286,7 +286,11 @@ static struct drm_driver exynos_drm_driver = {

  static int exynos_drm_platform_probe(struct platform_device *pdev)
  {
-   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   int ret;
+
+   ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;

return drm_platform_init(&exynos_drm_driver, pdev);
  }
diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c 
b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index acf6678..701c4c1 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -664,8 +664,9 @@ static int omap_dmm_probe(struct platform_device *dev)
}

/* set dma mask for device */
-   /* NOTE: this is a workaround for the hwmod not initializing properly */
-   dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   ret = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
+   if (ret)
+   goto fail;


Tested with omapdrm on omap4 panda es board.

Thanks,
Archit

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


Re: [PATCH] add exFAT driver

2013-09-26 Thread Alexander Holler

Am 26.09.2013 12:41, schrieb Dan Carpenter:

Anton, I already told you politely in a private email that you are being
offtopic.  This is professional email list for programmers.  Most of us
are forbidden to discuss laws except with our corporate legal dept.
None of us are lawyers.  We're not qualified to read any of your links
or interpret how they apply to anyone.  We can't help you or respond to
you.

In other words, shut the fuck up.  Let's not continue this thread.


First my first name is Alexander and not Anton, and second I haven't 
respond to any mail on that topic after I received your private mail.


And third, "the fuck" just describes the topic perfectly.

Regards,

Alexander Holler

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


Re: [PATCH] add exFAT driver

2013-09-26 Thread Dan Carpenter
Anton, I already told you politely in a private email that you are being
offtopic.  This is professional email list for programmers.  Most of us
are forbidden to discuss laws except with our corporate legal dept.
None of us are lawyers.  We're not qualified to read any of your links
or interpret how they apply to anyone.  We can't help you or respond to
you.

In other words, shut the fuck up.  Let's not continue this thread.

regards,
dan carpenter

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


Re: [PATCH v2 5/5] staging: dgap: tty.c: removes smatch warning "unsigned '--un->un_open_count' is never less than zero"

2013-09-26 Thread Dan Carpenter
On Wed, Sep 25, 2013 at 07:08:54PM -0400, Lidza Louina wrote:
> This patch removes this smatch warning:
> unsigned '--un->un_open_count' is never less than zero
> 
> The code decremented the un_open_count variable
> and tested to see if it was less than zero. Because
> un_open_count is unsigned and can't be below zero,
> this test didn't work.
> 
> Signed-off-by: Lidza Louina 
> ---
>  drivers/staging/dgap/dgap_tty.c | 8 +++-
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/dgap/dgap_tty.c b/drivers/staging/dgap/dgap_tty.c
> index 3e12ddb..c0258db 100644
> --- a/drivers/staging/dgap/dgap_tty.c
> +++ b/drivers/staging/dgap/dgap_tty.c
> @@ -1446,13 +1446,11 @@ static void dgap_tty_close(struct tty_struct *tty, 
> struct file *file)
>   APR(("tty->count is 1, un open count is %d\n", 
> un->un_open_count));
>   un->un_open_count = 1;
>   }  
> -
> - if (--un->un_open_count < 0) {
> + if (un->un_open_count == 0) {
>   APR(("bad serial port open count of %d\n", un->un_open_count));
> - un->un_open_count = 0;
> + un->un_open_count = 1;
>   }
> -
> - ch->ch_open_count--;

Wait?  Don't delete this line.  We need to decrement both.

> + un->un_open_count--;

regards,
dan carpenter


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


Re: [PATCH v2 4/5] staging: dgap: tty.c: changes error handing to tty driver allocations

2013-09-26 Thread Dan Carpenter
This one is not right.

On Wed, Sep 25, 2013 at 07:08:53PM -0400, Lidza Louina wrote:
> This patch changes error handling to the
> tty_driver allocations in dgap_tty_register.
> 
> Before, it didn't handle the possibility of an
> alloc_tty_driver failure. This patch makes
> dgap_register_driver return -ENOMEM if that fails.
> 
> This patch also adds handling to the possibility that
> the brd->SerialDriver->ttys or brd->PrintDriver->ttys
> allocation will fail. It now calls put_tty_driver on
> that driver after it fails and returns -ENOMEM.
> 
> Signed-off-by: Lidza Louina 
> ---
>  drivers/staging/dgap/dgap_tty.c | 26 ++
>  1 file changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/dgap/dgap_tty.c b/drivers/staging/dgap/dgap_tty.c
> index 59fda2e..3e12ddb 100644
> --- a/drivers/staging/dgap/dgap_tty.c
> +++ b/drivers/staging/dgap/dgap_tty.c
> @@ -220,6 +220,8 @@ int dgap_tty_register(struct board_t *brd)
>   DPR_INIT(("tty_register start"));
>  
>   brd->SerialDriver = alloc_tty_driver(MAXPORTS);
> + if (!brd->SerialDriver)
> + return -ENOMEM;
>  
>   snprintf(brd->SerialName, MAXTTYNAMELEN, "tty_dgap_%d_", brd->boardnum);
>   brd->SerialDriver->name = brd->SerialName;
> @@ -234,9 +236,10 @@ int dgap_tty_register(struct board_t *brd)
>  
>   /* The kernel wants space to store pointers to tty_structs */
>   brd->SerialDriver->ttys = dgap_driver_kzmalloc(MAXPORTS * sizeof(struct 
> tty_struct *), GFP_KERNEL);
> - if (!brd->SerialDriver->ttys)
> - return(-ENOMEM);
> -
> + if (!brd->SerialDriver->ttys){
> + rc = -ENOMEM;
> + goto err_put_tty_serial;
> + }
>  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
>   brd->SerialDriver->refcount = brd->TtyRefCnt;
>  #endif
> @@ -253,6 +256,8 @@ int dgap_tty_register(struct board_t *brd)
>* we are when we get into the dgap_tty_open() routine.
>*/
>   brd->PrintDriver = alloc_tty_driver(MAXPORTS);
> + if (!brd->PrintDriver)
> + return -ENOMEM;

if (!brd->PrintDriver) {
rc = -ENOMEM:
goto err_free_serial_ttys;
}

>  
>   snprintf(brd->PrintName, MAXTTYNAMELEN, "pr_dgap_%d_", brd->boardnum);
>   brd->PrintDriver->name = brd->PrintName;
> @@ -267,9 +272,10 @@ int dgap_tty_register(struct board_t *brd)
>  
>   /* The kernel wants space to store pointers to tty_structs */
>   brd->PrintDriver->ttys = dgap_driver_kzmalloc(MAXPORTS * sizeof(struct 
> tty_struct *), GFP_KERNEL);
> - if (!brd->PrintDriver->ttys)
> - return(-ENOMEM);
> -
> + if (!brd->PrintDriver->ttys){
> + rc = -ENOMEM;
> + goto err_put_tty_print;
> + }
>  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
>   brd->PrintDriver->refcount = brd->TtyRefCnt;
>  #endif
> @@ -285,7 +291,7 @@ int dgap_tty_register(struct board_t *brd)
>   rc = tty_register_driver(brd->SerialDriver);
>   if (rc < 0) {
>   APR(("Can't register tty device (%d)\n", rc));
> - return(rc);
> + goto err_put_tty_serial;

goto err_free_print_ttys;

>   }
>   brd->dgap_Major_Serial_Registered = TRUE;
>   dgap_BoardsByMajor[brd->SerialDriver->major] = brd;
> @@ -297,7 +303,7 @@ int dgap_tty_register(struct board_t *brd)
>   rc = tty_register_driver(brd->PrintDriver);
>   if (rc < 0) {
>   APR(("Can't register Transparent Print device (%d)\n", 
> rc));
> - return(rc);
> + goto err_put_tty_print;

goto err_unregister_serial;

>   }
>   brd->dgap_Major_TransparentPrint_Registered = TRUE;
>   dgap_BoardsByMajor[brd->PrintDriver->major] = brd;
> @@ -307,6 +313,10 @@ int dgap_tty_register(struct board_t *brd)
>   DPR_INIT(("DGAP REGISTER TTY: MAJORS: %d %d\n", 
> brd->SerialDriver->major,
>   brd->PrintDriver->major));

Your patch frees everything by mistake on the success path.  It should
be:

return 0;

err_unregister_serial:
tty_unregister_driver(brd->SerialDriver);
err_free_print_ttys:
kfree(brd->PrintDriver->ttys);
err_put_tty_print:
put_tty_driver(brd->PrintDriver);
err_free_serial_ttys:
kfree(brd->SerialDriver->ttys);
err_put_tty_serial:
put_tty_driver(brd->SerialDriver);

return rc;
}

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


Re: [PATCH 5/7] staging: usbip: Add encryption support to kernel

2013-09-26 Thread Dominik Paulus
Hi,

thank you very much for your feedback!

On Mon, Sep 23, 2013 at 12:59:29PM +0300, Dan Carpenter wrote:
> > +   while (total < size) {
> > +   uint32_t packetsize;
> > +   struct kvec recvvec;
> > +
> > +   /*
> > +* We use a global kfifo to buffer unrequested plaintext bytes.
> > +* Flush this buffer first before receiving new data.
> > +*/
> > +   if (kfifo_len(&ud->recv_queue)) {
> > +   size_t next = min_t(size_t, kfifo_len(&ud->recv_queue),
> > +   size - total);
> > +   /* No error checking necessary - see previous line */
> > +   ret = kfifo_out(&ud->recv_queue, ((char *)
> > +   vec[0].iov_base)+total, next);
> 
> 
> The comment assume there is only one reader and one writer at a time,
> yes?  The casting is not needed:

Actually, we have not only one reader and one writer, but exactly one
thread doing all the work on the fifo. No parallel access is done at
all.

>   ret = kfifo_out(&ud->recv_queue,
>   vec[0].iov_base + total, next);
> 
> 
> v> +  total += next;
> > +   continue;
> > +   }
> > +
> > +   /* See usbip_sendmsg() for the format of one encrypted packet */
> > +
> > +   /*
> > +* Receive size of next crypto packet
> > +*/
> > +   recvvec.iov_base = &packetsize;
> > +   recvvec.iov_len = sizeof(packetsize);
> > +
> > +   ret = kernel_recvmsg(ud->tcp_socket, msg, &recvvec, 1,
> > +   sizeof(packetsize), flags);
> > +   packetsize = be32_to_cpu(packetsize);
> > +   if (ret <= 0) {
> 
> I think a return of zero should mean total = -EBADMSG;.  In other words
> this check should be "if (ret < 0) {" and we hit the next else if.
> Same below again.

As we are wrapping kernel_recvmsg here, we wanted to leave the semantics
intact as far as possible. The calling code already checks for the correct
size.

> > +   total = ret;
> > +   goto err;
> > +   } else if (ret != sizeof(packetsize)) {
> > +   total = -EBADMSG;
> > +   goto err;
> > +   }

On Mon, Sep 23, 2013 at 01:35:04PM +0300, Dan Carpenter wrote:
> On Thu, Sep 19, 2013 at 04:11:57PM +0200, Dominik Paulus wrote:
> > +   if (crypto_aead_setkey(ud->tfm_send, sendkey, USBIP_KEYSIZE) != 0 ||
> > +   crypto_aead_setkey(ud->tfm_recv, recvkey,
> > +   USBIP_KEYSIZE) != 0 ||
> > +   crypto_aead_setauthsize(ud->tfm_send,
> > +   USBIP_AUTHSIZE) != 0 ||
> > +   crypto_aead_setauthsize(ud->tfm_recv,
> > +   USBIP_AUTHSIZE)) {
> > +   crypto_free_aead(ud->tfm_recv);
> > +   crypto_free_aead(ud->tfm_send);
> > +   kfifo_free(&ud->recv_queue);
> > +   }
> 
> This returns success on error instead of failure.

Indeed, that was horribly broken. Thanks.

On Mon, Sep 23, 2013 at 01:58:42PM +0300, Dan Carpenter wrote:
> On Thu, Sep 19, 2013 at 04:11:57PM +0200, Dominik Paulus wrote:
> > +{
> > +   struct crypto_aead *tfm;
> > +   struct aead_request *req;
> > +   struct tcrypt_result result;
> > +   struct scatterlist plain, cipher, assoc;
> > +   char iv[16];
> > +   u64 *iv_num;
> > +   u64 iv_net;
> > +   const int plainsize = packetsize - USBIP_AUTHSIZE;
> 
> Is it possible that packetsize is less than USBIP_AUTHSIZE?

No, currently, the caller (usbip_sendmsg() / usbip_recvmsg() are the
only functions calling usbip_crypt(), which itself is static) ensures
this.
Admittedly, this isn't great design. We added a check for packetsize <
USBIP_AUTHSIZE and an appropiate return here.

> > +   if (encrypt)
> > +   ret = crypto_aead_encrypt(req);
> > +   else
> > +   ret = crypto_aead_decrypt(req);
> > +
> 
> Good on you for figuring out what crypto_aead_en/decrypt() returns.
> Where are these functions documented?
> 
> > +switch (ret) {
> > +case 0: /* Success */
> > +break;
> > +case -EINPROGRESS:
> > +case -EBUSY:
> > +wait_for_completion(&result.completion);
> > +break;
> > +default:
> > +aead_request_free(req);
> > +return ret;
> > +}
> > +

They aren't, actually. Documentation/crypto/api-intro.txt refers to the
regression test module, which uses exactly those return-values in
crypto/testmgr.c.
We noticed that wait_for_completion might not be the best idea, since it could
hang indefinitely, testmgr.c uses wait_for_completion_interruptible. Do we
want 'interruptible' or 'killable' here?
(Also we forgot to error-check result.err afterwards. We also fixed that.)

Regards,
Dominik Paulus, Tobias Polzer

Re: [PATCH 00/19] staging: comedi: pcl726: cleanup driver

2013-09-26 Thread Ian Abbott

On 2013-09-25 23:34, H Hartley Sweeten wrote:

Cleanup another comedi driver.

Add support for the external interrupt on the ACL-6126 board.

H Hartley Sweeten (19):
   staging: comedi: pcl726: convert boardinfo declaration to C99 format
   staging: comedi: core: introduce comedi_chan_range_is_{bi,uni}polar()
   staging: comedi: pcl726: remove 'bipolar' from the private data
   staging: comedi: pcl726: tidy up pcl726_ao_insn()
   staging: comedi: pcl726: tidy up pcl726_ao_insn_read()
   staging: comedi: pcl726: remove all '= 0' boardinfo
   staging: comedi: pcl726: enable the interrupt support code
   staging: comedi: pcl726: fix the analog output range_table_list 
initialization
   staging: comedi: pcl726: tidy up pcl726_attach()
   staging: comedi: pcl726: remove digital i/o register offsets from boardinfo
   staging: comedi: pcl726: tidy up the comedi_lrange code
   staging: comedi: pcl726: rename boardinfo 'IRQbits'
   staging: comedi: pcl726: remove unnecessary comments in boardinfo definition
   staging: comedi: pcl726: remove the *_SIZE defines
   staging: comedi: pcl726: final tidy up of boardinfo
   staging: comedi: pcl726: add support for the external interrupt signal
   staging: comedi: pcl726: tidy up multi-line comments
   staging: comedi: pcl726: update MODULE_DESCRIPTION
   staging: comedi: pcl726: rename 'boardtypes'

  drivers/staging/comedi/comedidev.h  |  14 +
  drivers/staging/comedi/drivers/pcl726.c | 581 +++-
  2 files changed, 359 insertions(+), 236 deletions(-)


Looks okay.  The various identifiers prefixed with "pcl818_" (patches 07 
and 16) seems a poor choice though.


Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail: )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: comedi: pcl711: handle cmd->stop_src and stop_arg

2013-09-26 Thread Ian Abbott
The interrupt handler used to support asynchronous commands on the AI
subdevice currently marks the command as finished (setting the "end of
acquisition" event flag and returning to software-triggered acquisition
mode) once it has decremented `devpriv->ntrig` to 0.  However, nothing
sets `devpriv->ntrig`, as noted in the "FIXME" comment.

If the `stop_src` setting of the asynchronous command is `TRIG_COUNT`,
then the `stop_arg` setting indicates the number of scans to be
performed in the overall acquisition.  (Otherwise, `stop_src` will be
`TRIG_NONE`, meaning the acquisition should run indefinitely until
cancelled.)  When starting the acquisition in `pcl711_ai_cmd()`, set
`devpriv->ntrig` to the number of scans to be performed (`stop_arg`) if
`stop_src` is `TRIG_COUNT`.  In the interrupt handler, don't decrement
`devpriv->ntrig` or handle end of acquision unless `stop_src` is
`TRIG_COUNT`.

Also check for an empty acquisition in `pcl711_ai_cmd()`, i.e. one where
`stop_src` is `TRIG_COUNT` and `stop_arg` is zero and just mark end of
acquisition without actually setting up the interrupts in this case.

Also change the type of the `ntrig` member of the private data structure
to `unsigned int` as it should be (same type as `stop_arg`).

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/pcl711.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl711.c 
b/drivers/staging/comedi/drivers/pcl711.c
index 939a11f..daa78fa 100644
--- a/drivers/staging/comedi/drivers/pcl711.c
+++ b/drivers/staging/comedi/drivers/pcl711.c
@@ -156,7 +156,7 @@ static const struct pcl711_board boardtypes[] = {
 };
 
 struct pcl711_private {
-   int ntrig;
+   unsigned int ntrig;
unsigned int ao_readback[2];
unsigned int divisor1;
unsigned int divisor2;
@@ -213,10 +213,8 @@ static irqreturn_t pcl711_interrupt(int irq, void *d)
 
outb(PCL711_INT_STAT_CLR, dev->iobase + PCL711_INT_STAT_REG);
 
-   /* FIXME! Nothing else sets ntrig! */
-   if (!(--devpriv->ntrig)) {
+   if (s->async->cmd.stop_src == TRIG_COUNT && !(--devpriv->ntrig)) {
pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG);
-
s->async->events |= COMEDI_CB_EOA;
}
comedi_event(dev, s);
@@ -367,6 +365,16 @@ static int pcl711_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
 
pcl711_set_changain(dev, s, cmd->chanlist[0]);
 
+   if (cmd->stop_src == TRIG_COUNT) {
+   if (cmd->stop_arg == 0) {
+   /* an empty acquisition */
+   s->async->events |= COMEDI_CB_EOA;
+   comedi_event(dev, s);
+   return 0;
+   }
+   devpriv->ntrig = cmd->stop_arg;
+   }
+
if (cmd->scan_begin_src == TRIG_TIMER) {
i8254_load(dev->iobase + PCL711_TIMER_BASE, 0,
   1, devpriv->divisor1, I8254_MODE2 | I8254_BINARY);
-- 
1.8.3.2

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


[PATCH 3/3] staging: comedi: pcl711: put acquired data in buffer for AI command

2013-09-26 Thread Ian Abbott
The asynchronous command support for the AI subdevice is still missing
one crucial element, it doesn't actually put the acquired data in the
buffer so it can be read()!  Call `comedi_buf_put()` from the interrupt
handler to perform this function.  A return value of 0 from
`comedi_buf_put()` means there was no room in the buffer so set the
`COMEDI_CB_OVERFLOW` and `COMEDI_CB_ERROR` event flags in that case.
Otherwise, set the `COMEDI_CB_BLOCK` and `COMEDI_CB_EOS` event flags to
mark the end of a "scan" (the scan length is currently fixed at one
sample in this driver).

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/pcl711.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl711.c 
b/drivers/staging/comedi/drivers/pcl711.c
index daa78fa..e170f8a 100644
--- a/drivers/staging/comedi/drivers/pcl711.c
+++ b/drivers/staging/comedi/drivers/pcl711.c
@@ -213,9 +213,15 @@ static irqreturn_t pcl711_interrupt(int irq, void *d)
 
outb(PCL711_INT_STAT_CLR, dev->iobase + PCL711_INT_STAT_REG);
 
-   if (s->async->cmd.stop_src == TRIG_COUNT && !(--devpriv->ntrig)) {
-   pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG);
-   s->async->events |= COMEDI_CB_EOA;
+   if (comedi_buf_put(s->async, (short)data) == 0) {
+   s->async->events |= COMEDI_CB_OVERFLOW | COMEDI_CB_ERROR;
+   } else {
+   s->async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS;
+   if (s->async->cmd.stop_src == TRIG_COUNT &&
+   !(--devpriv->ntrig)) {
+   pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG);
+   s->async->events |= COMEDI_CB_EOA;
+   }
}
comedi_event(dev, s);
return IRQ_HANDLED;
-- 
1.8.3.2

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


[PATCH 0/3] staging: comedi: pcl711: fix up AI command support

2013-09-26 Thread Ian Abbott
As noted by Hartley in
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2013-September/041560.html
async command support (for the AI subdevice) is broken.  This small
series of patches should get it working.

1) staging: comedi: pcl711: add AI cancel handler
2) staging: comedi: pcl711: handle cmd->stop_src and stop_arg
3) staging: comedi: pcl711: put acquired data in buffer for AI command

 drivers/staging/comedi/drivers/pcl711.c | 35 +++--
 1 file changed, 29 insertions(+), 6 deletions(-)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: comedi: pcl711: add AI cancel handler

2013-09-26 Thread Ian Abbott
Comedi subdevices that support asynchronous commands should have a
'cancel' handler to stop an in-progress command.  Add such a handler to
the pcl711 driver module.  I think merely setting the acquisition mode
to "software-triggered" would be sufficient, but also clear the
interrupt status for good luck.

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/pcl711.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/staging/comedi/drivers/pcl711.c 
b/drivers/staging/comedi/drivers/pcl711.c
index eb800be..939a11f 100644
--- a/drivers/staging/comedi/drivers/pcl711.c
+++ b/drivers/staging/comedi/drivers/pcl711.c
@@ -189,6 +189,14 @@ static unsigned int pcl711_ai_get_sample(struct 
comedi_device *dev,
return val & s->maxdata;
 }
 
+static int pcl711_ai_cancel(struct comedi_device *dev,
+   struct comedi_subdevice *s)
+{
+   outb(PCL711_INT_STAT_CLR, dev->iobase + PCL711_INT_STAT_REG);
+   pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG);
+   return 0;
+}
+
 static irqreturn_t pcl711_interrupt(int irq, void *d)
 {
struct comedi_device *dev = d;
@@ -493,6 +501,7 @@ static int pcl711_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
s->len_chanlist = 1;
s->do_cmdtest   = pcl711_ai_cmdtest;
s->do_cmd   = pcl711_ai_cmd;
+   s->cancel   = pcl711_ai_cancel;
}
 
/* Analog Output subdevice */
-- 
1.8.3.2

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


Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

2013-09-26 Thread Takashi Iwai
At Thu, 26 Sep 2013 10:25:13 +0200,
Takashi Iwai wrote:
> 
> At Thu, 26 Sep 2013 08:54:25 +0100,
> Russell King - ARM Linux wrote:
> > 
> > On Thu, Sep 26, 2013 at 09:51:23AM +0200, Takashi Iwai wrote:
> > > Hi,
> > > 
> > > sorry for the lat response, as I've been traveling in the last weeks.
> > > 
> > > At Thu, 19 Sep 2013 22:53:02 +0100,
> > > Russell King wrote:
> > > > 
> > > > This code sequence is unsafe in modules:
> > > > 
> > > > static u64 mask = DMA_BIT_MASK(something);
> > > > ...
> > > > if (!dev->dma_mask)
> > > > dev->dma_mask = &mask;
> > > > 
> > > > as if a module is reloaded, the mask will be pointing at the original
> > > > module's mask address, and this can lead to oopses.  Moreover, they
> > > > all follow this with:
> > > > 
> > > > if (!dev->coherent_dma_mask)
> > > > dev->coherent_dma_mask = mask;
> > > > 
> > > > where 'mask' is the same value as the statically defined mask, and this
> > > > bypasses the architecture's check on whether the DMA mask is possible.
> > > > 
> > > > Fix these issues by using the new dma_coerce_coherent_and_mask()
> > > > function.
> > > > 
> > > > Signed-off-by: Russell King 
> > > 
> > > Applied with Mark's ack now.
> > 
> > Which is a very stupid thing to do because you won't have
> > dma_coerce_coherent_and_mask() in your tree, so all these drivers
> > will fail to build for you.
> 
> Ah, silly me, I missed the very first thing.  Reverted it now...
> 
> FWIW, below is the missing piece.  Please apply it in your side if
> necessary.

Oh, and feel free to add my ack, if any:

Acked-by: Takashi Iwai 


thanks,

Takashi

> 
> 
> Takashi
> 
> ---
>  sound/soc/fsl/imx-pcm-fiq.c | 12 +---
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
> index 34043c5..fd5f2fb 100644
> --- a/sound/soc/fsl/imx-pcm-fiq.c
> +++ b/sound/soc/fsl/imx-pcm-fiq.c
> @@ -272,18 +272,16 @@ static int imx_pcm_preallocate_dma_buffer(struct 
> snd_pcm *pcm, int stream)
>   return 0;
>  }
>  
> -static u64 imx_pcm_dmamask = DMA_BIT_MASK(32);
> -
>  static int imx_pcm_new(struct snd_soc_pcm_runtime *rtd)
>  {
>   struct snd_card *card = rtd->card->snd_card;
>   struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
> +
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>  
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &imx_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
>   if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
>   ret = imx_pcm_preallocate_dma_buffer(pcm,
>   SNDRV_PCM_STREAM_PLAYBACK);
> -- 
> 1.8.4
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

2013-09-26 Thread Takashi Iwai
At Thu, 26 Sep 2013 08:54:25 +0100,
Russell King - ARM Linux wrote:
> 
> On Thu, Sep 26, 2013 at 09:51:23AM +0200, Takashi Iwai wrote:
> > Hi,
> > 
> > sorry for the lat response, as I've been traveling in the last weeks.
> > 
> > At Thu, 19 Sep 2013 22:53:02 +0100,
> > Russell King wrote:
> > > 
> > > This code sequence is unsafe in modules:
> > > 
> > > static u64 mask = DMA_BIT_MASK(something);
> > > ...
> > >   if (!dev->dma_mask)
> > >   dev->dma_mask = &mask;
> > > 
> > > as if a module is reloaded, the mask will be pointing at the original
> > > module's mask address, and this can lead to oopses.  Moreover, they
> > > all follow this with:
> > > 
> > >   if (!dev->coherent_dma_mask)
> > >   dev->coherent_dma_mask = mask;
> > > 
> > > where 'mask' is the same value as the statically defined mask, and this
> > > bypasses the architecture's check on whether the DMA mask is possible.
> > > 
> > > Fix these issues by using the new dma_coerce_coherent_and_mask()
> > > function.
> > > 
> > > Signed-off-by: Russell King 
> > 
> > Applied with Mark's ack now.
> 
> Which is a very stupid thing to do because you won't have
> dma_coerce_coherent_and_mask() in your tree, so all these drivers
> will fail to build for you.

Ah, silly me, I missed the very first thing.  Reverted it now...

FWIW, below is the missing piece.  Please apply it in your side if
necessary.


Takashi

---
 sound/soc/fsl/imx-pcm-fiq.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 34043c5..fd5f2fb 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -272,18 +272,16 @@ static int imx_pcm_preallocate_dma_buffer(struct snd_pcm 
*pcm, int stream)
return 0;
 }
 
-static u64 imx_pcm_dmamask = DMA_BIT_MASK(32);
-
 static int imx_pcm_new(struct snd_soc_pcm_runtime *rtd)
 {
struct snd_card *card = rtd->card->snd_card;
struct snd_pcm *pcm = rtd->pcm;
-   int ret = 0;
+   int ret;
+
+   ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
+   if (ret)
+   return ret;
 
-   if (!card->dev->dma_mask)
-   card->dev->dma_mask = &imx_pcm_dmamask;
-   if (!card->dev->coherent_dma_mask)
-   card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
ret = imx_pcm_preallocate_dma_buffer(pcm,
SNDRV_PCM_STREAM_PLAYBACK);
-- 
1.8.4
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

2013-09-26 Thread Russell King - ARM Linux
On Thu, Sep 26, 2013 at 09:51:23AM +0200, Takashi Iwai wrote:
> Hi,
> 
> sorry for the lat response, as I've been traveling in the last weeks.
> 
> At Thu, 19 Sep 2013 22:53:02 +0100,
> Russell King wrote:
> > 
> > This code sequence is unsafe in modules:
> > 
> > static u64 mask = DMA_BIT_MASK(something);
> > ...
> > if (!dev->dma_mask)
> > dev->dma_mask = &mask;
> > 
> > as if a module is reloaded, the mask will be pointing at the original
> > module's mask address, and this can lead to oopses.  Moreover, they
> > all follow this with:
> > 
> > if (!dev->coherent_dma_mask)
> > dev->coherent_dma_mask = mask;
> > 
> > where 'mask' is the same value as the statically defined mask, and this
> > bypasses the architecture's check on whether the DMA mask is possible.
> > 
> > Fix these issues by using the new dma_coerce_coherent_and_mask()
> > function.
> > 
> > Signed-off-by: Russell King 
> 
> Applied with Mark's ack now.

Which is a very stupid thing to do because you won't have
dma_coerce_coherent_and_mask() in your tree, so all these drivers
will fail to build for you.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] add exFAT driver

2013-09-26 Thread Anton Altaparmakov
Hi,

On 25 Sep 2013, at 23:29, Alexander Holler  wrote:
> Am 26.09.2013 00:10, schrieb Greg Kroah-Hartman:
>> Please stick to technical discussions about the code on the kernel
>> mailing lists.  Legal discussions can be left up to the lawyers, of
>> which we are not.
> 
> Hmm, but I would like to know if someone has to fear getting owned by
> Microsoft if he would use that driver.
> 
> Giving the rumours about Linux companies having to pay Microsoft and
> giving the fact that all of those licencees seem to don't have to speak
> about what Microsoft claims patents for and for what they have to pay, I
> obviously think adding that driver to Linux and thus making exFAT more
> general accepted is a very bad idea.
> 
> Of course, I'm not a lawyer too, but as a responsible Linux developer, I
> should at least be able to warn other parities when they approach me and
> want to use exFAT. Doing such without the maybe necessary license might
> drive small companies into the ground because most of them are unable to
> even think about having the money needed to talk with Microsoft lawyers
> in front of a court.


Exactly.  That is all I was trying to do.  Warn people/companies not to use the 
driver because they may get sued for using it.  As the below Microsoft exFAT 
licensing page says at the bottom:


Please note that open source or other publicly available implementations of 
exFAT do not include an IP license from Microsoft. For licensing information, 
please contact iplic...@microsoft.com.


Above is from bottom of:


http://www.microsoft.com/en-us/legal/intellectualproperty/IPLicensing/Programs/exFATFileSystem.aspx

Best regards,

Anton
-- 
Anton Altaparmakov  (replace at with @)
Unix Support, Computing Service, University of Cambridge
J.J. Thomson Avenue, Cambridge, CB3 0RB, UK

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


Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

2013-09-26 Thread Takashi Iwai
Hi,

sorry for the lat response, as I've been traveling in the last weeks.

At Thu, 19 Sep 2013 22:53:02 +0100,
Russell King wrote:
> 
> This code sequence is unsafe in modules:
> 
> static u64 mask = DMA_BIT_MASK(something);
> ...
>   if (!dev->dma_mask)
>   dev->dma_mask = &mask;
> 
> as if a module is reloaded, the mask will be pointing at the original
> module's mask address, and this can lead to oopses.  Moreover, they
> all follow this with:
> 
>   if (!dev->coherent_dma_mask)
>   dev->coherent_dma_mask = mask;
> 
> where 'mask' is the same value as the statically defined mask, and this
> bypasses the architecture's check on whether the DMA mask is possible.
> 
> Fix these issues by using the new dma_coerce_coherent_and_mask()
> function.
> 
> Signed-off-by: Russell King 

Applied with Mark's ack now.

BTW, sound/soc/fsl/imx-pcm-fiq.c wasn't covered by this patch, so I
fixed it, too.


Thanks!

Takashi


> ---
>  sound/arm/pxa2xx-pcm.c  |9 +++--
>  sound/soc/atmel/atmel-pcm.c |   11 ---
>  sound/soc/blackfin/bf5xx-ac97-pcm.c |   11 ---
>  sound/soc/blackfin/bf5xx-i2s-pcm.c  |   10 --
>  sound/soc/davinci/davinci-pcm.c |9 +++--
>  sound/soc/fsl/fsl_dma.c |9 +++--
>  sound/soc/fsl/mpc5200_dma.c |   10 --
>  sound/soc/jz4740/jz4740-pcm.c   |   12 
>  sound/soc/kirkwood/kirkwood-dma.c   |9 +++--
>  sound/soc/nuc900/nuc900-pcm.c   |9 -
>  sound/soc/omap/omap-pcm.c   |   11 ---
>  sound/soc/pxa/pxa2xx-pcm.c  |   11 ---
>  sound/soc/s6000/s6000-pcm.c |9 +++--
>  sound/soc/samsung/dma.c |   11 ---
>  sound/soc/samsung/idma.c|   11 ---
>  15 files changed, 55 insertions(+), 97 deletions(-)
> 
> diff --git a/sound/arm/pxa2xx-pcm.c b/sound/arm/pxa2xx-pcm.c
> index 69a2455..fb3b76f 100644
> --- a/sound/arm/pxa2xx-pcm.c
> +++ b/sound/arm/pxa2xx-pcm.c
> @@ -83,8 +83,6 @@ static struct snd_pcm_ops pxa2xx_pcm_ops = {
>   .mmap   = pxa2xx_pcm_mmap,
>  };
>  
> -static u64 pxa2xx_pcm_dmamask = 0x;
> -
>  int pxa2xx_pcm_new(struct snd_card *card, struct pxa2xx_pcm_client *client,
>  struct snd_pcm **rpcm)
>  {
> @@ -100,10 +98,9 @@ int pxa2xx_pcm_new(struct snd_card *card, struct 
> pxa2xx_pcm_client *client,
>   pcm->private_data = client;
>   pcm->private_free = pxa2xx_pcm_free_dma_buffers;
>  
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &pxa2xx_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = 0x;
> + ret = dma_coerce_mask_and_coherent_mask(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + goto out;
>  
>   if (play) {
>   int stream = SNDRV_PCM_STREAM_PLAYBACK;
> diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c
> index 3109db7..fbb87e3 100644
> --- a/sound/soc/atmel/atmel-pcm.c
> +++ b/sound/soc/atmel/atmel-pcm.c
> @@ -68,18 +68,15 @@ int atmel_pcm_mmap(struct snd_pcm_substream *substream,
>  }
>  EXPORT_SYMBOL_GPL(atmel_pcm_mmap);
>  
> -static u64 atmel_pcm_dmamask = DMA_BIT_MASK(32);
> -
>  int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd)
>  {
>   struct snd_card *card = rtd->card->snd_card;
>   struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
>  
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &atmel_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>  
>   if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
>   pr_debug("atmel-pcm: allocating PCM playback DMA buffer\n");
> diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c 
> b/sound/soc/blackfin/bf5xx-ac97-pcm.c
> index 53f8408..1d4c676 100644
> --- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
> +++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
> @@ -415,19 +415,16 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm 
> *pcm)
>   }
>  }
>  
> -static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
> -
>  static int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd)
>  {
>   struct snd_card *card = rtd->card->snd_card;
>   struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
>  
>   pr_debug("%s enter\n", __func__);
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &bf5xx_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>  
>   if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
>   ret = bf5xx_pcm_preallocate_dma_buf

Re: [PATCH] add exFAT driver

2013-09-26 Thread Anton Altaparmakov
Hi,

On 25 Sep 2013, at 23:10, Greg Kroah-Hartman  wrote:
> On Wed, Sep 25, 2013 at 10:44:15PM +0100, Anton Altaparmakov wrote:
>> On 25 Sep 2013, at 21:21, Greg Kroah-Hartman  
>> wrote:
>>> On Wed, Sep 25, 2013 at 09:28:56PM +0200, Alexander Holler wrote:
 
 Maybe a silly question, but isn't exFAT protected by some MS owned
 patents which might drive Linux users into the hand of MS lawyers as
 already happened with FAT?
>> 
>> Yes, it is.  You cannot use exFAT without a Microsoft patent license
>> (unless you live in countries without software patents perhaps).
> 
> Given that you that you are not a Microsoft representative, nor a
> Samsung employee, I don't understand how you can make such a definitive
> statement.

Have you actually read the source code that was released?

May I quote just one bit:

from exfat_1.2.4/exfat.c (available from http://opensource.samsung.com - just 
search for exfat) at the top:

/* Some of the source code in this file came from "linux/fs/fat/misc.c".  */
/*
 *  linux/fs/fat/misc.c
 *
 *  Written 1992,1993 by Werner Almesberger
 *  22/11/2000 - Fixed fat_date_unix2dos for dates earlier than 01/01/1980
 * and date_dos2unix for date==0 by Igor Zhbanov(b...@uniyar.ac.ru)
 */

That is somewhat conclusively a derivative work is it not?

Also, have a read of this article:

http://www.phoronix.com/scan.php?page=news_item&px=MTQzODQ

Which explains further who made them open source it after they saw the leaked 
code on github.

So even without resorting to knowledge I may not discuss it is pretty 
conclusive that what I said is correct as anyone driving google can find for 
themselves as I pointed out above...

 It would make me wonder if not. Maybe you could ask Samsung about
 that too, when you are there.
>>> 
>>> Because Samsung released the code under the GPLv2, and their lawyers
>>> understand what that means, should answer any question you might have
>>> about this.
>> 
>> Sorry but you have no idea what you are talking about.
> 
> Ah, that's a lovely way to engage in a conversation.

I did say sorry!  (-;

>> Samsung modified the GPL-ed FAT driver to make it work with exFAT.
>> Therefore their exFAT driver was GPL as a derived work.  They got
>> caught and had to release the source code.
> 
> And now you claim to be a Samsung representative again, I think your
> country has some bad liable laws you might wish to watch out for...

I am not claiming anything and least of all to be representing Samsung!!!

Libel implies untruth and as you can see above I am only stating what anyone 
can readily find on google.

> This isn't going to go very far, so I'll just not respond anymore, it's
> not going to be productive, and given that I don't see your name on the
> code here, I don't see why I need to.
> 
> Please stick to technical discussions about the code on the kernel
> mailing lists.  Legal discussions can be left up to the lawyers, of
> which we are not.


I agree, but then please stop making public assertions that people can use the 
exfat driver legally.  You just yourself said you are not a lawyer so I do not 
understand how you can make your assertion!

If anyone cares, here is Microsoft's exFAT licensing page which I strongly 
recommend you read before you use that driver:


http://www.microsoft.com/en-us/legal/intellectualproperty/IPLicensing/Programs/exFATFileSystem.aspx

Also if you search google for "exFAT patent" you can find some that way but 
there are also others that are not found that way but that are clearly 
essential for any exFAT implementation (according to the technical review I did 
of them).  I am not sure whether I am allowed to give a list or not so I will 
refrain from doing so.

Best regards,

Anton
-- 
Anton Altaparmakov  (replace at with @)
Unix Support, Computing Service, University of Cambridge
J.J. Thomson Avenue, Cambridge, CB3 0RB, UK

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