Re: [PATCH] staging: lustre: llite: Use kzalloc and rewrite null tests

2014-09-19 Thread Dan Carpenter
On Fri, Sep 19, 2014 at 02:57:03AM +, Drokin, Oleg wrote:
> 4. Sometimes we need large allocations. general kmalloc is less
> reliable as system lives on and memory fragmentation worsens. So we
> have this "allocations over 2-4 pages get switched to vmalloc" logic,
> if there's a way to do that automatically - that would be great.

Julia's patch only changes OBD_ALLOC() functions and those are always
kmalloc so that's not an issue here.

The OBD_ALLOC_LARGE() macro is vmalloc() or kmalloc() if the size is
small enough.  We don't really want to choose between kmalloc and
vmalloc automatically.  My instinct is that we should change all the
OBD_ALLOC_LARGE() to vmalloc() and trust it to allocate them in the most
sane way possible.  But I haven't really looked very closely.

regards,
dan carpenter

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


Re: iMX Coding Style Patch

2014-09-19 Thread Dan Carpenter
On Thu, Sep 18, 2014 at 11:55:36PM +0200, Rene Kolarik wrote:
> Hello,
> 
> I'm sending this as a part of Eudyptula Challenge.
> 
> Rene Kolarik 

Send it inline.
Read the first paragraph of Documentation/email-clients.txt.
Choose a better subject.
Add a patch description.
Split it into one type of change per patch.
Add a signed-off-by line.

regards,
dan carpenter

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


[patch 1/2] staging: vt6655: buffer overflow in ioctl

