Re: [PATCH v2 4/4] Staging: rtl8712: fix warning for placing constant on the right side of test

2015-10-18 Thread Larry Finger

On 10/18/2015 09:00 PM, Greg KH wrote:

On Sun, Oct 18, 2015 at 12:02:53PM +0530, punit vara wrote:

One more thing I would like suggestion how can start switching this
driver to LIB80211 ,MAC80211 ? Which is the first file I should focus
? Simultaneously I am trying to understand the flow of driver . I
would like to know the start point  from where I can start doing small
changes.


If you don't understand the wireless stack, I suggest you do some
research on it first, converting a driver to the in-kernel stack is a
_very_ difficult thing and not something that someone without any
experience in this area is going to be able to do easily.


I second this suggestion. Your skill level is not nearly sufficient for this 
sort of task. Note that there is a group working on driver rtl8192su, which 
should be able to replace rtl8712u. The participants are very highly skilled 
wireless developers; however, they are having trouble. The internals of the 
Realtek chips are not revealed to anyone in any form other than the code they 
release.


Larry


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


Re: [PATCH 35/40] staging: wilc1000: rename variable s32Error

2015-10-18 Thread Tony Cho



On 2015년 10월 17일 13:56, Greg KH wrote:

On Thu, Oct 15, 2015 at 01:25:16PM +0900, Tony Cho wrote:

From: Leo Kim 

This patch renames variable s32Error to result
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
  drivers/staging/wilc1000/host_interface.c | 784 ++
  1 file changed, 371 insertions(+), 413 deletions(-)

This patch doesn't apply, so I stopped in the series here, please rebase
and resend the rest of this series.


I will rebase and send them again.

Thanks,

Tony.



thanks,

greg k-h


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


[PATCH] staging: ft1000: Remove boolean comparisons

2015-10-18 Thread Luis de Bethencourt
Boolean tests do not need explicit comparison to true or false.

Signed-off-by: Luis de Bethencourt 
---
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 4 ++--
 drivers/staging/ft1000/ft1000-usb/ft1000_hw.c| 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c 