2014-09-19 Thread Dan Carpenter
->u.generic_elem.len is a user controlled number between 0-255.  We
should limit it to avoid memory corruption.

Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
index 0dd87d4..73429f4 100644
--- a/drivers/staging/vt6655/hostap.c
+++ b/drivers/staging/vt6655/hostap.c
@@ -341,6 +341,9 @@ static int hostap_set_generic_element(struct vnt_private 
*pDevice,
 {
PSMgmtObjectpMgmt = pDevice->pMgmt;
 
+   if (param->u.generic_elem.len > sizeof(pMgmt->abyWPAIE))
+   return -EINVAL;
+
memcpy(pMgmt->abyWPAIE,
   param->u.generic_elem.data,
   param->u.generic_elem.len
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 1/8] staging: comedi: ni_usb6501: add counter commands

2014-09-19 Thread Luca Ellero
Signed-off-by: Luca Ellero 
---
 drivers/staging/comedi/drivers/ni_usb6501.c |   29 ++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
b/drivers/staging/comedi/drivers/ni_usb6501.c
index 6a4f965..f0b8f11 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -98,6 +98,24 @@ static const u8 SET_PORT_DIR_REQUEST[]   = {0x00, 0x01, 
0x00, 0x18,
   0x00, 0x00, 0x05, 0x00,
   0x00, 0x00, 0x00, 0x00};
 
+/* Counter request packets */
+static const u8 START_COUNTER_REQUEST[]= {0x00, 0x01, 0x00, 0x0C,
+  0x00, 0x08, 0x01, 0x09,
+  0x02, 0x20, 0x00, 0x00};
+
+static const u8 STOP_COUNTER_REQUEST[] = {0x00, 0x01, 0x00, 0x0C,
+  0x00, 0x08, 0x01, 0x0C,
+  0x02, 0x20, 0x00, 0x00};
+
+static const u8 READ_COUNTER_REQUEST[] = {0x00, 0x01, 0x00, 0x0C,
+  0x00, 0x08, 0x01, 0x0E,
+  0x02, 0x20, 0x00, 0x00};
+
+static const u8 WRITE_COUNTER_REQUEST[]= {0x00, 0x01, 0x00, 0x10,
+  0x00, 0x0C, 0x01, 0x0F,
+  0x02, 0x20, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00};
+
 /* Response packets */
 static const u8 GENERIC_RESPONSE[] = {0x00, 0x01, 0x00, 0x0C,
   0x00, 0x08, 0x01, 0x00,
@@ -108,10 +126,19 @@ static const u8 READ_PORT_RESPONSE[]  = {0x00, 0x01, 
0x00, 0x10,
   0x00, 0x00, 0x00, 0x02,
   0x00, 0x03, 0x00, 0x00};
 
+static const u8 READ_COUNTER_RESPONSE[]= {0x00, 0x01, 0x00, 0x10,
+  0x00, 0x0C, 0x01, 0x00,
+  0x00, 0x00, 0x00, 0x02,
+  0x00, 0x00, 0x00, 0x00};
+
 enum commands {
READ_PORT,
WRITE_PORT,
-   SET_PORT_DIR
+   SET_PORT_DIR,
+   START_COUNTER,
+   STOP_COUNTER,
+   READ_COUNTER,
+   WRITE_COUNTER
 };
 
 struct ni6501_private {
-- 
1.7.10.4

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


[PATCH v3 0/8] comedi: ni_usb6501: add counter support

2014-09-19 Thread Luca Ellero
This series of patches add counter support for NI USB-6501. I tested it on my
device and it works fine.

Changes for v2:
- rewrite patch 3/9 changelog: replace "fix" with "cleanup"
- avoid sparse warnings
- add SDF_LSAMPL flag to counter subdevice

Changes for v3:
- remove useless checks
- remove empty lines
- ni6501_auto_attach(): replace spaces with tabs for proper alignment
- squash last 5 patches into a single patch (add counter subdevice) to avoid 
  compilation warnings "function defined but not used"
- rename "counter" local vars to "val" to avoid ambiguity with counter number
- let ni6501_cnt_insn_config() return the insn->n value if it succeeds
- let ni6501_cnt_insn_read read insn->n values
- let ni6501_cnt_insn_write be able to handle an array of values

Luca Ellero (8):
  staging: comedi: ni_usb6501: add counter commands
  staging: comedi: ni_usb6501: update comments
  staging: comedi: ni_usb6501: cleanup response_size
  staging: comedi: ni_usb6501: replace spaces with tabs
  staging: comedi: ni_usb6501: remove useless check
  staging: comedi: ni_usb6501: remove empty lines
  staging: comedi: ni_usb6501: rename ni6501_send_command()
  staging: comedi: ni_usb6501: add counter subdevice

 drivers/staging/comedi/drivers/ni_usb6501.c |  260 +++
 1 file changed, 228 insertions(+), 32 deletions(-)

-- 
1.7.10.4

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


[PATCH v3 7/8] staging: comedi: ni_usb6501: rename ni6501_send_command()

2014-09-19 Thread Luca Ellero
Rename ni6501_send_command to ni6501_port_command

Signed-off-by: Luca Ellero 
---
 drivers/staging/comedi/drivers/ni_usb6501.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
b/drivers/staging/comedi/drivers/ni_usb6501.c
index 7a1d016..bf443af 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -172,7 +172,7 @@ struct ni6501_private {
u8 *usb_tx_buf;
 };
 
-static int ni6501_send_command(struct comedi_device *dev, int command,
+static int ni6501_port_command(struct comedi_device *dev, int command,
   const u8 *port, u8 *bitmap)
 {
struct usb_device *usb = comedi_to_usb_dev(dev);
@@ -270,7 +270,7 @@ static int ni6501_dio_insn_config(struct comedi_device *dev,
port[1] = (s->io_bits >> 8) & 0xff;
port[2] = (s->io_bits >> 16) & 0xff;
 
-   ret = ni6501_send_command(dev, SET_PORT_DIR, port, NULL);
+   ret = ni6501_port_command(dev, SET_PORT_DIR, port, NULL);
if (ret)
return ret;
 
@@ -292,7 +292,7 @@ static int ni6501_dio_insn_bits(struct comedi_device *dev,
for (port = 0; port < 3; port++) {
if (mask & (0xFF << port * 8)) {
bitmap = (s->state >> port * 8) & 0xFF;
-   ret = ni6501_send_command(dev, WRITE_PORT,
+   ret = ni6501_port_command(dev, WRITE_PORT,
  &port, &bitmap);
if (ret)
return ret;
@@ -302,7 +302,7 @@ static int ni6501_dio_insn_bits(struct comedi_device *dev,
data[1] = 0;
 
for (port = 0; port < 3; port++) {
-   ret = ni6501_send_command(dev, READ_PORT, &port, &bitmap);
+   ret = ni6501_port_command(dev, READ_PORT, &port, &bitmap);
if (ret)
return ret;
data[1] |= bitmap << port * 8;
-- 
1.7.10.4

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


[PATCH v3 5/8] staging: comedi: ni_usb6501: remove useless check

2014-09-19 Thread Luca Ellero
Remove useless test in ni6501_send_command. The check is useless since this
function is called only in this driver.

Signed-off-by: Luca Ellero 
---
 drivers/staging/comedi/drivers/ni_usb6501.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
b/drivers/staging/comedi/drivers/ni_usb6501.c
index dd89cdc..eea9c68 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -181,9 +181,6 @@ static int ni6501_send_command(struct comedi_device *dev, 
int command,
u8 *tx = devpriv->usb_tx_buf;
int ret;
 
-   if (!tx || !port)
-   return -EINVAL;
-
if (command != SET_PORT_DIR && !bitmap)
return -EINVAL;
 
-- 
1.7.10.4

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


[PATCH v3 8/8] staging: comedi: ni_usb6501: add counter subdevice

2014-09-19 Thread Luca Ellero
Add counter support for NI USB-6501.

The following functions are introduced:
- ni6501_counter_command()
- ni6501_cnt_insn_config()
- ni6501_cnt_insn_read()
- ni6501_cnt_insn_write()

Signed-off-by: Luca Ellero 
---
 drivers/staging/comedi/drivers/ni_usb6501.c |  167 ++-
 1 file changed, 166 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
b/drivers/staging/comedi/drivers/ni_usb6501.c
index bf443af..df7ada8 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -254,6 +254,96 @@ end:
return ret;
 }
 
+static int ni6501_counter_command(struct comedi_device *dev, int command,
+ u32 *val)
+{
+   struct usb_device *usb = comedi_to_usb_dev(dev);
+   struct ni6501_private *devpriv = dev->private;
+   int request_size, response_size;
+   u8 *tx = devpriv->usb_tx_buf;
+   int ret;
+
+   if ((command == READ_COUNTER || command ==  WRITE_COUNTER) && !val)
+   return -EINVAL;
+
+   down(&devpriv->sem);
+
+   switch (command) {
+   case START_COUNTER:
+   request_size = sizeof(START_COUNTER_REQUEST);
+   response_size = sizeof(GENERIC_RESPONSE);
+   memcpy(tx, START_COUNTER_REQUEST, request_size);
+   break;
+   case STOP_COUNTER:
+   request_size = sizeof(STOP_COUNTER_REQUEST);
+   response_size = sizeof(GENERIC_RESPONSE);
+   memcpy(tx, STOP_COUNTER_REQUEST, request_size);
+   break;
+   case READ_COUNTER:
+   request_size = sizeof(READ_COUNTER_REQUEST);
+   response_size = sizeof(READ_COUNTER_RESPONSE);
+   memcpy(tx, READ_COUNTER_REQUEST, request_size);
+   break;
+   case WRITE_COUNTER:
+   request_size = sizeof(WRITE_COUNTER_REQUEST);
+   response_size = sizeof(GENERIC_RESPONSE);
+   memcpy(tx, WRITE_COUNTER_REQUEST, request_size);
+   /* Setup tx packet: bytes 12,13,14,15 hold the */
+   /* u32 counter value (Big Endian)  */
+   *((__be32 *)&tx[12]) = cpu_to_be32(*val);
+   break;
+   default:
+   ret = -EINVAL;
+   goto end;
+   }
+
+   ret = usb_bulk_msg(usb,
+  usb_sndbulkpipe(usb,
+  devpriv->ep_tx->bEndpointAddress),
+  devpriv->usb_tx_buf,
+  request_size,
+  NULL,
+  NI6501_TIMEOUT);
+   if (ret)
+   goto end;
+
+   ret = usb_bulk_msg(usb,
+  usb_rcvbulkpipe(usb,
+  devpriv->ep_rx->bEndpointAddress),
+  devpriv->usb_rx_buf,
+  response_size,
+  NULL,
+  NI6501_TIMEOUT);
+   if (ret)
+   goto end;
+
+   /* Check if results are valid */
+
+   if (command == READ_COUNTER) {
+   int i;
+
+   /* Read counter value: bytes 12,13,14,15 of rx packet */
+   /* hold the u32 counter value (Big Endian)*/
+   *val = be32_to_cpu(*((__be32 *)&devpriv->usb_rx_buf[12]));
+
+   /* mask counter value for comparing */
+   for (i = 12; i < sizeof(READ_COUNTER_RESPONSE); ++i)
+   devpriv->usb_rx_buf[i] = 0x00;
+
+   if (memcmp(devpriv->usb_rx_buf, READ_COUNTER_RESPONSE,
+  sizeof(READ_COUNTER_RESPONSE))) {
+   ret = -EINVAL;
+   }
+   } else if (memcmp(devpriv->usb_rx_buf, GENERIC_RESPONSE,
+ sizeof(GENERIC_RESPONSE))) {
+   ret = -EINVAL;
+   }
+end:
+   up(&devpriv->sem);
+
+   return ret;
+}
+
 static int ni6501_dio_insn_config(struct comedi_device *dev,
  struct comedi_subdevice *s,
  struct comedi_insn *insn,
@@ -311,6 +401,71 @@ static int ni6501_dio_insn_bits(struct comedi_device *dev,
return insn->n;
 }
 
+static int ni6501_cnt_insn_config(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned int *data)
+{
+   int ret;
+   u32 val = 0;
+
+   switch (data[0]) {
+   case INSN_CONFIG_ARM:
+   ret = ni6501_counter_command(dev, START_COUNTER, NULL);
+   break;
+   case INSN_CONFIG_DISARM:
+   ret = ni6501_counter_command(dev, STOP_COUNTER, NULL);
+   break;
+   case INSN_CONFIG_RESET:
+   ret = ni6501_counter_command(dev, STOP_COUNTER, NULL);
+   if (ret)
+  

[PATCH v3 4/8] staging: comedi: ni_usb6501: replace spaces with tabs

2014-09-19 Thread Luca Ellero
ni6501_auto_attach(): replace spaces with tabs to get proper alignment

Signed-off-by: Luca Ellero 
---
 drivers/staging/comedi/drivers/ni_usb6501.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
b/drivers/staging/comedi/drivers/ni_usb6501.c
index 91c0e22..dd89cdc 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -418,8 +418,8 @@ static int ni6501_auto_attach(struct comedi_device *dev,
s->n_chan   = 24;
s->maxdata  = 1;
s->range_table  = &range_digital;
-   s->insn_bits = ni6501_dio_insn_bits;
-   s->insn_config = ni6501_dio_insn_config;
+   s->insn_bits= ni6501_dio_insn_bits;
+   s->insn_config  = ni6501_dio_insn_config;
 
return 0;
 }
-- 
1.7.10.4

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


[PATCH v3 6/8] staging: comedi: ni_usb6501: remove empty lines

2014-09-19 Thread Luca Ellero
ni6501_send_command(): remove empty lines in case statements

Signed-off-by: Luca Ellero 
---
 drivers/staging/comedi/drivers/ni_usb6501.c |   15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
b/drivers/staging/comedi/drivers/ni_usb6501.c
index eea9c68..7a1d016 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -188,41 +188,26 @@ static int ni6501_send_command(struct comedi_device *dev, 
int command,
 
switch (command) {
case READ_PORT:
-
request_size = sizeof(READ_PORT_REQUEST);
response_size = sizeof(READ_PORT_RESPONSE);
-
memcpy(tx, READ_PORT_REQUEST, request_size);
-
tx[14] = port[0];
-
break;
-
case WRITE_PORT:
-
request_size = sizeof(WRITE_PORT_REQUEST);
response_size = sizeof(GENERIC_RESPONSE);
-
memcpy(tx, WRITE_PORT_REQUEST, request_size);
-
tx[14] = port[0];
tx[17] = bitmap[0];
-
break;
-
case SET_PORT_DIR:
-
request_size = sizeof(SET_PORT_DIR_REQUEST);
response_size = sizeof(GENERIC_RESPONSE);
-
memcpy(tx, SET_PORT_DIR_REQUEST, request_size);
-
tx[14] = port[0];
tx[15] = port[1];
tx[16] = port[2];
-
break;
-
default:
ret = -EINVAL;
goto end;
-- 
1.7.10.4

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


[PATCH v3 3/8] staging: comedi: ni_usb6501: cleanup response_size

2014-09-19 Thread Luca Ellero
Cleanup response_size in ni6501_send_command (READ_PORT command).
No logical/functional change is introduced by this patch.

Signed-off-by: Luca Ellero 
---
 drivers/staging/comedi/drivers/ni_usb6501.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
b/drivers/staging/comedi/drivers/ni_usb6501.c
index c99b693..91c0e22 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -193,8 +193,7 @@ static int ni6501_send_command(struct comedi_device *dev, 
int command,
case READ_PORT:
 
request_size = sizeof(READ_PORT_REQUEST);
-/* 4 additional bytes for READ_PORT request */
-   response_size = sizeof(GENERIC_RESPONSE) + 4;
+   response_size = sizeof(READ_PORT_RESPONSE);
 
memcpy(tx, READ_PORT_REQUEST, request_size);
 
-- 
1.7.10.4

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


Re: [PATCH] staging: lustre: llite: Use kzalloc and rewrite null tests

2014-09-19 Thread Drokin, Oleg

On Sep 19, 2014, at 5:11 AM, Dan Carpenter wrote:

> On Fri, Sep 19, 2014 at 02:57:03AM +, Drokin, Oleg wrote:
>> 4. Sometimes we need large allocations. general kmalloc is less
>> reliable as system lives on and memory fragmentation worsens. So we
>> have this "allocations over 2-4 pages get switched to vmalloc" logic,
>> if there's a way to do that automatically - that would be great.
> 
> Julia's patch only changes OBD_ALLOC() functions and those are always
> kmalloc so that's not an issue here.

That's true. Though it would be strange to convert just a subset of those
allocating macros, and the solution for the OBD_ALLOC_LARGE would
also be needed.
> 
> The OBD_ALLOC_LARGE() macro is vmalloc() or kmalloc() if the size is
> small enough.  We don't really want to choose between kmalloc and
> vmalloc automatically.  My instinct is that we should change all the
> OBD_ALLOC_LARGE() to vmalloc() and trust it to allocate them in the most
> sane way possible.  But I haven't really looked very closely.

We found that vmalloc (at least with larger allocs, I did not look into details)
has quite a big penalty with some internal lock that creates big contention at
production loads.
So of course the desire is there to reduce our allocations when we can.
(additionally on 32 bit arches there's always this issue of vmalloc region
possibly not being large enough to allocate everything we might want whenever
we see a way for that).

Thanks.

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


Re: [HPDD-discuss] [PATCH] staging: lustre: llite: Use kzalloc and rewrite null tests

2014-09-19 Thread Drokin, Oleg
Hello!

   First, thanks for your patches and efforts spent on these cleanups.

On Sep 19, 2014, at 12:45 AM, Julia Lawall wrote:

> With respect to the upper case lower case issue, does the thing need to be
> a macro?  I think that the lowercase is more or less fine, but only if
> what is behind it is a function.

I don't have a strong opinion either way as long as we have all the 
functionality
we need.

> I say more or less fine, because normally in the kernel the special
> allocators have special purposes, eg allocating and initializing the xyz
> structure.  Here what is wanted is a general purpose allocator with lots
> of special tracing features, so it is not quite the same thing.  And one
> can wonder why all of these special tracing features are not relevant to
> the kernel as a whole?

Like I explained in my previous email, many of the tracing features are already
possible to replace with other existing in-kernel mechanisms like kmemleak.

Except the total tally of allocations/frees so that a memleak could be visibly
easily seen on module unload time. I think this would be useful for other
kinds of modules too, not just lustre, so having that as a generic allocator
feature would be cool too.

> In reading through the description of the needed features, it seems like
> only the _ptr extension requires being a macro.  Do we need that?  The

We only need that as a less error-prone way of having
x = obd_kzalloc(sizeof(*x), ….)
…
obd_free(…, sizeof(*x))

Real free function does not take size argument, but we need that for
total allocated/freed accounting. Easy to have disconnect with
the size argument of obd_free to be wrong.

> rest of the kernel manages to do x = kzalloc(sizeof(*x),...) ok.  It's
> unpleasant to have an assignment hidden in this way.  And currently it is
> not used consistently.  There are some OBD_ALLOCs that have the same form.

Yes, those are converted as thy are noticed.

> Sorry for overlooking the frees.  I was focusing on trying one thing at a
> time...

I kind of think it's a related issue.
Touching ones needs to touch the other if not in the same patch then in
a next patch. And that's why I think consideations for what FREEs would need
is needed from the start, so the FREEs removal patch does not goes and patches 
a bunch of just patched allocs.

Thanks.

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


Re: [HPDD-discuss] [PATCH] staging: lustre: llite: Use kzalloc and rewrite null tests

2014-09-19 Thread Julia Lawall


On Fri, 19 Sep 2014, Drokin, Oleg wrote:

> Hello!
>
>First, thanks for your patches and efforts spent on these cleanups.
>
> On Sep 19, 2014, at 12:45 AM, Julia Lawall wrote:
>
> > With respect to the upper case lower case issue, does the thing need to be
> > a macro?  I think that the lowercase is more or less fine, but only if
> > what is behind it is a function.
>
> I don't have a strong opinion either way as long as we have all the 
> functionality
> we need.
>
> > I say more or less fine, because normally in the kernel the special
> > allocators have special purposes, eg allocating and initializing the xyz
> > structure.  Here what is wanted is a general purpose allocator with lots
> > of special tracing features, so it is not quite the same thing.  And one
> > can wonder why all of these special tracing features are not relevant to
> > the kernel as a whole?
>
> Like I explained in my previous email, many of the tracing features are 
> already
> possible to replace with other existing in-kernel mechanisms like kmemleak.
>
> Except the total tally of allocations/frees so that a memleak could be visibly
> easily seen on module unload time. I think this would be useful for other
> kinds of modules too, not just lustre, so having that as a generic allocator
> feature would be cool too.
>
> > In reading through the description of the needed features, it seems like
> > only the _ptr extension requires being a macro.  Do we need that?  The
>
> We only need that as a less error-prone way of having
> x = obd_kzalloc(sizeof(*x), ….)
> …
> obd_free(…, sizeof(*x))
>
> Real free function does not take size argument, but we need that for
> total allocated/freed accounting. Easy to have disconnect with
> the size argument of obd_free to be wrong.
>
> > rest of the kernel manages to do x = kzalloc(sizeof(*x),...) ok.  It's
> > unpleasant to have an assignment hidden in this way.  And currently it is
> > not used consistently.  There are some OBD_ALLOCs that have the same form.
>
> Yes, those are converted as thy are noticed.
>
> > Sorry for overlooking the frees.  I was focusing on trying one thing at a
> > time...
>
> I kind of think it's a related issue.
> Touching ones needs to touch the other if not in the same patch then in
> a next patch. And that's why I think consideations for what FREEs would need
> is needed from the start, so the FREEs removal patch does not goes and 
> patches a bunch of just patched allocs.

Sure, it's fine.

Where do you want to go from here?  Should I propose function definitions
for obd_alloc and obd_free?  Could we leave the vmalloc issue for a future
set of changes?

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


RE: [PATCH v3 0/8] comedi: ni_usb6501: add counter support

2014-09-19 Thread Hartley Sweeten
On Friday, September 19, 2014 4:51 AM, Luca Ellero wrote:
> This series of patches add counter support for NI USB-6501. I tested it on my
> device and it works fine.
>
> Changes for v2:
> - rewrite patch 3/9 changelog: replace "fix" with "cleanup"
> - avoid sparse warnings
> - add SDF_LSAMPL flag to counter subdevice
>
> Changes for v3:
> - remove useless checks
> - remove empty lines
> - ni6501_auto_attach(): replace spaces with tabs for proper alignment
> - squash last 5 patches into a single patch (add counter subdevice) to avoid 
>   compilation warnings "function defined but not used"
> - rename "counter" local vars to "val" to avoid ambiguity with counter number
> - let ni6501_cnt_insn_config() return the insn->n value if it succeeds
> - let ni6501_cnt_insn_read read insn->n values
> - let ni6501_cnt_insn_write be able to handle an array of values
>
> Luca Ellero (8):
>   staging: comedi: ni_usb6501: add counter commands
>   staging: comedi: ni_usb6501: update comments
>   staging: comedi: ni_usb6501: cleanup response_size
>   staging: comedi: ni_usb6501: replace spaces with tabs
>   staging: comedi: ni_usb6501: remove useless check
>   staging: comedi: ni_usb6501: remove empty lines
>   staging: comedi: ni_usb6501: rename ni6501_send_command()
>   staging: comedi: ni_usb6501: add counter subdevice
>
>  drivers/staging/comedi/drivers/ni_usb6501.c |  260 
> +++
>  1 file changed, 228 insertions(+), 32 deletions(-)

Looks good. Thanks for doing this.

Reviewed-by: H Hartley Sweeten 

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


Award Winnings!!!

2014-09-19 Thread Swiss-Neds Lotto
Leeuwarden, The Netherlands.
https://www.swisslotto.ch/


Swiss-Nederland’s Winning Notification..!!!CONGRATULATION YOU ARE A 
WINNER!!!.

The Board of Directors, members of staff and the International Promotion 
Department of the SWISS-LOTTO Satellite lottery, Netherlands wishes to inform 
you that your e-mail address emerged as late you on your success as the STAR 
PRIZE WINNER in this years' SWISS-LOTTO Satellite lottery Netherlands 
International Promotion (SLP) from a database of over a million email addresses 
from the world wide web.

This promotion was set-up to encourage the active users of the Internet 
Microsoft® Windows. This promotion is proudly sponsored by the SWISS-LOTTO 
NETHERLANDS organization.

Your email address, attached to Ref number 15, 11, 20, 37, 4, 17 with Serial 
number SLN/34541982/07 drew the lucky Numbers 25.

Therefore you have won the sum of 850,000.00 Euros {Eight Hundred & 
FiftyThousand Euros only}. A winning cheque will be issued in your name by the 
SWISS-LOTTO NETHERLANDS and also a certificate of prize claims will be sent to 
you along side with your winnings cheque. You are to make contact with your 
designated agent, who shall by duty, guide you through the process of 
facilitating the release of your Prize.

To file for your claim, kindly contact the accredited Claims Manager, Thompson 
Weils of the claims  department of Lascek Capital Finance, Netherlands. He has 
been mandated to assist you and facilitate the urgent delivery of your prizes.

Claims Manager, Lascek Capital Finance BV, Netherlands

Mr.Thompson Weils
Tel: +31-626-296-498
Fax: + 31-84-755-7646
Email: thompsonwe...@aol.com

VERIFICATION FORM:
1.) FULL NAME: 
2.) AGE: 
3.) SEX: 
4.) ADDRESS: 
5.) OCCUPATION: 
6.) Ref. Number:
7.) COUNTRY: 
8.) PHONE:
9.) FAX NUMBER:
10) Monthly Income:

Thanks for been part of this promotional award programme.We wish you the best 
of lucky as you spend your good fortune.

Yours sincerely,
Mrs.Angelik Dyke 
Promo Manager
https://www.swisslotto.ch/


N.B: Keep all lotto information from public to avoid double claims, as  any 
breach of confidentiality on the part of the winners will result to  
disqualification.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 07/12] staging: et131x: Fix indenting using mixed tabs and spaces

2014-09-19 Thread Greg KH
On Sun, Sep 14, 2014 at 04:59:03PM +0100, Mark Einon wrote:
> Fix two lines where mixed tabs and spaces were used for indenting.
> 
> Signed-off-by: Mark Einon 
> ---
>  drivers/staging/et131x/et131x.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
> index 8b2f9a9..c158b01 100644
> --- a/drivers/staging/et131x/et131x.c
> +++ b/drivers/staging/et131x/et131x.c
> @@ -579,7 +579,7 @@ static int eeprom_write(struct et131x_adapter *adapter, 
> u32 addr, u8 data)
> *byte addressing).
> */
>   if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER,
> -   LBCIF_CONTROL_LBCIF_ENABLE |
> +   LBCIF_CONTROL_LBCIF_ENABLE |
>   LBCIF_CONTROL_I2C_WRITE))
>   return -EIO;
>  
> @@ -837,7 +837,7 @@ static void et131x_rx_dma_disable(struct et131x_adapter 
> *adapter)
>   if (!(csr & ET_RXDMA_CSR_HALT_STATUS))
>   dev_err(&adapter->pdev->dev,
>   "RX Dma failed to enter halt state. CSR 
> 0x%08x\n",
> - csr);
> + csr);
>   }
>  }
>

This patch didn't apply, as I think it is already in the tree.  All
others did.

thanks,

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