b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
index eecfa37..dfb5da93 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@ -1531,7 +1531,7 @@ static int ft1000_copy_up_pkt(struct net_device *dev)
tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO);
*pbuffer++ = (u8) (tempword >> 8);
*pbuffer++ = (u8)tempword;
-   if (ft1000_chkcard(dev) == false) {
+   if (!ft1000_chkcard(dev)) {
kfree_skb(skb);
return FAILURE;
}
@@ -1822,7 +1822,7 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
 
-   if (ft1000_chkcard(dev) == false) {
+   if (!ft1000_chkcard(dev)) {
ft1000_disable_interrupts(dev);
return IRQ_HANDLED;
}
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c 
b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
index 9ea32ce..22582be 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
@@ -1465,7 +1465,7 @@ int ft1000_poll(void *dev_id)
u16 modulo;
u16 portid;
 
-   if (ft1000_chkcard(dev) == FALSE) {
+   if (!ft1000_chkcard(dev)) {
pr_debug("failed\n");
return -1;
}
-- 
2.5.1

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


Re: [PATCHv5] staging: vme_user: provide DMA functionality

2015-10-18 Thread Martyn Welch



On 18/10/15 18:53, Dmitry Kalinkin wrote:

On Sun, Oct 18, 2015 at 10:31 AM, Martyn Welch  wrote:


On 11/10/15 01:13, Dmitry Kalinkin wrote:

This introduces a new dma device that provides a single ioctl call that
provides DMA read and write functionality to the user space.

Signed-off-by: Dmitry Kalinkin 
Cc: Igor Alekseev 
---

In the last reply Martyn suggested a rework of this to make it use existing
bus/vme/ctl instead of creating a new bus/vme/dma%i device and also
dynamically
allocate a dma resource in each request.

I think this doesn't need those adjustments. I think that dynamic allocation
doesn't solve any practical problem that isn't caused by current kernel
api.


That would depend on what resources had already been allocated to other
drivers using the kernel api and what resources the underlying bridge had to
make available. This driver will currently only load if all the resources it
wishes to expose to user space are available. That said, such a modification
is clearly separate from adding DMA support to user space, so the argument
is rather academic.

Other drives meaning vme_pio, I don't see any others. All this time
we are discussing how many GE PIO boards one can plug into a crate
with or without vme_user. Most of people have zero of them.
Also, VME DMA API has no users in kernel, we are just adding one now.


Unfortunately not all users of Linux upstream or even publicise their 
drivers. This is especially true of some industries where VME gets used. 
The number of VME windows is limited, so having a user space shim either 
hog or limit the number of resources available either in kernel space or 
user space is not an optimal solution.



I also think that separate device is a good feature because it allows
for
discovery of dma capatibility from userspace.


Given the current user space api, that's true.


The interface with separate
chardev also allows to provide DMA read() and write() syscalls that can
come handy in pair with /bin/dd.


But this patch doesn't implement such a feature does it?

Actually, initial (never published) version of this patch exposed
read(),write(),
and an ioctl to set the access cycle. It was working, but with subtlety for
A64 addressing. I come across some problems when using large offsets
that would not fit in signed long long. I was using FMODE_UNSIGNED_OFFSET
to fix the kernel side of things, but it seemed like userspace didn't like
the "negative" offsets. I've looked a bit at glibc sources and decided
to give up.
Now that I remember this, my original argument is kind of busted.

(Generally happy with this for now, however couple of comments below.)



v5:
Added a validation for dma_op argument in vme_user_sg_to_dma_list(). It is
already checked in caller but we would like to silence a warning:

 drivers/staging/vme/devices/vme_user.c: In function
'vme_user_ioctl.isra.4':

drivers/staging/vme/devices/vme_user.c:324:7: warning: 'dest' may be
used uninitialized in this function [-Wmaybe-uninitialized]

ret = vme_dma_list_add(dma_list, src, dest, hw_len);
^
 drivers/staging/vme/devices/vme_user.c:296:52: note: 'dest' was
declared here
struct vme_dma_attr *pci_attr, *vme_attr, *src, *dest;
 ^

drivers/staging/vme/devices/vme_user.c:324:7: warning: 'src' may be used
uninitialized in this function [-Wmaybe-uninitialized]

ret = vme_dma_list_add(dma_list, src, dest, hw_len);
^
 drivers/staging/vme/devices/vme_user.c:296:46: note: 'src' was
declared here
struct vme_dma_attr *pci_attr, *vme_attr, *src, *dest;

---
   drivers/staging/vme/devices/vme_user.c | 205
-
   drivers/staging/vme/devices/vme_user.h |  11 ++
   2 files changed, 213 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c
b/drivers/staging/vme/devices/vme_user.c
index 8e61a3b..2434e5f 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -79,15 +79,18 @@ static unsigned int bus_num;
* We shall support 4 masters and 4 slaves with this driver.
*/


The comment just above here (cropped in the patch) describes the interface
that this driver exposes and what is documented in
Documentation/devices.txt.

I've come across a long time ago and at the time I realized that this
document is generally outdated and is not required to be updated.
First, "Last revised: 6th April 2009"
Second, the device path information is long obsolete in the light of udev.
Third, they want submissions on a separate list 
Fourth, "20 block Hitachi CD-ROM (under development) 0 = /dev/hitcd"
-- this is not for real.


Yup, I agree, devices.txt is probably well out of date and is a product 
of long since deprecated practices.


That said, the comment in vme_user.c is at odds with what the code 

Re: [PATCH V2 01/40] staging: wilc1000: rename ssidLen of struct join_bss_param

2015-10-18 Thread Tony Cho



On 2015년 10월 17일 13:59, Greg KH wrote:

On Fri, Oct 16, 2015 at 01:37:31PM +0900, Tony Cho wrote:

From: Leo Kim 

This patch renames ssidLen of struct join_bss_param to ssid_len
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
  drivers/staging/wilc1000/host_interface.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Doesn't apply, I missed that you sent this as v2, why did you do that?
What was wrong with v1?


This series of V2 includes Dan's suggestion, we don't have to add one blank 
line between malloc and null check if-statement.

In addition, some of global variables are declared as "static" because they are used in 
only one file so kbuild test robot indicated they had better be declared as "static".

So, I sent the series of them as V2. I can find the V1 of this series are 
already accepted so I will later make separate patch for them.

Thanks,

Tony.


thanks,

greg k-h


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


Re: [PATCH v2 4/4] Staging: rtl8712: fix warning for placing constant on the right side of test

2015-10-18 Thread Greg KH
On Sun, Oct 18, 2015 at 12:02:53PM +0530, punit vara wrote:
> On Sat, Oct 17, 2015 at 10:46 AM, Greg KH  wrote:
> > On Wed, Oct 14, 2015 at 11:55:55PM +0530, Punit Vara wrote:
> >> Put constant on the right side of a test.Problem found using checkpatch:
> >>
> >> Warning:Comparisons should place the constant on the right side of the test
> >>
> >> Signed-off-by: Punit Vara 
> >> ---
> >>  drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 16 
> >>  1 file changed, 8 insertions(+), 8 deletions(-)
> >
> > Didn't apply to my tree :(
> In this case what should I do ? Should I do git reset , git pull and
> then  do changes on latest tree ?

That depends on your workflow, how about pulling and then rebase your
branch on mine?  That's the easiest workflow to use.

> One more thing I would like suggestion how can start switching this
> driver to LIB80211 ,MAC80211 ? Which is the first file I should focus
> ? Simultaneously I am trying to understand the flow of driver . I
> would like to know the start point  from where I can start doing small
> changes.

If you don't understand the wireless stack, I suggest you do some
research on it first, converting a driver to the in-kernel stack is a
_very_ difficult thing and not something that someone without any
experience in this area is going to be able to do easily.

good luck!

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


Re: [PATCH 03/16] staging: wilc1000: rename g_linux_wlan to wl

2015-10-18 Thread Tony Cho



On 2015년 10월 17일 13:33, Greg KH wrote:

On Wed, Oct 14, 2015 at 08:46:31PM +0900, Tony Cho wrote:

This patch renames g_linux_wlan to wl.

Why?  What's wrong with g_linux_wlan?  You will need to delete this
entire variable soon anyway, might as well leave it alone until then.


The reason why I rename it to the "wl" is that there first is 80 ending line 
over issue due to its length where I want to modify
and also we will take our representative structure as "wl" in the future. As 
you expected, finally g_linux_wlan global variable will
all be deleted by referring it from the private structure as it is introduced 
in another 13 series of patch.

However, as you guided, I will leave it until all of patch is done.

Thanks,

Tony.


thanks,

greg k-h


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


[PATCH] staging: emxx_udc: Remove boolean comparisons

2015-10-18 Thread Luis de Bethencourt
Boolean tests do not need explicit comparison to true or false.

Signed-off-by: Luis de Bethencourt 
---
 drivers/staging/emxx_udc/emxx_udc.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 0492747..26c8d5b 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -1267,7 +1267,7 @@ static int _nbu2ss_start_transfer(
/* EPn */
if (ep->direct == USB_DIR_OUT) {
/* OUT */
-   if (bflag == FALSE)
+   if (!bflag)
nret = _nbu2ss_epn_out_transfer(udc, ep, req);
} else {
/* IN */
@@ -1509,7 +1509,7 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc 
*udc, bool bset)
if (0x == (wIndex & 0xFF70)) {
if (selector == USB_ENDPOINT_HALT) {
ep_adrs = wIndex & 0xFF;
-   if (bset == FALSE) {
+   if (!bset) {
_nbu2ss_endpoint_toggle_reset(
udc, ep_adrs);
}
@@ -1756,7 +1756,7 @@ static inline int _nbu2ss_decode_request(struct 
nbu2ss_udc *udc)
}
}
 
-   if (bcall_back == FALSE) {
+   if (!bcall_back) {
if (udc->ep0state == EP0_IN_STATUS_PHASE) {
if (nret >= 0) {
/*--*/
@@ -2044,7 +2044,7 @@ static inline void _nbu2ss_epn_in_dma_int(
 
preq = >req;
 
-   if (req->dma_flag == FALSE)
+   if (!req->dma_flag)
return;
 
preq->actual += req->div_len;
@@ -2756,7 +2756,7 @@ static int nbu2ss_ep_queue(
bflag = list_empty(>queue);
list_add_tail(>queue, >queue);
 
-   if ((bflag != FALSE) && (ep->stalled == FALSE)) {
+   if (bflag && !ep->stalled) {
 
result = _nbu2ss_start_transfer(udc, ep, req, FALSE);
if (result < 0) {
-- 
2.5.1

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


[PATCH] staging: rtl8712: Add device ID for Sitecom WLA2100

2015-10-18 Thread Larry Finger
This adds the USB ID for the Sitecom WLA2100. The Windows 10 inf file
was checked to verify that the addition is correct.

Reported-by: Frans van de Wiel 
Signed-off-by: Larry Finger 
Cc: Frans van de Wiel 
Cc: Stable  [All stable versions]
---
 drivers/staging/rtl8712/usb_intf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8712/usb_intf.c 
b/drivers/staging/rtl8712/usb_intf.c
index f8b5b33..943a0e2 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -144,6 +144,7 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = {
{USB_DEVICE(0x0DF6, 0x0058)},
{USB_DEVICE(0x0DF6, 0x0049)},
{USB_DEVICE(0x0DF6, 0x004C)},
+   {USB_DEVICE(0x0DF6, 0x006C)},
{USB_DEVICE(0x0DF6, 0x0064)},
/* Skyworth */
{USB_DEVICE(0x14b2, 0x3300)},
-- 
2.1.4

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


Re: [PATCH V2] staging: wilc1000: wilc_msgqueue.c : remove the goto ERRORHANDER

2015-10-18 Thread Tony Cho



On 2015년 10월 17일 13:28, Greg KH wrote:

On Wed, Oct 14, 2015 at 05:52:55PM +0900, Tony Cho wrote:


On 2015년 10월 14일 17:32, Mike Rapoport wrote:

On Wed, Oct 14, 2015 at 02:55:43PM +0900, Tony Cho wrote:

From: Leo Kim 

This patch removes goto ERRORHANDER and the result variable in wilc_mq_send.
Then, the error type is directly returned. If normal operation, freeing memory
is not needed in this function.
If an error occurs, returns an error after releasing the spin lock.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
V2: add releasing spinlock before returnig an error when an error happens.
---
  drivers/staging/wilc1000/wilc_msgqueue.c | 28 
  1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index b13809a..4dfd476 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -56,35 +56,38 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
  int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
 const void *pvSendBuffer, u32 u32SendBufferSize)
  {
-   int result = 0;
unsigned long flags;
Message *pstrMessage = NULL;
if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
PRINT_ER("pHandle or pvSendBuffer is null\n");
-   result = -EFAULT;
-   goto ERRORHANDLER;
+   return -EFAULT;
}
if (pHandle->bExiting) {
PRINT_ER("pHandle fail\n");
-   result = -EFAULT;
-   goto ERRORHANDLER;
+   return -EFAULT;
}
spin_lock_irqsave(>strCriticalSection, flags);
/* construct a new message */
pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC);

You can make this allocation outisde the spinlock, then there won't be
need to release it if the allocation fails.


-   if (!pstrMessage)
+
+   if (!pstrMessage) {
+   spin_unlock_irqrestore(>strCriticalSection, flags);
return -ENOMEM;
+   }
+
pstrMessage->u32Length = u32SendBufferSize;
pstrMessage->pstrNext = NULL;
pstrMessage->pvBuffer = kmemdup(pvSendBuffer, u32SendBufferSize,
GFP_ATOMIC);
+
if (!pstrMessage->pvBuffer) {
-   result = -ENOMEM;
-   goto ERRORHANDLER;
+   spin_unlock_irqrestore(>strCriticalSection, flags);

You are still holding pHandle->hSem here. Moreover, all error paths
return while still holding pHandle->hSem.

Can you explain to me what you mean for holding hsem here? Basically, this 
function cannot release

the semaphore (of course, this synchronization mechanism will be changed, 
anyway) if errors happen.

The thread will do his work when it is released without unexpected situations.


I'd suggest, that instead of trying to return immediately, you'd better
move error handling code to the end of the function and use goto and
several labels to do appropriate cleanups depending on when the error
was caught. E.g.

I don't want to use goto statement as possible as I can. Do you
concern semaphore uses in this function?

You should use a goto, it will make the error unwinding much easier and
is a very common pattern in Linux kernel code.  It will save you many
lines in this function, please do it that way instead.


ok, I will do that,

Thanks,

Tony.



thanks,

greg k-h


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


[PATCH staging] rtl8188eu : BIT() macro cleanup

2015-10-18 Thread Anish Bhatt
Use the BIT(x) macro directly instead using multiple
BITX defines.

Signed-off-by: Anish Bhatt 
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c |  48 +--
 drivers/staging/rtl8188eu/hal/bb_cfg.c |   2 +-
 drivers/staging/rtl8188eu/hal/odm.c|  24 +-
 drivers/staging/rtl8188eu/hal/odm_HWConfig.c   |   4 +-
 drivers/staging/rtl8188eu/hal/odm_RTL8188E.c   | 116 +++---
 drivers/staging/rtl8188eu/hal/phy.c|  30 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c   |  20 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c  |  24 +-
 drivers/staging/rtl8188eu/hal/rtl8188eu_led.c  |   6 +-
 drivers/staging/rtl8188eu/hal/usb_halinit.c|  56 +--
 drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h |  14 +-
 drivers/staging/rtl8188eu/include/hal_intf.h   |  16 +-
 drivers/staging/rtl8188eu/include/odm.h|  90 ++---
 drivers/staging/rtl8188eu/include/odm_debug.h  |  42 +--
 drivers/staging/rtl8188eu/include/odm_reg.h|   2 +-
 drivers/staging/rtl8188eu/include/osdep_service.h  |  39 --
 drivers/staging/rtl8188eu/include/pwrseq.h |  84 ++---
 drivers/staging/rtl8188eu/include/rtl8188e_spec.h  | 411 ++---
 drivers/staging/rtl8188eu/include/rtw_sreset.h |  14 +-
 19 files changed, 485 insertions(+), 557 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c 
b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index 7b99ea9..685ce98 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -396,7 +396,7 @@ u8 Efuse_WordEnableDataWrite(struct adapter *pAdapter, u16 
efuse_addr, u8 word_e
 
memset((void *)tmpdata, 0xff, PGPKT_DATA_SIZE);
 
-   if (!(word_en)) {
+   if (!(word_en & BIT(0))) {
tmpaddr = start_addr;
efuse_OneByteWrite(pAdapter, start_addr++, data[0]);
efuse_OneByteWrite(pAdapter, start_addr++, data[1]);
@@ -404,9 +404,9 @@ u8 Efuse_WordEnableDataWrite(struct adapter *pAdapter, u16 
efuse_addr, u8 word_e
efuse_OneByteRead(pAdapter, tmpaddr, [0]);
efuse_OneByteRead(pAdapter, tmpaddr+1, [1]);
if ((data[0] != tmpdata[0]) || (data[1] != tmpdata[1]))
-   badworden &= (~BIT0);
+   badworden &= (~BIT(0));
}
-   if (!(word_en)) {
+   if (!(word_en & BIT(1))) {
tmpaddr = start_addr;
efuse_OneByteWrite(pAdapter, start_addr++, data[2]);
efuse_OneByteWrite(pAdapter, start_addr++, data[3]);
@@ -414,9 +414,9 @@ u8 Efuse_WordEnableDataWrite(struct adapter *pAdapter, u16 
efuse_addr, u8 word_e
efuse_OneByteRead(pAdapter, tmpaddr, [2]);
efuse_OneByteRead(pAdapter, tmpaddr+1, [3]);
if ((data[2] != tmpdata[2]) || (data[3] != tmpdata[3]))
-   badworden &= (~BIT1);
+   badworden &= (~BIT(1));
}
-   if (!(word_en)) {
+   if (!(word_en & BIT(2))) {
tmpaddr = start_addr;
efuse_OneByteWrite(pAdapter, start_addr++, data[4]);
efuse_OneByteWrite(pAdapter, start_addr++, data[5]);
@@ -424,9 +424,9 @@ u8 Efuse_WordEnableDataWrite(struct adapter *pAdapter, u16 
efuse_addr, u8 word_e
efuse_OneByteRead(pAdapter, tmpaddr, [4]);
efuse_OneByteRead(pAdapter, tmpaddr+1, [5]);
if ((data[4] != tmpdata[4]) || (data[5] != tmpdata[5]))
-   badworden &= (~BIT2);
+   badworden &= (~BIT(2));
}
-   if (!(word_en)) {
+   if (!(word_en & BIT(3))) {
tmpaddr = start_addr;
efuse_OneByteWrite(pAdapter, start_addr++, data[6]);
efuse_OneByteWrite(pAdapter, start_addr++, data[7]);
@@ -434,7 +434,7 @@ u8 Efuse_WordEnableDataWrite(struct adapter *pAdapter, u16 
efuse_addr, u8 word_e
efuse_OneByteRead(pAdapter, tmpaddr, [6]);
efuse_OneByteRead(pAdapter, tmpaddr+1, [7]);
if ((data[6] != tmpdata[6]) || (data[7] != tmpdata[7]))
-   badworden &= (~BIT3);
+   badworden &= (~BIT(3));
}
return badworden;
 }
@@ -738,18 +738,18 @@ static bool wordEnMatched(struct pgpkt *pTargetPkt, 
struct pgpkt *pCurPkt,
u8 match_word_en = 0x0F;/*  default all words are disabled */
 
/*  check if the same words are enabled both target and current PG 
packet */
-   if (((pTargetPkt->word_en & BIT0) == 0) &&
-   ((pCurPkt->word_en & BIT0) == 0))
-   match_word_en &= ~BIT0; /*  enable word 
0 */
-   if (((pTargetPkt->word_en & BIT1) == 0) &&
-   ((pCurPkt->word_en & BIT1) == 0))
-   match_word_en &= ~BIT1; /*  enable word 
1 */
-   if (((pTargetPkt->word_en & BIT2) 

Re: [PATCH v2 4/4] Staging: rtl8712: fix warning for placing constant on the right side of test

2015-10-18 Thread Tillmann Heidsieck

Hi,

On 2015-10-18 08:32, punit vara wrote:
On Sat, Oct 17, 2015 at 10:46 AM, Greg KH  
wrote:

On Wed, Oct 14, 2015 at 11:55:55PM +0530, Punit Vara wrote:
Put constant on the right side of a test.Problem found using 
checkpatch:


Warning:Comparisons should place the constant on the right side of 
the test


Signed-off-by: Punit Vara 
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)


Didn't apply to my tree :(

In this case what should I do ? Should I do git reset , git pull and
then  do changes on latest tree ?



Greg is probably trying to apply this series to the staging-next branch 
of his staging tree[0]
so you need to clone that one, or add it as an additional remote[1] to 
your clone of the kernel tree (much better option IMHO). After this you 
need to rebase[2] your changes onto the stating-next branch, fix up all 
conflicts in your code, and resend the patch.


I hope this helps

Tillmann

[0] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
[1] https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
[2] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 4/4] Staging: rtl8712: fix warning for placing constant on the right side of test

2015-10-18 Thread Tillmann Heidsieck
On Sun, Oct 18, 2015 at 08:54:57PM +0200, Tillmann Heidsieck wrote:
> Hi,

[...]

> Greg is probably trying to apply this series to the staging-next branch of
> his staging tree[0]
> so you need to clone that one, or add it as an additional remote[1] to your
> clone of the kernel tree (much better option IMHO). After this you need to
> rebase[2] your changes onto the stating-next branch, fix up all conflicts in
> your code, and resend the patch.
> 
> I hope this helps
> 
> Tillmann
> 
> [0] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> [1] https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git

ups, got bitten by my missing c'n'p prowess 
[2] https://www.kernel.org/pub/software/scm/git/docs/git-rebase.html
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2 v3] drivers: staging: rtl8723au: Changed rssi_cmd to little-endian param

2015-10-18 Thread Jacob Kiefer
> I am fine with this code in principle, but has it been tested? This
> stuff will break the driver miserably if it's wrong.
> 
> Thanks,
> Jes
> 

This patchset has not been tested.
Unfortunately, I don't have to proper card to test this patch on my
local. It built for me, and that's as far as I went.

Is there a way for me to test this patch locally _without_ the
corresponding wireless card? I will gladly do this, I just need to know
the tools to use and methodology.

Otherwise, can anyone with the correct wireless card apply these patches to a 
copy of the kernel and
test that nothing breaks because of the patch on their machine? Again
this is for the RTL8723au wireless card.

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


[PATCH] staging: rtl8712: Remove boolean comparisons

2015-10-18 Thread Luis de Bethencourt
Boolean tests do not need explicit comparison to true or false.

Signed-off-by: Luis de Bethencourt 
---
 drivers/staging/rtl8712/os_intfs.c|   4 +-
 drivers/staging/rtl8712/rtl8712_cmd.c |   9 +-
 drivers/staging/rtl8712/rtl8712_efuse.c   |  49 
 drivers/staging/rtl8712/rtl8712_io.c  |   6 +-
 drivers/staging/rtl8712/rtl8712_led.c | 164 +-
 drivers/staging/rtl8712/rtl8712_recv.c|  25 ++--
 drivers/staging/rtl8712/rtl8712_xmit.c|   4 +-
 drivers/staging/rtl8712/rtl871x_cmd.c |   8 +-
 drivers/staging/rtl8712/rtl871x_eeprom.c  |  22 ++--
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c |  56 -
 drivers/staging/rtl8712/rtl871x_ioctl_rtl.c   |  12 +-
 drivers/staging/rtl8712/rtl871x_ioctl_set.c   |  26 ++--
 drivers/staging/rtl8712/rtl871x_mlme.c|  77 ++--
 drivers/staging/rtl8712/rtl871x_mlme.h|   2 +-
 drivers/staging/rtl8712/rtl871x_mp_ioctl.c|  16 +--
 drivers/staging/rtl8712/rtl871x_pwrctrl.c |   6 +-
 drivers/staging/rtl8712/rtl871x_recv.c|  39 +++---
 drivers/staging/rtl8712/rtl871x_security.c|   4 +-
 drivers/staging/rtl8712/rtl871x_sta_mgt.c |   6 +-
 drivers/staging/rtl8712/rtl871x_xmit.c|  41 +++
 drivers/staging/rtl8712/usb_intf.c|   4 +-
 drivers/staging/rtl8712/usb_ops_linux.c   |  10 +-
 drivers/staging/rtl8712/xmit_linux.c  |   4 +-
 23 files changed, 292 insertions(+), 302 deletions(-)

diff --git a/drivers/staging/rtl8712/os_intfs.c 
b/drivers/staging/rtl8712/os_intfs.c
index 6805f79..92ab59d 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -177,7 +177,7 @@ static int r871x_net_set_mac_address(struct net_device 
*pnetdev, void *p)
struct _adapter *padapter = netdev_priv(pnetdev);
struct sockaddr *addr = p;
 
-   if (padapter->bup == false)
+   if (!padapter->bup)
ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
return 0;
 }
@@ -384,7 +384,7 @@ static int netdev_open(struct net_device *pnetdev)
struct _adapter *padapter = netdev_priv(pnetdev);
 
mutex_lock(>mutex_start);
-   if (padapter->bup == false) {
+   if (!padapter->bup) {
padapter->bDriverStopped = false;
padapter->bSurpriseRemoved = false;
padapter->bup = true;
diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c 
b/drivers/staging/rtl8712/rtl8712_cmd.c
index f70235c..39b6320 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.c
+++ b/drivers/staging/rtl8712/rtl8712_cmd.c
@@ -85,7 +85,7 @@ static void query_fw_rx_phy_status(struct _adapter *padapter)
u32 val32 = 0;
int pollingcnts = 50;
 
-   if (check_fwstate(>mlmepriv, _FW_LINKED) == true) {
+   if (check_fwstate(>mlmepriv, _FW_LINKED)) {
r8712_write32(padapter, IOCMD_CTRL_REG, 0xf401);
msleep(100);
/* Wait FW complete IO Cmd */
@@ -324,8 +324,7 @@ int r8712_cmd_thread(void *context)
while (1) {
if ((_down_sema(&(pcmdpriv->cmd_queue_sema))) == _FAIL)
break;
-   if ((padapter->bDriverStopped == true) ||
-   (padapter->bSurpriseRemoved == true))
+   if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
break;
if (r8712_register_cmd_alive(padapter) != _SUCCESS)
continue;
@@ -375,8 +374,8 @@ _next:
pcmdbuf += 2; /* 8 bytes alignment */
memcpy((u8 *)pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
while (check_cmd_fifo(padapter, wr_sz) == _FAIL) {
-   if ((padapter->bDriverStopped == true) ||
-   (padapter->bSurpriseRemoved == true))
+   if (padapter->bDriverStopped ||
+   padapter->bSurpriseRemoved)
break;
msleep(100);
continue;
diff --git a/drivers/staging/rtl8712/rtl8712_efuse.c 
b/drivers/staging/rtl8712/rtl8712_efuse.c
index d957169..83d418d 100644
--- a/drivers/staging/rtl8712/rtl8712_efuse.c
+++ b/drivers/staging/rtl8712/rtl8712_efuse.c
@@ -39,7 +39,7 @@ static void efuse_reg_ctrl(struct _adapter *padapter, u8 
bPowerOn)
 {
u8 tmpu8 = 0;
 
-   if (true == bPowerOn) {
+   if (bPowerOn) {
/* -e-fuse pwr & clk reg ctrl ---
 * Enable LDOE25 Macro Block
 */
@@ -127,7 +127,7 @@ static u8 efuse_one_byte_rw(struct _adapter *padapter, u8 
bRead, u16 addr,
tmpv8 = ((u8)((addr >> 8) & 0x03)) |
 (r8712_read8(padapter, EFUSE_CTRL + 2) & 0xFC);
r8712_write8(padapter, EFUSE_CTRL+2, tmpv8);
-  

Re: [PATCH v2 4/4] Staging: rtl8712: fix warning for placing constant on the right side of test

2015-10-18 Thread punit vara
On Sat, Oct 17, 2015 at 10:46 AM, Greg KH  wrote:
> On Wed, Oct 14, 2015 at 11:55:55PM +0530, Punit Vara wrote:
>> Put constant on the right side of a test.Problem found using checkpatch:
>>
>> Warning:Comparisons should place the constant on the right side of the test
>>
>> Signed-off-by: Punit Vara 
>> ---
>>  drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 16 
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> Didn't apply to my tree :(
In this case what should I do ? Should I do git reset , git pull and
then  do changes on latest tree ?

One more thing I would like suggestion how can start switching this
driver to LIB80211 ,MAC80211 ? Which is the first file I should focus
? Simultaneously I am trying to understand the flow of driver . I
would like to know the start point  from where I can start doing small
changes.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wilc1000: restore wilc_spi_dev variable

2015-10-18 Thread Stanislav Kholmanskikh
Hi!

On 16.10.2015 23:05, Arnd Bergmann wrote:
> A recent change to wilc1000 accidentally deleted an important
> variable, so we now get a build error when the SPI mode is
> selected:
> 
> ERROR: "wilc_spi_dev" [drivers/staging/wilc1000/wilc1000.ko] undefined!
> 
> This partially reverts the broken commit to put the variable back.
> 
> Signed-off-by: Arnd Bergmann 
> Fixes: 56293ff232b9 ("staging: wilc1000: linux_wlan_spi: include header")
> ---

I'm really sorry about it, will be more careful in the future. 

Thank you for fixing this.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/5] staging: lustre: ldlm_extent.c: replace IS_PO2 by is_power_of_2

2015-10-18 Thread Aya Mahfouz
Replaces IS_PO2 by is_power_of_2. It is more accurate to use
is_power_of_2 since it returns 1 for numbers that are powers
of 2 only whereas IS_PO2 returns 1 for 0 and numbers that are
powers of 2.

Signed-off-by: Aya Mahfouz 
---
v2:
-changed commit message

 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
index 57b997d..3e7e97e 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
@@ -50,6 +50,9 @@
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
+
+#include 
+
 #include "../../include/linux/libcfs/libcfs.h"
 #include "../include/lustre_dlm.h"
 #include "../include/obd_support.h"
@@ -149,7 +152,7 @@ static inline int lock_mode_to_index(ldlm_mode_t mode)
int index;
 
LASSERT(mode != 0);
-   LASSERT(IS_PO2(mode));
+   LASSERT(is_power_of_2(mode));
for (index = -1; mode; index++)
mode >>= 1;
LASSERT(index < LCK_MODE_NUM);
-- 
2.4.2


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 4/5] staging: lustre: selftest.h: replace IS_PO2 by is_power_of_2

2015-10-18 Thread Aya Mahfouz
Replaces IS_PO2 by is_power_of_2. It is more accurate to use
is_power_of_2 since it returns 1 for numbers that are powers
of 2 only whereas IS_PO2 returns 1 for 0 and numbers that are
powers of 2.

Signed-off-by: Aya Mahfouz 
---
v2:
-added new patch in patch set for selftest.h

 drivers/staging/lustre/lnet/selftest/selftest.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h 
b/drivers/staging/lustre/lnet/selftest/selftest.h
index 8a77d3f..2846f26 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -43,6 +43,8 @@
 
 #define LNET_ONLY
 
+#include 
+
 #include "../../include/linux/libcfs/libcfs.h"
 #include "../../include/linux/lnet/lnet.h"
 #include "../../include/linux/lnet/lib-lnet.h"
@@ -585,7 +587,7 @@ swi_state2str (int state)
 do {   \
int __I = 2;\
while (!(cond)) {   \
-   CDEBUG(IS_PO2(++__I) ? D_WARNING : D_NET,   \
+   CDEBUG(is_power_of_2(++__I) ? D_WARNING : D_NET,
\
   fmt, ## __VA_ARGS__);\
spin_unlock(&(lock));   \
\
-- 
2.4.2


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/5] Remove uses and definition of IS_PO2

2015-10-18 Thread Aya Mahfouz
Concerned with the removal of IS_PO2 by replacing its uses
with is_power_of_2 and then removing the definition.

This is the second version of the patch set. The commit messages
were changed and a new patch was added for a use of IS_PO2 indicated
by kbuild test robot.

Aya Mahfouz (5):
  staging: lustre: ldlm_extent.c: replace IS_PO2 by is_power_of_2
  staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2
  staging: lustre: workitem.c: replace IS_PO2 by is_power_of_2
  staging: lustre: selftest.h: replace IS_PO2 by is_power_of_2
  staging: lustre: libcfs.h: remove IS_PO2 and __is_po2

 drivers/staging/lustre/include/linux/libcfs/libcfs.h | 7 ---
 drivers/staging/lustre/lnet/selftest/selftest.h  | 4 +++-
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 5 -
 drivers/staging/lustre/lustre/libcfs/hash.c  | 4 +++-
 drivers/staging/lustre/lustre/libcfs/workitem.c  | 4 +++-
 5 files changed, 13 insertions(+), 11 deletions(-)

-- 
2.4.2


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 5/5] staging: lustre: libcfs.h: remove IS_PO2 and __is_po2

2015-10-18 Thread Aya Mahfouz
Removes IS_PO2 and __is_po2 since the uses of IS_PO2 have
been replaced by is_power_of_2

Signed-off-by: Aya Mahfouz 
---
v2:
-became patch number 5 in the series

 drivers/staging/lustre/include/linux/libcfs/libcfs.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 385ced1..c78a147 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -42,13 +42,6 @@
 
 #include "curproc.h"
 
-static inline int __is_po2(unsigned long long val)
-{
-   return !(val & (val - 1));
-}
-
-#define IS_PO2(val) __is_po2((unsigned long long)(val))
-
 #define LOWEST_BIT_SET(x)   ((x) & ~((x) - 1))
 
 /*
-- 
2.4.2


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] vme: 8-bit status/id takes 256 values, not 255

2015-10-18 Thread Martyn Welch
On 10 October 2015 at 23:00, Dmitry Kalinkin  wrote:
> Fixes an off by one array size.
>

The Status/ID is an 8-bit value (OK, the standard states it can be a
8, 16 or 32-bit value, however both of the chipsets we support at this
point in time support an 8-bit value), why do we need a 256th entry in
the array?

Martyn

> Signed-off-by: Dmitry Kalinkin 
> ---
>  drivers/vme/vme_bridge.h | 4 +++-
>  include/linux/vme.h  | 3 +++
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vme/vme_bridge.h b/drivers/vme/vme_bridge.h
> index 397578a..b59cbee 100644
> --- a/drivers/vme/vme_bridge.h
> +++ b/drivers/vme/vme_bridge.h
> @@ -1,6 +1,8 @@
>  #ifndef _VME_BRIDGE_H_
>  #define _VME_BRIDGE_H_
>
> +#include 
> +
>  #define VME_CRCSR_BUF_SIZE (508*1024)
>  /*
>   * Resource structures
> @@ -91,7 +93,7 @@ struct vme_callback {
>
>  struct vme_irq {
> int count;
> -   struct vme_callback callback[255];
> +   struct vme_callback callback[VME_NUM_STATUSID];
>  };
>
>  /* Allow 16 characters for name (including null character) */
> diff --git a/include/linux/vme.h b/include/linux/vme.h
> index c013135..71e4a6d 100644
> --- a/include/linux/vme.h
> +++ b/include/linux/vme.h
> @@ -81,6 +81,9 @@ struct vme_resource {
>
>  extern struct bus_type vme_bus_type;
>
> +/* Number of VME interrupt vectors */
> +#define VME_NUM_STATUSID   256
> +
>  /* VME_MAX_BRIDGES comes from the type of vme_bus_numbers */
>  #define VME_MAX_BRIDGES(sizeof(unsigned int)*8)
>  #define VME_MAX_SLOTS  32
> --
> 1.8.3.1
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/2] staging: IB/ipath: use TASK_COMM_LEN in ipath_portdata

2015-10-18 Thread Geliang Tang
Use comm[TASK_COMM_LEN] instead of comm[16] in ipath_kernel.h.
And add sched.h header in it.

Signed-off-by: Geliang Tang 
---
Changes in v2:
 - split it into two patches.
---
 drivers/staging/rdma/ipath/ipath_kernel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rdma/ipath/ipath_kernel.h 
b/drivers/staging/rdma/ipath/ipath_kernel.h
index f0f9471..66c934a 100644
--- a/drivers/staging/rdma/ipath/ipath_kernel.h
+++ b/drivers/staging/rdma/ipath/ipath_kernel.h
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -162,7 +163,7 @@ struct ipath_portdata {
struct pid *port_pid;
struct pid *port_subpid[INFINIPATH_MAX_SUBPORT];
/* same size as task_struct .comm[] */
-   char port_comm[16];
+   char port_comm[TASK_COMM_LEN];
/* pkeys set by this use of this port */
u16 port_pkeys[4];
/* so file ops can get at unit */
-- 
2.5.0


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


[PATCH v2 2/2] staging: IB/ipath: remove sched.h header

2015-10-18 Thread Geliang Tang
sched.h header in ipath_*.c is now unnecessary, since I have added
sched.h in ipath_kernel.h. So remove it.

Signed-off-by: Geliang Tang 
---
Changes in v2:
 - split it into two patches.
---
 drivers/staging/rdma/ipath/ipath_driver.c  | 1 -
 drivers/staging/rdma/ipath/ipath_intr.c| 1 -
 drivers/staging/rdma/ipath/ipath_qp.c  | 1 -
 drivers/staging/rdma/ipath/ipath_ruc.c | 1 -
 drivers/staging/rdma/ipath/ipath_ud.c  | 1 -
 drivers/staging/rdma/ipath/ipath_user_pages.c  | 1 -
 drivers/staging/rdma/ipath/ipath_user_sdma.c   | 1 -
 drivers/staging/rdma/ipath/ipath_verbs_mcast.c | 1 -
 8 files changed, 8 deletions(-)

diff --git a/drivers/staging/rdma/ipath/ipath_driver.c 
b/drivers/staging/rdma/ipath/ipath_driver.c
index 46d9898..dfcfaa5 100644
--- a/drivers/staging/rdma/ipath/ipath_driver.c
+++ b/drivers/staging/rdma/ipath/ipath_driver.c
@@ -33,7 +33,6 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/staging/rdma/ipath/ipath_intr.c 
b/drivers/staging/rdma/ipath/ipath_intr.c
index e568971..0403fa2 100644
--- a/drivers/staging/rdma/ipath/ipath_intr.c
+++ b/drivers/staging/rdma/ipath/ipath_intr.c
@@ -33,7 +33,6 @@
 
 #include 
 #include 
-#include 
 
 #include "ipath_kernel.h"
 #include "ipath_verbs.h"
diff --git a/drivers/staging/rdma/ipath/ipath_qp.c 
b/drivers/staging/rdma/ipath/ipath_qp.c
index b2c6766..280cd2d 100644
--- a/drivers/staging/rdma/ipath/ipath_qp.c
+++ b/drivers/staging/rdma/ipath/ipath_qp.c
@@ -32,7 +32,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/staging/rdma/ipath/ipath_ruc.c 
b/drivers/staging/rdma/ipath/ipath_ruc.c
index 1f95bba..2296832 100644
--- a/drivers/staging/rdma/ipath/ipath_ruc.c
+++ b/drivers/staging/rdma/ipath/ipath_ruc.c
@@ -31,7 +31,6 @@
  * SOFTWARE.
  */
 
-#include 
 #include 
 
 #include "ipath_verbs.h"
diff --git a/drivers/staging/rdma/ipath/ipath_ud.c 
b/drivers/staging/rdma/ipath/ipath_ud.c
index e8a2a91..33fcfe2 100644
--- a/drivers/staging/rdma/ipath/ipath_ud.c
+++ b/drivers/staging/rdma/ipath/ipath_ud.c
@@ -31,7 +31,6 @@
  * SOFTWARE.
  */
 
-#include 
 #include 
 
 #include "ipath_verbs.h"
diff --git a/drivers/staging/rdma/ipath/ipath_user_pages.c 
b/drivers/staging/rdma/ipath/ipath_user_pages.c
index 1da1252..d29b4da 100644
--- a/drivers/staging/rdma/ipath/ipath_user_pages.c
+++ b/drivers/staging/rdma/ipath/ipath_user_pages.c
@@ -34,7 +34,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "ipath_kernel.h"
 
diff --git a/drivers/staging/rdma/ipath/ipath_user_sdma.c 
b/drivers/staging/rdma/ipath/ipath_user_sdma.c
index e82b3ee..8c12e3c 100644
--- a/drivers/staging/rdma/ipath/ipath_user_sdma.c
+++ b/drivers/staging/rdma/ipath/ipath_user_sdma.c
@@ -33,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/staging/rdma/ipath/ipath_verbs_mcast.c 
b/drivers/staging/rdma/ipath/ipath_verbs_mcast.c
index 6216ea9..72d476f 100644
--- a/drivers/staging/rdma/ipath/ipath_verbs_mcast.c
+++ b/drivers/staging/rdma/ipath/ipath_verbs_mcast.c
@@ -32,7 +32,6 @@
  */
 
 #include 
-#include 
 #include 
 
 #include "ipath_verbs.h"
-- 
2.5.0


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


Re: [PATCH 4/4] staging: lustre: remove IS_PO2 and __is_po2

2015-10-18 Thread Aya Mahfouz
On Fri, Oct 16, 2015 at 10:21:05PM -0700, Greg KH wrote:
> On Sat, Oct 17, 2015 at 12:07:28AM +0200, Aya Mahfouz wrote:
> > Removes IS_PO2 and __is_po2 since the uses of IS_PO2 have
> > been replaced by is_power_of_2
> > 
> > Signed-off-by: Aya Mahfouz 
> > ---
> >  drivers/staging/lustre/include/linux/libcfs/libcfs.h | 7 ---
> >  1 file changed, 7 deletions(-)
> 
> You didn't test build this patch :(

I'm sorry I didn't run spatch on the header files too. I reran the
scripts on all lustre files including header and issued make clean and 
then make. Will be resending v2 soon. kbuild does apply all patches in
a patch set in order.

-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/5] staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2

2015-10-18 Thread Aya Mahfouz
Replaces IS_PO2 by is_power_of_2. It is more accurate to use
is_power_of_2 since it returns 1 for numbers that are powers
of 2 only whereas IS_PO2 returns 1 for 0 and numbers that are
powers of 2.

Reviewed-by: Andreas Dilger 
Signed-off-by: Aya Mahfouz 
---
v2:
-changed commit message
-added Andreas Reviewed by tag

 drivers/staging/lustre/lustre/libcfs/hash.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c 
b/drivers/staging/lustre/lustre/libcfs/hash.c
index 6f4c7d4..4b5e79a 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -109,6 +109,8 @@
 
 #include "../../include/linux/libcfs/libcfs.h"
 #include 
+#include 
+
 
 #if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1
 static unsigned int warn_on_depth = 8;
@@ -1785,7 +1787,7 @@ cfs_hash_rehash_cancel_locked(struct cfs_hash *hs)
for (i = 2; cfs_hash_is_rehashing(hs); i++) {
cfs_hash_unlock(hs, 1);
/* raise console warning while waiting too long */
-   CDEBUG(IS_PO2(i >> 3) ? D_WARNING : D_INFO,
+   CDEBUG(is_power_of_2(i >> 3) ? D_WARNING : D_INFO,
   "hash %s is still rehashing, rescheded %d\n",
   hs->hs_name, i - 1);
cond_resched();
-- 
2.4.2


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv5] staging: vme_user: provide DMA functionality

2015-10-18 Thread Martyn Welch



On 11/10/15 01:13, Dmitry Kalinkin wrote:

This introduces a new dma device that provides a single ioctl call that
provides DMA read and write functionality to the user space.

Signed-off-by: Dmitry Kalinkin 
Cc: Igor Alekseev 
---
 
In the last reply Martyn suggested a rework of this to make it use existing

bus/vme/ctl instead of creating a new bus/vme/dma%i device and also dynamically
allocate a dma resource in each request.
 
I think this doesn't need those adjustments. I think that dynamic allocation

doesn't solve any practical problem that isn't caused by current kernel api.


That would depend on what resources had already been allocated to other 
drivers using the kernel api and what resources the underlying bridge 
had to make available. This driver will currently only load if all the 
resources it wishes to expose to user space are available. That said, 
such a modification is clearly separate from adding DMA support to user 
space, so the argument is rather academic.


   
I also think that separate device is a good feature because it allows for

discovery of dma capatibility from userspace.


Given the current user space api, that's true.


The interface with separate
chardev also allows to provide DMA read() and write() syscalls that can
come handy in pair with /bin/dd.


But this patch doesn't implement such a feature does it?

(Generally happy with this for now, however couple of comments below.)



v5:
Added a validation for dma_op argument in vme_user_sg_to_dma_list(). It is
already checked in caller but we would like to silence a warning:

drivers/staging/vme/devices/vme_user.c: In function 'vme_user_ioctl.isra.4':

drivers/staging/vme/devices/vme_user.c:324:7: warning: 'dest' may be used 
uninitialized in this function [-Wmaybe-uninitialized]

   ret = vme_dma_list_add(dma_list, src, dest, hw_len);
   ^
drivers/staging/vme/devices/vme_user.c:296:52: note: 'dest' was declared 
here
   struct vme_dma_attr *pci_attr, *vme_attr, *src, *dest;
^

drivers/staging/vme/devices/vme_user.c:324:7: warning: 'src' may be used 
uninitialized in this function [-Wmaybe-uninitialized]

   ret = vme_dma_list_add(dma_list, src, dest, hw_len);
   ^
drivers/staging/vme/devices/vme_user.c:296:46: note: 'src' was declared here
   struct vme_dma_attr *pci_attr, *vme_attr, *src, *dest;

---
  drivers/staging/vme/devices/vme_user.c | 205 -
  drivers/staging/vme/devices/vme_user.h |  11 ++
  2 files changed, 213 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index 8e61a3b..2434e5f 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -79,15 +79,18 @@ static unsigned int bus_num;
   * We shall support 4 masters and 4 slaves with this driver.
   */


The comment just above here (cropped in the patch) describes the 
interface that this driver exposes and what is documented in 
Documentation/devices.txt.


I think this comment either needs updating to reflect the changes 
introduced in this patch, or deleted.


(As an aside:

The interface in Docmentation/devices.txt is an interesting oddity - it 
existed before any VME drivers were present in the kernel. Given that 
the driver at vmelinux.org hasn't been updated since some time in the 
2.4 kernel series and the lack of mainlined drivers other than this one 
using that interface, should we update that file to reflect the additions?


If we were to modify this driver sufficiently, so that chrdevs were 
dynamically allocated for example, should we delete that entry?

)


  #define VME_MAJOR 221 /* VME Major Device Number */
-#define VME_DEVS   9   /* Number of dev entries */
+#define VME_DEVS   10  /* Number of dev entries */
  
  #define MASTER_MINOR	0

  #define MASTER_MAX3
  #define SLAVE_MINOR   4
  #define SLAVE_MAX 7
  #define CONTROL_MINOR 8
+#define DMA_MINOR  9
  
-#define PCI_BUF_SIZE  0x2	/* Size of one slave image buffer */

+#define PCI_BUF_SIZE   0x2 /* Size of one slave image buffer */
+
+#define VME_MAX_DMA_LEN0x400   /* Maximal DMA transfer length 
*/
  
  /*

   * Structure to handle image related parameters.
@@ -112,7 +115,7 @@ static const int type[VME_DEVS] = { MASTER_MINOR,   
MASTER_MINOR,
MASTER_MINOR,   MASTER_MINOR,
SLAVE_MINOR,SLAVE_MINOR,
SLAVE_MINOR,SLAVE_MINOR,
-   CONTROL_MINOR
+   CONTROL_MINOR,  DMA_MINOR
 

[PATCH 2/3] staging: lustre: make sptlrpc_flavor_has_bulk return boolean

2015-10-18 Thread Geliang Tang
This patch makes sptlrpc_flavor_has_bulk return boolean, since
this function only uses either one or zero as its return value.

Signed-off-by: Geliang Tang 
---
 drivers/staging/lustre/lustre/include/lustre_sec.h | 2 +-
 drivers/staging/lustre/lustre/ptlrpc/sec.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_sec.h 
b/drivers/staging/lustre/lustre/include/lustre_sec.h
index aaadf09..dd1033b 100644
--- a/drivers/staging/lustre/lustre/include/lustre_sec.h
+++ b/drivers/staging/lustre/lustre/include/lustre_sec.h
@@ -322,7 +322,7 @@ struct sptlrpc_rule_set {
 };
 
 int sptlrpc_parse_flavor(const char *str, struct sptlrpc_flavor *flvr);
-int sptlrpc_flavor_has_bulk(struct sptlrpc_flavor *flvr);
+bool sptlrpc_flavor_has_bulk(struct sptlrpc_flavor *flvr);
 
 static inline void sptlrpc_rule_set_init(struct sptlrpc_rule_set *set)
 {
diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c 
b/drivers/staging/lustre/lustre/ptlrpc/sec.c
index 34d1330..39f5261 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c
@@ -2261,14 +2261,14 @@ EXPORT_SYMBOL(sec2target_str);
 /*
  * return true if the bulk data is protected
  */
-int sptlrpc_flavor_has_bulk(struct sptlrpc_flavor *flvr)
+bool sptlrpc_flavor_has_bulk(struct sptlrpc_flavor *flvr)
 {
switch (SPTLRPC_FLVR_BULK_SVC(flvr->sf_rpc)) {
case SPTLRPC_BULK_SVC_INTG:
case SPTLRPC_BULK_SVC_PRIV:
-   return 1;
+   return true;
default:
-   return 0;
+   return false;
}
 }
 EXPORT_SYMBOL(sptlrpc_flavor_has_bulk);
-- 
2.5.0


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


[PATCH 5/9] staging: wilc1000: fix trivial typos

2015-10-18 Thread Geliang Tang
s/regsiter/register/

Signed-off-by: Geliang Tang 
---
 drivers/staging/wilc1000/linux_wlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index ccab89f..6dc5faf 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1880,10 +1880,10 @@ static void __exit exit_wilc_driver(void)
}
 
 #ifndef WILC_SDIO
-   PRINT_D(INIT_DBG, "SPI unregsiter...\n");
+   PRINT_D(INIT_DBG, "SPI unregister...\n");
spi_unregister_driver(_bus);
 #else
-   PRINT_D(INIT_DBG, "SDIO unregsiter...\n");
+   PRINT_D(INIT_DBG, "SDIO unregister...\n");
sdio_unregister_driver(_bus);
 #endif
 
-- 
2.5.0


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


[PATCH 3/3] staging: xgifb: make XGIfb_has_VB return boolean

2015-10-18 Thread Geliang Tang
This patch makes XGIfb_has_VB return boolean, since this function
only uses either one or zero as its return value.

Signed-off-by: Geliang Tang 
---
 drivers/staging/xgifb/XGI_main_26.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 5a6251a4..89f5b55 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1548,7 +1548,7 @@ static void XGIfb_detect_VB(struct xgifb_video_info 
*xgifb_info)
}
 }
 
-static int XGIfb_has_VB(struct xgifb_video_info *xgifb_info)
+static bool XGIfb_has_VB(struct xgifb_video_info *xgifb_info)
 {
u8 vb_chipid;
 
@@ -1562,9 +1562,9 @@ static int XGIfb_has_VB(struct xgifb_video_info 
*xgifb_info)
break;
default:
xgifb_info->hasVB = HASVB_NONE;
-   return 0;
+   return false;
}
-   return 1;
+   return true;
 }
 
 static void XGIfb_get_VB_type(struct xgifb_video_info *xgifb_info)
-- 
2.5.0


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


[PATCH 1/3] staging: comedi: make ni_tio_has_gate2_registers return boolean

2015-10-18 Thread Geliang Tang
This patch makes ni_tio_has_gate2_registers return boolean, since
this function only uses either one or zero as its return value.

Signed-off-by: Geliang Tang 
---
 drivers/staging/comedi/drivers/ni_tio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio.c 
b/drivers/staging/comedi/drivers/ni_tio.c
index c20c51b..b74e44e 100644
--- a/drivers/staging/comedi/drivers/ni_tio.c
+++ b/drivers/staging/comedi/drivers/ni_tio.c
@@ -167,15 +167,15 @@ static inline unsigned GI_HW_ARM_SEL_MASK(enum 
ni_gpct_variant variant)
}
 }
 
-static int ni_tio_has_gate2_registers(const struct ni_gpct_device *counter_dev)
+static bool ni_tio_has_gate2_registers(const struct ni_gpct_device 
*counter_dev)
 {
switch (counter_dev->variant) {
case ni_gpct_variant_e_series:
default:
-   return 0;
+   return false;
case ni_gpct_variant_m_series:
case ni_gpct_variant_660x:
-   return 1;
+   return true;
}
 }
 
-- 
2.5.0


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


Re: [PATCH] vme: 8-bit status/id takes 256 values, not 255

2015-10-18 Thread Dmitry Kalinkin
On Sun, Oct 18, 2015 at 9:30 AM, Martyn Welch  wrote:
> On 10 October 2015 at 23:00, Dmitry Kalinkin  
> wrote:
>> Fixes an off by one array size.
>>
>
> The Status/ID is an 8-bit value (OK, the standard states it can be a
> 8, 16 or 32-bit value, however both of the chipsets we support at this
> point in time support an 8-bit value), why do we need a 256th entry in
> the array?
Hi Martyn,

8 bit signal spans 256 values from 8'b_ to 8'b_.
In order to serve that we need a C array of size 256.
callback[255]; in the original code means that array has 255 elements
with indices from 0 to 254, there would be no way to register callback
for a valid Status/ID value of 255 (aka 8'b_). For that we
need a 256th element.

Dmitri

>
> Martyn
>
>> Signed-off-by: Dmitry Kalinkin 
>> ---
>>  drivers/vme/vme_bridge.h | 4 +++-
>>  include/linux/vme.h  | 3 +++
>>  2 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/vme/vme_bridge.h b/drivers/vme/vme_bridge.h
>> index 397578a..b59cbee 100644
>> --- a/drivers/vme/vme_bridge.h
>> +++ b/drivers/vme/vme_bridge.h
>> @@ -1,6 +1,8 @@
>>  #ifndef _VME_BRIDGE_H_
>>  #define _VME_BRIDGE_H_
>>
>> +#include 
>> +
>>  #define VME_CRCSR_BUF_SIZE (508*1024)
>>  /*
>>   * Resource structures
>> @@ -91,7 +93,7 @@ struct vme_callback {
>>
>>  struct vme_irq {
>> int count;
>> -   struct vme_callback callback[255];
>> +   struct vme_callback callback[VME_NUM_STATUSID];
>>  };
>>
>>  /* Allow 16 characters for name (including null character) */
>> diff --git a/include/linux/vme.h b/include/linux/vme.h
>> index c013135..71e4a6d 100644
>> --- a/include/linux/vme.h
>> +++ b/include/linux/vme.h
>> @@ -81,6 +81,9 @@ struct vme_resource {
>>
>>  extern struct bus_type vme_bus_type;
>>
>> +/* Number of VME interrupt vectors */
>> +#define VME_NUM_STATUSID   256
>> +
>>  /* VME_MAX_BRIDGES comes from the type of vme_bus_numbers */
>>  #define VME_MAX_BRIDGES(sizeof(unsigned int)*8)
>>  #define VME_MAX_SLOTS  32
>> --
>> 1.8.3.1
>>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


The World Bank

2015-10-18 Thread The
The World Bank 
1818 H Street, 
NW Washington, DC 20433.
United States
Phone: + 1 252 8481 269
Fax:+ 1 477 6391

October 17, 2015.


Dear Sir/Madam,


The World Bank operates day-to-day under the leadership and direction of the 
president, management and senior staff, and the vice presidents in charge of 
Global Practices, Cross-Cutting Solutions Areas, regions, and functions.

Our Open Data yearly financial transactions across the globe offers access to 
comprehensive, local and international funds transfer with indication about 
development in countries around the globe. We have also made United Nations 
Compensation Commission (UNCC) Live—live discussions open to participants 
worldwide—a key part of our spring and Annual Meetings with the International 
communities.

Consultation and Dialogue: 25 - 27 September 2015.

Participants from NPOs, financial institutions, the European Financial 
Stability Facility (EFSF) members, and the Multinational Corporation’s and 
manufacturer’s, including observer delegations met for an in-depth exchange of 
views on a number of important issues affecting funds transaction sector, 
especially in the Asia. 

These include the FATF’s ongoing work to revise its Best Practices Paper on 
Combating the Abuse of funds transfer by some financial institutions, the need 
to avoid a “one-size-fits-all” approach to effectively combat ineffective funds 
transfer by some financial institutions and abuse of office, given that not all 
NPOs are at high risk, and the importance of ensuring that misinterpretation or 
poor implementation of funds transfer standards does not adversely impact 
legitimate charitable activities of funds beneficiaries.

Outcomes of the Plenary meeting: 25 - 27 September 2015.

The World Bank Plenary discussed the mutual evaluation reports from the office 
of the Secretary of State for Foreign and Commonwealth Affairs (Foreign & 
Commonwealth Office), and updated its statements concerning high-risk 
investigation reports and non-compliance to directive jurisdictions.

In consideration, a legislative resolution was reached in conjunction with all 
members present on financial & allied matters, following series of complaints 
and petitions received from the office of the Secretary of State for Foreign 
and Commonwealth Affairs (Foreign & Commonwealth Office) towards the 
non-release of payments of foreign beneficiaries of funds as at when due.

Our committee on financial regulations & fact finding (FRFF) for foreign 
payments which was subsequently inaugurated to help in ensuring that any 
outstanding payment is released to the beneficiary's bank account forthwith.

Thus from the records of outstanding funds beneficiaries manifest due for 
payment in India, your name was among the list of beneficiaries whose file 
showed sufficient proof for you to receive a compensation of US$ 275,500.00 /- 
(18,225,013.75 INR) for your overdue payment.

As soon as you establish a convincible verification to match same information 
we already have in our data base system, by ensuring that you provide the 
information as shown below correctly, processing and immediate transfer of the 
above funds through The United Nations Regional Office, New Delhi - India, will 
commence at the earliest.

* Full Names: 
* Residential Address:
* Mobile Telephone Numbers:
* Fax Number:
* Sex:
* Age:
* Nationality:
* Country: 
* Marital Status: 
* Occupation:
* E-mail id:

Jim Carlson
Deputy Executive Secretary
info.world.b...@bk.ru









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


Re: [PATCHv5] staging: vme_user: provide DMA functionality

2015-10-18 Thread Dmitry Kalinkin
On Sun, Oct 18, 2015 at 10:31 AM, Martyn Welch  wrote:
>
>
> On 11/10/15 01:13, Dmitry Kalinkin wrote:
>>
>> This introduces a new dma device that provides a single ioctl call that
>> provides DMA read and write functionality to the user space.
>>
>> Signed-off-by: Dmitry Kalinkin 
>> Cc: Igor Alekseev 
>> ---
>>
>> In the last reply Martyn suggested a rework of this to make it use existing
>> bus/vme/ctl instead of creating a new bus/vme/dma%i device and also
>> dynamically
>> allocate a dma resource in each request.
>>
>> I think this doesn't need those adjustments. I think that dynamic allocation
>> doesn't solve any practical problem that isn't caused by current kernel
>> api.
>
>
> That would depend on what resources had already been allocated to other
> drivers using the kernel api and what resources the underlying bridge had to
> make available. This driver will currently only load if all the resources it
> wishes to expose to user space are available. That said, such a modification
> is clearly separate from adding DMA support to user space, so the argument
> is rather academic.
Other drives meaning vme_pio, I don't see any others. All this time
we are discussing how many GE PIO boards one can plug into a crate
with or without vme_user. Most of people have zero of them.
Also, VME DMA API has no users in kernel, we are just adding one now.
>
>>I also think that separate device is a good feature because it allows
>> for
>> discovery of dma capatibility from userspace.
>
>
> Given the current user space api, that's true.
>
>> The interface with separate
>> chardev also allows to provide DMA read() and write() syscalls that can
>> come handy in pair with /bin/dd.
>
>
> But this patch doesn't implement such a feature does it?
Actually, initial (never published) version of this patch exposed
read(),write(),
and an ioctl to set the access cycle. It was working, but with subtlety for
A64 addressing. I come across some problems when using large offsets
that would not fit in signed long long. I was using FMODE_UNSIGNED_OFFSET
to fix the kernel side of things, but it seemed like userspace didn't like
the "negative" offsets. I've looked a bit at glibc sources and decided
to give up.
Now that I remember this, my original argument is kind of busted.
>
> (Generally happy with this for now, however couple of comments below.)
>
>
>>
>> v5:
>> Added a validation for dma_op argument in vme_user_sg_to_dma_list(). It is
>> already checked in caller but we would like to silence a warning:
>>
>> drivers/staging/vme/devices/vme_user.c: In function
>> 'vme_user_ioctl.isra.4':

 drivers/staging/vme/devices/vme_user.c:324:7: warning: 'dest' may be
 used uninitialized in this function [-Wmaybe-uninitialized]
>>
>>ret = vme_dma_list_add(dma_list, src, dest, hw_len);
>>^
>> drivers/staging/vme/devices/vme_user.c:296:52: note: 'dest' was
>> declared here
>>struct vme_dma_attr *pci_attr, *vme_attr, *src, *dest;
>> ^

 drivers/staging/vme/devices/vme_user.c:324:7: warning: 'src' may be used
 uninitialized in this function [-Wmaybe-uninitialized]
>>
>>ret = vme_dma_list_add(dma_list, src, dest, hw_len);
>>^
>> drivers/staging/vme/devices/vme_user.c:296:46: note: 'src' was
>> declared here
>>struct vme_dma_attr *pci_attr, *vme_attr, *src, *dest;
>>
>> ---
>>   drivers/staging/vme/devices/vme_user.c | 205
>> -
>>   drivers/staging/vme/devices/vme_user.h |  11 ++
>>   2 files changed, 213 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/vme/devices/vme_user.c
>> b/drivers/staging/vme/devices/vme_user.c
>> index 8e61a3b..2434e5f 100644
>> --- a/drivers/staging/vme/devices/vme_user.c
>> +++ b/drivers/staging/vme/devices/vme_user.c
>> @@ -79,15 +79,18 @@ static unsigned int bus_num;
>>* We shall support 4 masters and 4 slaves with this driver.
>>*/
>
>
> The comment just above here (cropped in the patch) describes the interface
> that this driver exposes and what is documented in
> Documentation/devices.txt.
I've come across a long time ago and at the time I realized that this
document is generally outdated and is not required to be updated.
First, "Last revised: 6th April 2009"
Second, the device path information is long obsolete in the light of udev.
Third, they want submissions on a separate list 
Fourth, "20 block Hitachi CD-ROM (under development) 0 = /dev/hitcd"
-- this is not for real.
>
> I think this comment either needs updating to reflect the changes introduced
> in this patch, or deleted.
>
> (As an aside:
>
> The interface in Docmentation/devices.txt is an interesting oddity - it
> existed before any VME drivers were present in the kernel. Given that the
> driver at vmelinux.org hasn't been updated since some time in the 2.4 kernel

[PATCHv6] staging: vme_user: provide DMA functionality

2015-10-18 Thread Dmitry Kalinkin
This introduces a new dma device that provides a single ioctl call that
provides DMA read and write functionality to the user space.

Signed-off-by: Dmitry Kalinkin 
Cc: Igor Alekseev 
---

v5:
Added a validation for dma_op argument in vme_user_sg_to_dma_list(). It is
already checked in caller but we would like to silence a warning:

   drivers/staging/vme/devices/vme_user.c: In function 'vme_user_ioctl.isra.4':
>> drivers/staging/vme/devices/vme_user.c:324:7: warning: 'dest' may be used 
>> uninitialized in this function [-Wmaybe-uninitialized]
  ret = vme_dma_list_add(dma_list, src, dest, hw_len);
  ^
   drivers/staging/vme/devices/vme_user.c:296:52: note: 'dest' was declared here
  struct vme_dma_attr *pci_attr, *vme_attr, *src, *dest;
   ^
>> drivers/staging/vme/devices/vme_user.c:324:7: warning: 'src' may be used 
>> uninitialized in this function [-Wmaybe-uninitialized]
  ret = vme_dma_list_add(dma_list, src, dest, hw_len);
  ^
   drivers/staging/vme/devices/vme_user.c:296:46: note: 'src' was declared here
  struct vme_dma_attr *pci_attr, *vme_attr, *src, *dest;

v6:
Changed dma ioctl id from 7 to 6

---
 drivers/staging/vme/devices/vme_user.c | 205 -
 drivers/staging/vme/devices/vme_user.h |  11 ++
 2 files changed, 213 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index 8e61a3b..2434e5f 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -79,15 +79,18 @@ static unsigned int bus_num;
  * We shall support 4 masters and 4 slaves with this driver.
  */
 #define VME_MAJOR  221 /* VME Major Device Number */
-#define VME_DEVS   9   /* Number of dev entries */
+#define VME_DEVS   10  /* Number of dev entries */
 
 #define MASTER_MINOR   0
 #define MASTER_MAX 3
 #define SLAVE_MINOR4
 #define SLAVE_MAX  7
 #define CONTROL_MINOR  8
+#define DMA_MINOR  9
 
-#define PCI_BUF_SIZE  0x2  /* Size of one slave image buffer */
+#define PCI_BUF_SIZE   0x2 /* Size of one slave image buffer */
+
+#define VME_MAX_DMA_LEN0x400   /* Maximal DMA transfer length 
*/
 
 /*
  * Structure to handle image related parameters.
@@ -112,7 +115,7 @@ static const int type[VME_DEVS] = { MASTER_MINOR,   
MASTER_MINOR,
MASTER_MINOR,   MASTER_MINOR,
SLAVE_MINOR,SLAVE_MINOR,
SLAVE_MINOR,SLAVE_MINOR,
-   CONTROL_MINOR
+   CONTROL_MINOR,  DMA_MINOR
};
 
 struct vme_user_vma_priv {
@@ -281,6 +284,172 @@ static loff_t vme_user_llseek(struct file *file, loff_t 
off, int whence)
return -EINVAL;
 }
 
+static int vme_user_sg_to_dma_list(const struct vme_dma_op *dma_op,
+  struct sg_table *sgt,
+  int sg_count, struct vme_dma_list *dma_list)
+{
+   ssize_t pos = 0;
+   struct scatterlist *sg;
+   int i, ret;
+
+   if ((dma_op->dir != VME_DMA_MEM_TO_VME) &&
+   (dma_op->dir != VME_DMA_VME_TO_MEM))
+   return -EINVAL;
+
+   for_each_sg(sgt->sgl, sg, sg_count, i) {
+   struct vme_dma_attr *pci_attr, *vme_attr, *src, *dest;
+   dma_addr_t hw_address = sg_dma_address(sg);
+   unsigned int hw_len = sg_dma_len(sg);
+
+   vme_attr = vme_dma_vme_attribute(dma_op->vme_addr + pos,
+dma_op->aspace,
+dma_op->cycle,
+dma_op->dwidth);
+   if (!vme_attr)
+   return -ENOMEM;
+
+   pci_attr = vme_dma_pci_attribute(hw_address);
+   if (!pci_attr) {
+   vme_dma_free_attribute(vme_attr);
+   return -ENOMEM;
+   }
+
+   switch (dma_op->dir) {
+   case VME_DMA_MEM_TO_VME:
+   src = pci_attr;
+   dest = vme_attr;
+   break;
+   case VME_DMA_VME_TO_MEM:
+   src = vme_attr;
+   dest = pci_attr;
+   break;
+   }
+
+   ret = vme_dma_list_add(dma_list, src, dest, hw_len);
+
+   /*
+* XXX VME API doesn't mention whether we should keep
+* attributes around
+*/
+   vme_dma_free_attribute(vme_attr);
+   vme_dma_free_attribute(pci_attr);
+
+   if (ret)
+   return ret;
+
+   pos += hw_len;

Re: [PATCH] vme: 8-bit status/id takes 256 values, not 255

2015-10-18 Thread Martyn Welch



On 18/10/15 18:07, Dmitry Kalinkin wrote:

On Sun, Oct 18, 2015 at 9:30 AM, Martyn Welch  wrote:

On 10 October 2015 at 23:00, Dmitry Kalinkin  wrote:

Fixes an off by one array size.


The Status/ID is an 8-bit value (OK, the standard states it can be a
8, 16 or 32-bit value, however both of the chipsets we support at this
point in time support an 8-bit value), why do we need a 256th entry in
the array?

Hi Martyn,

8 bit signal spans 256 values from 8'b_ to 8'b_.
In order to serve that we need a C array of size 256.
callback[255]; in the original code means that array has 255 elements
with indices from 0 to 254, there would be no way to register callback
for a valid Status/ID value of 255 (aka 8'b_). For that we
need a 256th element.


Err, yep. (Curses self for being so stupid.)

Signed-off-by: Martyn Welch 


Dmitri


Martyn


Signed-off-by: Dmitry Kalinkin 
---
  drivers/vme/vme_bridge.h | 4 +++-
  include/linux/vme.h  | 3 +++
  2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/vme/vme_bridge.h b/drivers/vme/vme_bridge.h
index 397578a..b59cbee 100644
--- a/drivers/vme/vme_bridge.h
+++ b/drivers/vme/vme_bridge.h
@@ -1,6 +1,8 @@
  #ifndef _VME_BRIDGE_H_
  #define _VME_BRIDGE_H_

+#include 
+
  #define VME_CRCSR_BUF_SIZE (508*1024)
  /*
   * Resource structures
@@ -91,7 +93,7 @@ struct vme_callback {

  struct vme_irq {
 int count;
-   struct vme_callback callback[255];
+   struct vme_callback callback[VME_NUM_STATUSID];
  };

  /* Allow 16 characters for name (including null character) */
diff --git a/include/linux/vme.h b/include/linux/vme.h
index c013135..71e4a6d 100644
--- a/include/linux/vme.h
+++ b/include/linux/vme.h
@@ -81,6 +81,9 @@ struct vme_resource {

  extern struct bus_type vme_bus_type;

+/* Number of VME interrupt vectors */
+#define VME_NUM_STATUSID   256
+
  /* VME_MAX_BRIDGES comes from the type of vme_bus_numbers */
  #define VME_MAX_BRIDGES(sizeof(unsigned int)*8)
  #define VME_MAX_SLOTS  32
--
1.8.3.1



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