[PATCH] drivers: staging: rtl8723au: fix warning: cast to restricted __le16

2015-04-02 Thread Piotr Witoslawski
Signed-off-by: Piotr Witoslawski pwi...@gmail.com
---
 drivers/staging/rtl8723au/hal/rtl8723au_xmit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c 
b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
index 1759487..256958e 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
@@ -51,7 +51,8 @@ static void rtl8192cu_cal_txdesc_chksum(struct tx_desc
*ptxdesc)
ptxdesc-txdw7 = cpu_to_le32(0x);
 
for (index = 0 ; index  count ; index++)
-   checksum = checksum ^ le16_to_cpu(*(usPtr + index));
+   checksum = checksum ^ le16_to_cpu(
+   *(__le16 *)(usPtr + index));
 
ptxdesc-txdw7 |= cpu_to_le32(0xchecksum);
 }
-- 
2.0.5

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


are you looking for email marketing?

2015-04-02 Thread Martin

Hi,

You are receiving this email because we wish you to use our target email
marketing service.

Email marketing is one of the best marketing strategies of all time and has
helped many businesses
globally achieve their goals, double their profits and increase their
client base.

We have worked on a number of projects and campaigns, all our packages are
tailor made and designed according to your requirements.
Increase your client base and market your product to millions or let us
bring the buying leads for you!
We can always help your business reach the next level!
Our goal is to increase your business sales 2-5 times than now.

If you would require more information please send us an email and we would
be glad to discuss the project requirements with you!
Looking forward to your positive response.

Kind Regards
Martin
Email Marketing Specialist
Contact: talo...@tom.com

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


[patch] android, lmk: avoid setting TIF_MEMDIE if process has already exited

2015-04-02 Thread David Rientjes
TIF_MEMDIE should not be set on a process if it does not have a valid 
-mm, and this is protected by task_lock().

If TIF_MEMDIE gets set after the mm has detached, and the process fails to 
exit, then the oom killer will defer forever waiting for it to exit.

Make sure that the mm is still valid before setting TIF_MEMDIE by way of 
mark_tsk_oom_victim().

Cc: Arve Hjønnevåg a...@android.com
Cc: Riley Andrews riandr...@android.com
Acked-by: Michal Hocko mho...@suse.cz
Signed-off-by: David Rientjes rient...@google.com
---
 drivers/staging/android/lowmemorykiller.c | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/android/lowmemorykiller.c 
b/drivers/staging/android/lowmemorykiller.c
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -156,20 +156,27 @@ static unsigned long lowmem_scan(struct shrinker *s, 
struct shrink_control *sc)
 p-pid, p-comm, oom_score_adj, tasksize);
}
if (selected) {
-   lowmem_print(1, send sigkill to %d (%s), adj %hd, size %d\n,
-selected-pid, selected-comm,
-selected_oom_score_adj, selected_tasksize);
-   lowmem_deathpending_timeout = jiffies + HZ;
+   task_lock(selected);
+   if (!selected-mm) {
+   /* Already exited, cannot do mark_tsk_oom_victim() */
+   task_unlock(selected);
+   goto out;
+   }
/*
 * FIXME: lowmemorykiller shouldn't abuse global OOM killer
 * infrastructure. There is no real reason why the selected
 * task should have access to the memory reserves.
 */
mark_tsk_oom_victim(selected);
+   task_unlock(selected);
+   lowmem_print(1, send sigkill to %d (%s), adj %hd, size %d\n,
+selected-pid, selected-comm,
+selected_oom_score_adj, selected_tasksize);
+   lowmem_deathpending_timeout = jiffies + HZ;
send_sig(SIGKILL, selected, 0);
rem += selected_tasksize;
}
-
+out:
lowmem_print(4, lowmem_scan %lu, %x, return %lu\n,
 sc-nr_to_scan, sc-gfp_mask, rem);
rcu_read_unlock();___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: replace kzalloc with copy_from_user with memdup_user

2015-04-02 Thread Julia Lawall


On Tue, 31 Mar 2015, Drokin, Oleg wrote:


 On Mar 31, 2015, at 11:57 AM, gre...@linuxfoundation.org wrote:

  On Tue, Mar 31, 2015 at 05:15:23PM +0200, Julia Lawall wrote:
  On Tue, 31 Mar 2015, Dhere, Chaitanya (C.) wrote:
 
  This patch replaces kzalloc and copy_from_user with memdup_user call
  This change was detected with coccinelle tool
 
  Signed-off-by: Chaitanya Dhere cvija...@visteon.com
  ---
  drivers/staging/lustre/lustre/llite/file.c |   11 +++
  1 file changed, 3 insertions(+), 8 deletions(-)
 
  diff --git a/drivers/staging/lustre/lustre/llite/file.c 
  b/drivers/staging/lustre/lustre/llite/file.c
  index 85e74d1..85b5567 100644
  --- a/drivers/staging/lustre/lustre/llite/file.c
  +++ b/drivers/staging/lustre/lustre/llite/file.c
  @@ -2368,14 +2368,9 @@ ll_file_ioctl(struct file *file, unsigned int cmd, 
  unsigned long arg)
struct hsm_state_set*hss;
int  rc;
 
  - hss = kzalloc(sizeof(*hss), GFP_NOFS);
  - if (!hss)
  - return -ENOMEM;
  -
  - if (copy_from_user(hss, (char *)arg, sizeof(*hss))) {
  - OBD_FREE_PTR(hss);
  - return -EFAULT;
  - }
  + hss = memdup_user((char *)arg, sizeof(*hss));
 
  memdup_user will use the flag GFP_KERNEL, ie (__GFP_WAIT | __GFP_IO |
  __GFP_FS), rather than the flag GFP_NOFS, ie (__GFP_WAIT | __GFP_IO), that
  is specified.  I don't know if this is a problem here.
 
  Yes, this is a filesystem, so this can't be changed, as we can't have
  the allocation go out and ask for more filesystem accesses in the middle
  of trying to do a filesystem access :)

 Technically in this place we are not really holding any locks or anything 
 else of value to cause a deadlock,
 so we might be fine here.
 More importantly, I totally missed this OBD_ALLOC replacement with kzalloc 
 when it happened.
 In theory all OBD_ALLOC() calls add up all allocated memory in a counter and 
 then OBD_FREE() calls
 subtract freed memory (for a poor man's memory leak detection and tracing).
 Now since it's out of match, there should have been tons of very loud 
 warnings about it, but I don't see
 any in my logs and I wonder why.

 Julia, I wonder if you happen to have a bunch of other patches to get rid of 
 the rest of OBD_ALLOC and OBD_FREE stuff by any chance?

I can generate them again, but I wasn't clear on what was wanted.  I would
really prefer something where it is explicit at the call site that an
assignment is taking place.  If we can have x = obd_alloc(...) and
obd_free(x,...) (I don't have time to look up the exact arguments at the
moment), then I can take care of that).  I still think it is too bad that
this code won't benefit from rules written for more generic memory
allocation functions, but if the extra debugging facility provided by
these functions is useful, then I guess it is reasonable to keep it.

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


Re: [PATCH] drivers: staging: rtl8723au: fix warning: cast to restricted __le16

2015-04-02 Thread Dan Carpenter
This doesn't look right and it doesn't have a changelog explainly the
weirdness.

regards,
dan carpenter

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


Re: [PATCH] drivers: staging: rtl8723au: fix warning: cast to restricted __le16

2015-04-02 Thread Jes Sorensen
Dan Carpenter dan.carpen...@oracle.com writes:
 This doesn't look right and it doesn't have a changelog explainly the
 weirdness.


... and the fix is as ugly as it gets!

If something like this is needed, creating a __le16 *ptr at the
beginnging of the function would be a lot better.

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


[PATCH] staging:rtl8192e: Change printk statements in rtllib_tx.c to use netdev_dev

2015-04-02 Thread Nicholas Krause
This changes the remaining printk statements with the log level of KERN_INFO
to use the more appropriate netdev_info for print messages related to code
using or part of the networking subsystem. Further more this was found by
running checkpatch.pl on the file, rtllib_tx.c.

Signed-off-by: Nicholas Krause xerofo...@gmail.com
---
 drivers/staging/rtl8192e/rtllib_tx.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_tx.c 
b/drivers/staging/rtl8192e/rtllib_tx.c
index 4f68ffe..b54e623 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -185,7 +185,7 @@ int rtllib_encrypt_fragment(struct rtllib_device *ieee, 
struct sk_buff *frag,
crypt = ieee-crypt_info.crypt[ieee-crypt_info.tx_keyidx];
 
if (!(crypt  crypt-ops)) {
-   printk(KERN_INFO =%s(), crypt is null\n, __func__);
+   netdev_info(ieee-dev, =%s(), crypt is null\n, 
__func__);
return -1;
}
/* To encrypt, frame format is:
@@ -202,7 +202,7 @@ int rtllib_encrypt_fragment(struct rtllib_device *ieee, 
struct sk_buff *frag,
 
atomic_dec(crypt-refcnt);
if (res  0) {
-   printk(KERN_INFO %s: Encryption failed: len=%d.\n,
+   netdev_info(ieee-dev, %s: Encryption failed: len=%d.\n,
   ieee-dev-name, frag-len);
ieee-ieee_stats.tx_discards++;
return -1;
@@ -311,7 +311,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device 
*ieee,
if (pHTInfo-bCurrentAMPDUEnable) {
if (!GetTs(ieee, (struct ts_common_info **)(pTxTs), hdr-addr1,
skb-priority, TX_DIR, true)) {
-   printk(KERN_INFO %s: can't get TS\n, __func__);
+   netdev_info(ieee-dev, %s: can't get TS\n, __func__);
return;
}
if (pTxTs-TxAdmittedBARecord.bValid == false) {
@@ -582,7 +582,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct 
net_device *dev)
   IEEE_SOFTMAC_TX_QUEUE)) ||
   ((!ieee-softmac_data_hard_start_xmit 
   (ieee-softmac_features  IEEE_SOFTMAC_TX_QUEUE {
-   printk(KERN_WARNING %s: No xmit handler.\n,
+   netdev_info(ieee-dev, %s: No xmit handler.\n,
   ieee-dev-name);
goto success;
}
@@ -590,7 +590,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct 
net_device *dev)
 
if (likely(ieee-raw_tx == 0)) {
if (unlikely(skb-len  SNAP_SIZE + sizeof(u16))) {
-   printk(KERN_WARNING %s: skb too small (%d).\n,
+   netdev_info(ieee-dev, %s: skb too small (%d).\n,
ieee-dev-name, skb-len);
goto success;
}
@@ -604,7 +604,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct 
net_device *dev)
if (ieee-iw_mode == IW_MODE_MONITOR) {
txb = rtllib_alloc_txb(1, skb-len, GFP_ATOMIC);
if (unlikely(!txb)) {
-   printk(KERN_WARNING %s: Could not allocate 
+   netdev_info(ieee-dev, %s: Could not allocate 
   TXB\n,
ieee-dev-name);
goto failed;
@@ -636,7 +636,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct 
net_device *dev)
}
}
} else if (ETH_P_ARP == ether_type) {
-   printk(KERN_INFO =DHCP 
+   netdev_info(ieee-dev, =DHCP 
   Protocol start tx ARP pkt!!\n);
bdhcp = true;
ieee-LPSDelayCnt =
@@ -717,10 +717,10 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct 
net_device *dev)
 
/* in case we are a client verify acm is not set for this ac */
while (unlikely(ieee-wmm_acm  (0x01  skb-priority))) {
-   printk(KERN_INFO skb-priority = %x\n, skb-priority);
+   netdev_info(ieee-dev, skb-priority = %x\n, 
skb-priority);
if (wme_downgrade_ac(skb))
break;
-   printk(KERN_INFO converted skb-priority = %x\n,
+   netdev_info(ieee-dev, converted skb-priority = %x\n,
   skb-priority);
 }
qos_ctl |= skb-priority;
@@ -760,7 +760,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct 
net_device *dev)
txb = rtllib_alloc_txb(nr_frags, frag_size +
   ieee-tx_headroom, GFP_ATOMIC);
  

[PATCH] Staging: lustre: o2iblnd_modparam.c: remove unneeded space before the arguments of a function

2015-04-02 Thread Gwendoline Chouasne-Guillon
From d4def87bcfa41640c5ba0e171036c0ee9da98c08 Mon Sep 17 00:00:00 2001
From: Gwendoline Chouasne-Guillon choua...@clipper.ens.fr
Date: Thu, 2 Apr 2015 16:11:04 +0200
Subject: [PATCH] Staging: lustre: o2iblnd_modparam.c: remove unneeded space
 before the arguments of a function

Remove unneeded space before the arguments of a function

Signed_off_by: Gwendoline Chouasne-guillon choua...@ens.fr
---
 .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c  |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c
index 8b4a8e9..9da0485 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c
@@ -177,7 +177,7 @@ kib_tunables_t kiblnd_tunables = {
 };

 int
-kiblnd_tunables_init (void)
+kiblnd_tunables_init(void)
 {
if (kiblnd_translate_mtu(*kiblnd_tunables.kib_ib_mtu)  0) {
CERROR(Invalid ib_mtu %d, expected 256/512/1024/2048/4096\n,
-- 
1.7.9.5



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


Patch for syntax done

2015-04-02 Thread ruggero
From f770478d61e80e66cb310b92529f968c12831206 Mon Sep 17 00:00:00 2001
From: Cyrille Ruggero cyrille.rugg...@ens.fr
Date: Thu, 2 Apr 2015 16:09:14 +0200
Subject: [PATCH] Staging: lustre: dir.c: adding a blank after a declaration.

Adding a blank in this file after a declaration as reported by checkpatch.pl.

---
 drivers/staging/lustre/lustre/llite/dir.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index a182019..ad2cbc6 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -1518,6 +1518,7 @@ out_rmdir:
lump = (struct lov_user_md *)arg;
} else {
struct lov_user_mds_data *lmdp;
+
lmdp = (struct lov_user_mds_data *)arg;
lump = lmdp-lmd_lmm;
}
-- 
1.7.9.5

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


Re: [PATCH] Staging: lustre: o2iblnd_modparam.c: remove unneeded space before the arguments of a function

2015-04-02 Thread Dan Carpenter
On Thu, Apr 02, 2015 at 04:32:32PM +0200, Gwendoline Chouasne-Guillon wrote:
 From d4def87bcfa41640c5ba0e171036c0ee9da98c08 Mon Sep 17 00:00:00 2001
 From: Gwendoline Chouasne-Guillon choua...@clipper.ens.fr
 Date: Thu, 2 Apr 2015 16:11:04 +0200
 Subject: [PATCH] Staging: lustre: o2iblnd_modparam.c: remove unneeded space
  before the arguments of a function
 

Remove this bogus text block.

regards,
dan carpenter

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


Re: [PATCH] Staging: lustre: api-ni.c: adding tabs because lines were too long.

2015-04-02 Thread Dan Carpenter
Also fix your email client from header so that it shows your name.

regards,
dan carpenter

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


[PATCH] staging: lustre: ping_test.c : remove space after function names

2015-04-02 Thread Auguste Olivry
remove space between function names and open parentheses as reported by
checkpatch.pl.

Signed-off-by: Auguste Olivry auguste.oli...@ens.fr
---
 drivers/staging/lustre/lnet/selftest/ping_test.c |   30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c 
b/drivers/staging/lustre/lnet/selftest/ping_test.c
index d8c0df6..644069a 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -70,19 +70,19 @@ ping_client_init(sfw_test_instance_t *tsi)
 }
 
 static void
-ping_client_fini (sfw_test_instance_t *tsi)
+ping_client_fini(sfw_test_instance_t *tsi)
 {
sfw_session_t *sn = tsi-tsi_batch-bat_session;
int errors;
 
-   LASSERT (sn != NULL);
-   LASSERT (tsi-tsi_is_client);
+   LASSERT(sn != NULL);
+   LASSERT(tsi-tsi_is_client);
 
errors = atomic_read(sn-sn_ping_errors);
if (errors)
-   CWARN (%d pings have failed.\n, errors);
+   CWARN(%d pings have failed.\n, errors);
else
-   CDEBUG (D_NET, Ping test finished OK.\n);
+   CDEBUG(D_NET, Ping test finished OK.\n);
 }
 
 static int
@@ -118,7 +118,7 @@ ping_client_prep_rpc(sfw_test_unit_t *tsu,
 }
 
 static void
-ping_client_done_rpc (sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
+ping_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 {
sfw_test_instance_t *tsi = tsu-tsu_instance;
sfw_session_t   *sn = tsi-tsi_batch-bat_session;
@@ -126,12 +126,12 @@ ping_client_done_rpc (sfw_test_unit_t *tsu, 
srpc_client_rpc_t *rpc)
srpc_ping_reply_t   *reply = rpc-crpc_replymsg.msg_body.ping_reply;
struct timeval   tv;
 
-   LASSERT (sn != NULL);
+   LASSERT(sn != NULL);
 
if (rpc-crpc_status != 0) {
if (!tsi-tsi_stopping) /* rpc could have been aborted */
atomic_inc(sn-sn_ping_errors);
-   CERROR (Unable to ping %s (%d): %d\n,
+   CERROR(Unable to ping %s (%d): %d\n,
libcfs_id2str(rpc-crpc_dest),
reqst-pnr_seq, rpc-crpc_status);
return;
@@ -146,7 +146,7 @@ ping_client_done_rpc (sfw_test_unit_t *tsu, 
srpc_client_rpc_t *rpc)
if (reply-pnr_magic != LST_PING_TEST_MAGIC) {
rpc-crpc_status = -EBADMSG;
atomic_inc(sn-sn_ping_errors);
-   CERROR (Bad magic %u from %s, %u expected.\n,
+   CERROR(Bad magic %u from %s, %u expected.\n,
reply-pnr_magic, libcfs_id2str(rpc-crpc_dest),
LST_PING_TEST_MAGIC);
return;
@@ -155,14 +155,14 @@ ping_client_done_rpc (sfw_test_unit_t *tsu, 
srpc_client_rpc_t *rpc)
if (reply-pnr_seq != reqst-pnr_seq) {
rpc-crpc_status = -EBADMSG;
atomic_inc(sn-sn_ping_errors);
-   CERROR (Bad seq %u from %s, %u expected.\n,
+   CERROR(Bad seq %u from %s, %u expected.\n,
reply-pnr_seq, libcfs_id2str(rpc-crpc_dest),
reqst-pnr_seq);
return;
}
 
cfs_fs_timeval(tv);
-   CDEBUG (D_NET, %d reply in %u usec\n, reply-pnr_seq,
+   CDEBUG(D_NET, %d reply in %u usec\n, reply-pnr_seq,
(unsigned)((tv.tv_sec - (unsigned)reqst-pnr_time_sec) * 100
   + (tv.tv_usec - reqst-pnr_time_usec)));
return;
@@ -177,20 +177,20 @@ ping_server_handle(struct srpc_server_rpc *rpc)
srpc_ping_reqst_t *req = reqstmsg-msg_body.ping_reqst;
srpc_ping_reply_t *rep = rpc-srpc_replymsg.msg_body.ping_reply;
 
-   LASSERT (sv-sv_id == SRPC_SERVICE_PING);
+   LASSERT(sv-sv_id == SRPC_SERVICE_PING);
 
if (reqstmsg-msg_magic != SRPC_MSG_MAGIC) {
-   LASSERT (reqstmsg-msg_magic == __swab32(SRPC_MSG_MAGIC));
+   LASSERT(reqstmsg-msg_magic == __swab32(SRPC_MSG_MAGIC));
 
__swab32s(req-pnr_seq);
__swab32s(req-pnr_magic);
__swab64s(req-pnr_time_sec);
__swab64s(req-pnr_time_usec);
}
-   LASSERT (reqstmsg-msg_type == srpc_service2request(sv-sv_id));
+   LASSERT(reqstmsg-msg_type == srpc_service2request(sv-sv_id));
 
if (req-pnr_magic != LST_PING_TEST_MAGIC) {
-   CERROR (Unexpected magic %08x from %s\n,
+   CERROR(Unexpected magic %08x from %s\n,
req-pnr_magic, libcfs_id2str(rpc-srpc_peer));
return -EINVAL;
}
-- 
1.7.9.5

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


Re: [PATCH] Staging: lustre: dir.c: adding a blank after a declaration.

2015-04-02 Thread Greg KH
On Thu, Apr 02, 2015 at 06:24:21PM +0300, Dan Carpenter wrote:
 Still mangled.  Read Documentation/email-clients.txt.  Send the patch
 to yourself.  Apply it with git am.  Then resend when that works.

Dan, sorry about these, I just taught a class how to write a kernel
patch, and emails got all mangled due to them being in a university lab
without git-send-email.  Some also got messed up as I started them out
on the wrong branch (Linus's master, not linux-next), which was my
fault.

I'll handle all of these lustre patches for the next day or so as people
submit them, and work with them to get them sent properly, no need for
you to mess with it.

thanks,

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


[PATCH v2] drivers: staging: rtl8723au: fix warning: cast to restricted __le16

2015-04-02 Thread Piotr Witoslawski
This patch fixes the sparse warning: cast to restricted __le16 reported
for rtl8723au/hal/rtl8723au_xmit.c

Signed-off-by: Piotr Witoslawski pwi...@gmail.com
---
v2: Changing pointer type instead of casting, as suggested by Jes Sorensen 
jes.soren...@redhat.com

 drivers/staging/rtl8723au/hal/rtl8723au_xmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c 
b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
index 1759487..967e7de 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
@@ -42,7 +42,7 @@ static int urb_zero_packet_chk(struct rtw_adapter *padapter, 
int sz)
 
 static void rtl8192cu_cal_txdesc_chksum(struct tx_desc *ptxdesc)
 {
-   u16 *usPtr = (u16 *)ptxdesc;
+   __le16  *usPtr = (__le16 *)ptxdesc;
u32 count = 16; /*  (32 bytes / 2 bytes per XOR) = 16 
times */
u32 index;
u16 checksum = 0;
-- 
2.0.5

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


[PATCH] Staging: lustre: module.c: remove unneeded return statement

2015-04-02 Thread Greg Kroah-Hartman
Remove an unneeded return statement in this file as reported by
checkpatch.pl.

Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org
---
 drivers/staging/lustre/lnet/selftest/module.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/selftest/module.c 
b/drivers/staging/lustre/lnet/selftest/module.c
index faf409802372..7ad62f167cea 100644
--- a/drivers/staging/lustre/lnet/selftest/module.c
+++ b/drivers/staging/lustre/lnet/selftest/module.c
@@ -87,7 +87,6 @@ lnet_selftest_fini(void)
default:
LBUG();
}
-   return;
 }
 
 static int
-- 
2.3.5

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


[PATCH V2 0/3] Fix some issues of staging ion test driver

2015-04-02 Thread Phong Tran
Hi Greg, Arve, Riley, Dan,

This patcheset fixes:
(1) Define the GPL V2 for ion_test driver
(2) Add the remove() platform driver callback to
deregister the misc device
(3) unregister platform device when driver is unloaded

Thank for Dan's reivew.

Changes from v1:
Imporve the coding style

Phong Tran (3):
  staging: android: ion_test: Add the MODULE_LICENSE macro
  staging: android: ion_test: unregister the misc device
  staging: android: ion_test: unregister the platform device

 drivers/staging/android/ion/ion_test.c | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

-- 
2.1.0

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


[PATCH] Staging: lustre: api-ni.c: adding tabs because lines were too long.

2015-04-02 Thread vcabanne
From 654380760bfc5b35ed3d3d4a7d3eb126fe747959 Mon Sep 17 00:00:00 2001
From: Vivien Cabannes vcaba...@clipper.ens.fr
Date: Thu, 2 Apr 2015 16:32:15 +0200
Subject: [PATCH] Staging: lustre: api-ni.c: adding tabs because lines were
 too long.

Adding tabs because lines were too long.

---
 drivers/staging/lustre/lnet/lnet/api-ni.c |   23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index faceb95..4b5d465 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -74,7 +74,8 @@ lnet_get_networks(void)
int rc;
 
if (*networks != 0  *ip2nets != 0) {
-   LCONSOLE_ERROR_MSG(0x101, Please specify EITHER 'networks' or 
'ip2nets' but not both at once\n);
+   LCONSOLE_ERROR_MSG(0x101, Please specify EITHER 'networks'
+   or 'ip2nets' but not both at once\n);
return NULL;
}
 
@@ -197,7 +198,9 @@ static void lnet_assert_wire_constants(void)
/* Checks for struct ptl_handle_wire_t */
CLASSERT((int)sizeof(lnet_handle_wire_t) == 16);
CLASSERT((int)offsetof(lnet_handle_wire_t, wh_interface_cookie) == 0);
-   CLASSERT((int)sizeof(((lnet_handle_wire_t *)0)-wh_interface_cookie) == 
8);
+   CLASSERT(
+   (int)sizeof(((lnet_handle_wire_t *)0)-wh_interface_cookie
+   ) == 8);
CLASSERT((int)offsetof(lnet_handle_wire_t, wh_object_cookie) == 8);
CLASSERT((int)sizeof(((lnet_handle_wire_t *)0)-wh_object_cookie) == 8);
 
@@ -1089,8 +1092,9 @@ lnet_startup_lndnis(void)
LNET_MUTEX_UNLOCK(the_lnet.ln_lnd_mutex);
 
if (rc != 0) {
-   LCONSOLE_ERROR_MSG(0x105, Error %d starting up LNI 
%s\n,
-  rc, libcfs_lnd2str(lnd-lnd_type));
+   LCONSOLE_ERROR_MSG(0x105,
+   Error %d starting up LNI %s\n,
+   rc, libcfs_lnd2str(lnd-lnd_type));
lnet_net_lock(LNET_LOCK_EX);
lnd-lnd_refcount--;
lnet_net_unlock(LNET_LOCK_EX);
@@ -1145,8 +1149,9 @@ lnet_startup_lndnis(void)
 
if (the_lnet.ln_eq_waitni != NULL  nicount  1) {
lnd_type = the_lnet.ln_eq_waitni-ni_lnd-lnd_type;
-   LCONSOLE_ERROR_MSG(0x109, LND %s can only run 
single-network\n,
-  libcfs_lnd2str(lnd_type));
+   LCONSOLE_ERROR_MSG(0x109,
+   LND %s can only run single-network\n,
+   libcfs_lnd2str(lnd_type));
goto failed;
}
 
@@ -1191,7 +1196,8 @@ LNetInit(void)
LASSERT(the_lnet.ln_cpt_number  0);
if (the_lnet.ln_cpt_number  LNET_CPT_MAX) {
/* we are under risk of consuming all lh_cookie */
-   CERROR(Can't have %d CPTs for LNet (max allowed is %d), please 
change setting of CPT-table and retry\n,
+   CERROR(Can't have %d CPTs for LNet (max allowed is %d),
+  please change setting of CPT-table and retry\n,
   the_lnet.ln_cpt_number, LNET_CPT_MAX);
return -1;
}
@@ -1753,7 +1759,8 @@ lnet_ping_target_fini(void)
 }
 
 int
-lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int 
n_ids)
+lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids,
+ int n_ids)
 {
lnet_handle_eq_t eqh;
lnet_handle_md_t mdh;
-- 
1.7.9.5

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


Re: [PATCH] Staging: lustre: api-ni.c: adding tabs because lines were too long.

2015-04-02 Thread Dan Carpenter
On Thu, Apr 02, 2015 at 05:03:38PM +0200, vcaba...@clipper.ens.fr wrote:
 From 654380760bfc5b35ed3d3d4a7d3eb126fe747959 Mon Sep 17 00:00:00 2001
 From: Vivien Cabannes vcaba...@clipper.ens.fr
 Date: Thu, 2 Apr 2015 16:32:15 +0200
 Subject: [PATCH] Staging: lustre: api-ni.c: adding tabs because lines were
  too long.

Remove this.

 
 Adding tabs because lines were too long.

No signed-off-by.

 
 ---
  drivers/staging/lustre/lnet/lnet/api-ni.c |   23 +++
  1 file changed, 15 insertions(+), 8 deletions(-)
 
 diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
 b/drivers/staging/lustre/lnet/lnet/api-ni.c
 index faceb95..4b5d465 100644
 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c
 +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
 @@ -74,7 +74,8 @@ lnet_get_networks(void)
   int rc;
  
   if (*networks != 0  *ip2nets != 0) {
 - LCONSOLE_ERROR_MSG(0x101, Please specify EITHER 'networks' or 
 'ip2nets' but not both at once\n);
 + LCONSOLE_ERROR_MSG(0x101, Please specify EITHER 'networks'
 + or 'ip2nets' but not both at once\n);

Don't break up string literals.  We want to be able to grep for them.
Also this mangles the printed text.

   return NULL;
   }
  
 @@ -197,7 +198,9 @@ static void lnet_assert_wire_constants(void)
   /* Checks for struct ptl_handle_wire_t */
   CLASSERT((int)sizeof(lnet_handle_wire_t) == 16);
   CLASSERT((int)offsetof(lnet_handle_wire_t, wh_interface_cookie) == 0);
 - CLASSERT((int)sizeof(((lnet_handle_wire_t *)0)-wh_interface_cookie) == 
 8);
 + CLASSERT(
 + (int)sizeof(((lnet_handle_wire_t *)0)-wh_interface_cookie
 + ) == 8);

That's silly.  The original is better.

   CLASSERT((int)offsetof(lnet_handle_wire_t, wh_object_cookie) == 8);
   CLASSERT((int)sizeof(((lnet_handle_wire_t *)0)-wh_object_cookie) == 8);
  
 @@ -1089,8 +1092,9 @@ lnet_startup_lndnis(void)
   LNET_MUTEX_UNLOCK(the_lnet.ln_lnd_mutex);
  
   if (rc != 0) {
 - LCONSOLE_ERROR_MSG(0x105, Error %d starting up LNI 
 %s\n,
 -rc, libcfs_lnd2str(lnd-lnd_type));
 + LCONSOLE_ERROR_MSG(0x105,
 + Error %d starting up LNI %s\n,
 + rc, libcfs_lnd2str(lnd-lnd_type));

Fine.

   lnet_net_lock(LNET_LOCK_EX);
   lnd-lnd_refcount--;
   lnet_net_unlock(LNET_LOCK_EX);
 @@ -1145,8 +1149,9 @@ lnet_startup_lndnis(void)
  
   if (the_lnet.ln_eq_waitni != NULL  nicount  1) {
   lnd_type = the_lnet.ln_eq_waitni-ni_lnd-lnd_type;
 - LCONSOLE_ERROR_MSG(0x109, LND %s can only run 
 single-network\n,
 -libcfs_lnd2str(lnd_type));
 + LCONSOLE_ERROR_MSG(0x109,
 + LND %s can only run single-network\n,
 + libcfs_lnd2str(lnd_type));

Good.

   goto failed;
   }
  
 @@ -1191,7 +1196,8 @@ LNetInit(void)
   LASSERT(the_lnet.ln_cpt_number  0);
   if (the_lnet.ln_cpt_number  LNET_CPT_MAX) {
   /* we are under risk of consuming all lh_cookie */
 - CERROR(Can't have %d CPTs for LNet (max allowed is %d), please 
 change setting of CPT-table and retry\n,
 + CERROR(Can't have %d CPTs for LNet (max allowed is %d),
 +please change setting of CPT-table and retry\n,

Nope.  Bad.

  the_lnet.ln_cpt_number, LNET_CPT_MAX);
   return -1;
   }
 @@ -1753,7 +1759,8 @@ lnet_ping_target_fini(void)
  }
  
  int
 -lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int 
 n_ids)
 +lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids,
 +   int n_ids)

Fine.

regards,
dan carpenter

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


Re: [PATCH] Staging: lustre: api-ni.c: adding tabs because lines were too long.

2015-04-02 Thread Greg KH
On Thu, Apr 02, 2015 at 04:57:52PM +0200, vcaba...@clipper.ens.fr wrote:
 From 654380760bfc5b35ed3d3d4a7d3eb126fe747959 Mon Sep 17 00:00:00 2001
 From: Vivien Cabannes vcaba...@clipper.ens.fr
 Date: Thu, 2 Apr 2015 16:32:15 +0200
 Subject: [PATCH] Staging: lustre: api-ni.c: adding tabs because lines were
  too long.
 
 Adding tabs because lines were too long.

Better, but you forgot a signed-off-by line, remember to run the patch
through scripts/checkpatch.pl before you send it out.

thanks,

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


[PATCH] Staging: lustre: dir.c: adding a blank after a declaration.

2015-04-02 Thread ruggero
From f770478d61e80e66cb310b92529f968c12831206 Mon Sep 17 00:00:00 2001
From: Cyrille Ruggero cyrille.rugg...@ens.fr
Date: Thu, 2 Apr 2015 16:09:14 +0200
Subject: [PATCH] Staging: lustre: dir.c: adding a blank after a declaration.

Adding a blank in this file after a declaration as reported by checkpatch.pl.

Signed-off-by: Cyrille Ruggero cyrille.rugg...@ens.fr

---
 drivers/staging/lustre/lustre/llite/dir.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index a182019..ad2cbc6 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -1518,6 +1518,7 @@ out_rmdir:
lump = (struct lov_user_md *)arg;
} else {
struct lov_user_mds_data *lmdp;
+
lmdp = (struct lov_user_mds_data *)arg;
lump = lmdp-lmd_lmm;
}
-- 
1.7.9.5

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


Re: Patch for syntax done

2015-04-02 Thread Dan Carpenter
Fix your email client from header so it shows your name.

regards,
dan carpenter

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


[PATCH] staging: lustre: ping_test.c : remove space after function names

2015-04-02 Thread Auguste Olivry
remove space between function names and open parentheses as reported by
checkpatch.pl.

Signed-off-by: Auguste Olivry auguste.oli...@ens.fr
---
 drivers/staging/lustre/lnet/selftest/ping_test.c |   30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c 
b/drivers/staging/lustre/lnet/selftest/ping_test.c
index d8c0df6..644069a 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -70,19 +70,19 @@ ping_client_init(sfw_test_instance_t *tsi)
 }
 
 static void
-ping_client_fini (sfw_test_instance_t *tsi)
+ping_client_fini(sfw_test_instance_t *tsi)
 {
sfw_session_t *sn = tsi-tsi_batch-bat_session;
int errors;
 
-   LASSERT (sn != NULL);
-   LASSERT (tsi-tsi_is_client);
+   LASSERT(sn != NULL);
+   LASSERT(tsi-tsi_is_client);
 
errors = atomic_read(sn-sn_ping_errors);
if (errors)
-   CWARN (%d pings have failed.\n, errors);
+   CWARN(%d pings have failed.\n, errors);
else
-   CDEBUG (D_NET, Ping test finished OK.\n);
+   CDEBUG(D_NET, Ping test finished OK.\n);
 }
 
 static int
@@ -118,7 +118,7 @@ ping_client_prep_rpc(sfw_test_unit_t *tsu,
 }
 
 static void
-ping_client_done_rpc (sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
+ping_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 {
sfw_test_instance_t *tsi = tsu-tsu_instance;
sfw_session_t   *sn = tsi-tsi_batch-bat_session;
@@ -126,12 +126,12 @@ ping_client_done_rpc (sfw_test_unit_t *tsu, 
srpc_client_rpc_t *rpc)
srpc_ping_reply_t   *reply = rpc-crpc_replymsg.msg_body.ping_reply;
struct timeval   tv;
 
-   LASSERT (sn != NULL);
+   LASSERT(sn != NULL);
 
if (rpc-crpc_status != 0) {
if (!tsi-tsi_stopping) /* rpc could have been aborted */
atomic_inc(sn-sn_ping_errors);
-   CERROR (Unable to ping %s (%d): %d\n,
+   CERROR(Unable to ping %s (%d): %d\n,
libcfs_id2str(rpc-crpc_dest),
reqst-pnr_seq, rpc-crpc_status);
return;
@@ -146,7 +146,7 @@ ping_client_done_rpc (sfw_test_unit_t *tsu, 
srpc_client_rpc_t *rpc)
if (reply-pnr_magic != LST_PING_TEST_MAGIC) {
rpc-crpc_status = -EBADMSG;
atomic_inc(sn-sn_ping_errors);
-   CERROR (Bad magic %u from %s, %u expected.\n,
+   CERROR(Bad magic %u from %s, %u expected.\n,
reply-pnr_magic, libcfs_id2str(rpc-crpc_dest),
LST_PING_TEST_MAGIC);
return;
@@ -155,14 +155,14 @@ ping_client_done_rpc (sfw_test_unit_t *tsu, 
srpc_client_rpc_t *rpc)
if (reply-pnr_seq != reqst-pnr_seq) {
rpc-crpc_status = -EBADMSG;
atomic_inc(sn-sn_ping_errors);
-   CERROR (Bad seq %u from %s, %u expected.\n,
+   CERROR(Bad seq %u from %s, %u expected.\n,
reply-pnr_seq, libcfs_id2str(rpc-crpc_dest),
reqst-pnr_seq);
return;
}
 
cfs_fs_timeval(tv);
-   CDEBUG (D_NET, %d reply in %u usec\n, reply-pnr_seq,
+   CDEBUG(D_NET, %d reply in %u usec\n, reply-pnr_seq,
(unsigned)((tv.tv_sec - (unsigned)reqst-pnr_time_sec) * 100
   + (tv.tv_usec - reqst-pnr_time_usec)));
return;
@@ -177,20 +177,20 @@ ping_server_handle(struct srpc_server_rpc *rpc)
srpc_ping_reqst_t *req = reqstmsg-msg_body.ping_reqst;
srpc_ping_reply_t *rep = rpc-srpc_replymsg.msg_body.ping_reply;
 
-   LASSERT (sv-sv_id == SRPC_SERVICE_PING);
+   LASSERT(sv-sv_id == SRPC_SERVICE_PING);
 
if (reqstmsg-msg_magic != SRPC_MSG_MAGIC) {
-   LASSERT (reqstmsg-msg_magic == __swab32(SRPC_MSG_MAGIC));
+   LASSERT(reqstmsg-msg_magic == __swab32(SRPC_MSG_MAGIC));
 
__swab32s(req-pnr_seq);
__swab32s(req-pnr_magic);
__swab64s(req-pnr_time_sec);
__swab64s(req-pnr_time_usec);
}
-   LASSERT (reqstmsg-msg_type == srpc_service2request(sv-sv_id));
+   LASSERT(reqstmsg-msg_type == srpc_service2request(sv-sv_id));
 
if (req-pnr_magic != LST_PING_TEST_MAGIC) {
-   CERROR (Unexpected magic %08x from %s\n,
+   CERROR(Unexpected magic %08x from %s\n,
req-pnr_magic, libcfs_id2str(rpc-srpc_peer));
return -EINVAL;
}
-- 
1.7.9.5

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


[PATCH] Staging: lustre: lov_io.c: remove useless unary pluses

2015-04-02 Thread Luca Wehrstedt
Replace two occurrences of +1 with simply 1.

Signed-off-by: Luca Wehrstedt luca.wehrst...@ens.fr
---
 drivers/staging/lustre/lustre/lov/lov_io.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c 
b/drivers/staging/lustre/lustre/lov/lov_io.c
index 80c2ef6..cf96e0d 100644
--- a/drivers/staging/lustre/lustre/lov/lov_io.c
+++ b/drivers/staging/lustre/lustre/lov/lov_io.c
@@ -403,7 +403,7 @@ static int lov_io_iter_init(const struct lu_env *env,
continue;
}
 
-   end = lov_offset_mod(end, +1);
+   end = lov_offset_mod(end, 1);
sub = lov_sub_get(env, lio, stripe);
if (!IS_ERR(sub)) {
lov_io_sub_inherit(sub-sub_io, lio, stripe,
@@ -925,7 +925,7 @@ int lov_io_init_empty(const struct lu_env *env, struct 
cl_object *obj,
break;
case CIT_FSYNC:
case CIT_SETATTR:
-   result = +1;
+   result = 1;
break;
case CIT_WRITE:
result = -EBADF;
-- 
1.7.9.5

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


[PATCH V2 2/3] staging: android: ion_test: unregister the misc device

2015-04-02 Thread Phong Tran
Add the remove() method for deregister from misc device
when it's unloaded.

Signed-off-by: Phong Tran tranmanph...@gmail.com
---
 drivers/staging/android/ion/ion_test.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/staging/android/ion/ion_test.c 
b/drivers/staging/android/ion/ion_test.c
index 3bc461c..d6a9653 100644
--- a/drivers/staging/android/ion/ion_test.c
+++ b/drivers/staging/android/ion/ion_test.c
@@ -261,7 +261,19 @@ static int __init ion_test_probe(struct platform_device 
*pdev)
return 0;
 }
 
+static int ion_test_remove(struct platform_device *pdev)
+{
+   struct ion_test_device *testdev;
+
+   testdev = platform_get_drvdata(pdev);
+   if (!testdev)
+   return -ENODATA;
+
+   return  misc_deregister(testdev-misc);
+}
+
 static struct platform_driver ion_test_platform_driver = {
+   .remove = ion_test_remove,
.driver = {
.name = ion-test,
},
-- 
2.1.0

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


[PATCH V2 1/3] staging: android: ion_test: Add the MODULE_LICENSE macro

2015-04-02 Thread Phong Tran
Base on the file comment should define GPL v2 for ion test driver

Signed-off-by: Phong Tran tranmanph...@gmail.com
---
 drivers/staging/android/ion/ion_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/android/ion/ion_test.c 
b/drivers/staging/android/ion/ion_test.c
index 654acb5..3bc461c 100644
--- a/drivers/staging/android/ion/ion_test.c
+++ b/drivers/staging/android/ion/ion_test.c
@@ -280,3 +280,4 @@ static void __exit ion_test_exit(void)
 
 module_init(ion_test_init);
 module_exit(ion_test_exit);
+MODULE_LICENSE(GPL v2);
-- 
2.1.0

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


[PATCH] Staging: lustre: dir.c: adding a blank after a declaration.

2015-04-02 Thread ruggero
From f770478d61e80e66cb310b92529f968c12831206 Mon Sep 17 00:00:00 2001
From: Cyrille Ruggero cyrille.rugg...@ens.fr
Date: Thu, 2 Apr 2015 16:09:14 +0200
Subject: [PATCH] Staging: lustre: dir.c: adding a blank after a declaration.

Adding a blank in this file after a declaration as reported by checkpatch.pl.

---
 drivers/staging/lustre/lustre/llite/dir.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index a182019..ad2cbc6 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -1518,6 +1518,7 @@ out_rmdir:
lump = (struct lov_user_md *)arg;
} else {
struct lov_user_mds_data *lmdp;
+
lmdp = (struct lov_user_mds_data *)arg;
lump = lmdp-lmd_lmm;
}
-- 
1.7.9.5

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


[PATCH V2 3/3] staging: android: ion_test: unregister the platform device

2015-04-02 Thread Phong Tran
The driver has to unregister from platform device when it's unloaded

Signed-off-by: Phong Tran tranmanph...@gmail.com
---
 drivers/staging/android/ion/ion_test.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_test.c 
b/drivers/staging/android/ion/ion_test.c
index d6a9653..24fd77d3 100644
--- a/drivers/staging/android/ion/ion_test.c
+++ b/drivers/staging/android/ion/ion_test.c
@@ -272,6 +272,7 @@ static int ion_test_remove(struct platform_device *pdev)
return  misc_deregister(testdev-misc);
 }
 
+static struct platform_device *ion_test_pdev;
 static struct platform_driver ion_test_platform_driver = {
.remove = ion_test_remove,
.driver = {
@@ -281,13 +282,18 @@ static struct platform_driver ion_test_platform_driver = {
 
 static int __init ion_test_init(void)
 {
-   platform_device_register_simple(ion-test, -1, NULL, 0);
+   ion_test_pdev = platform_device_register_simple(ion-test,
+   -1, NULL, 0);
+   if (!ion_test_pdev)
+   return -ENODEV;
+
return platform_driver_probe(ion_test_platform_driver, ion_test_probe);
 }
 
 static void __exit ion_test_exit(void)
 {
platform_driver_unregister(ion_test_platform_driver);
+   platform_device_unregister(ion_test_pdev);
 }
 
 module_init(ion_test_init);
-- 
2.1.0

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


[PATCH] Staging: lustre: o2iblnd.c: Started fixing coding style

2015-04-02 Thread Guillaume Matheron
I focused on function declarations (placed return type on the same line
as function name), and spaces between function name and parenthesis

Signed-off-by: Guillaume Matheron guillaume.mathe...@ens.fr
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c| 445 +
 1 file changed, 186 insertions(+), 259 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index 6510169..ae4069e 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -53,8 +53,7 @@ static lnd_t the_o2iblnd = {
 
 kib_data_t   kiblnd_data;
 
-static __u32
-kiblnd_cksum(void *ptr, int nob)
+static __u32 kiblnd_cksum(void *ptr, int nob)
 {
char  *c  = ptr;
__u32  sum = 0;
@@ -66,8 +65,7 @@ kiblnd_cksum(void *ptr, int nob)
return (sum == 0) ? 1 : sum;
 }
 
-static char *
-kiblnd_msgtype2str(int type)
+static char *kiblnd_msgtype2str(int type)
 {
switch (type) {
case IBLND_MSG_CONNREQ:
@@ -105,8 +103,7 @@ kiblnd_msgtype2str(int type)
}
 }
 
-static int
-kiblnd_msgtype2size(int type)
+static int kiblnd_msgtype2size(int type)
 {
const int hdr_size = offsetof(kib_msg_t, ibm_u);
 
@@ -139,15 +136,14 @@ kiblnd_msgtype2size(int type)
}
 }
 
-static int
-kiblnd_unpack_rd(kib_msg_t *msg, int flip)
+static int kiblnd_unpack_rd(kib_msg_t *msg, int flip)
 {
kib_rdma_desc_t   *rd;
int nob;
int n;
int i;
 
-   LASSERT (msg-ibm_type == IBLND_MSG_GET_REQ ||
+   LASSERT(msg-ibm_type == IBLND_MSG_GET_REQ ||
 msg-ibm_type == IBLND_MSG_PUT_ACK);
 
rd = msg-ibm_type == IBLND_MSG_GET_REQ ?
@@ -167,7 +163,7 @@ kiblnd_unpack_rd(kib_msg_t *msg, int flip)
return 1;
}
 
-   nob = offsetof (kib_msg_t, ibm_u) +
+   nob = offsetof(kib_msg_t, ibm_u) +
  kiblnd_rd_msg_size(rd, msg-ibm_type, n);
 
if (msg-ibm_nob  nob) {
@@ -187,9 +183,8 @@ kiblnd_unpack_rd(kib_msg_t *msg, int flip)
return 0;
 }
 
-void
-kiblnd_pack_msg (lnet_ni_t *ni, kib_msg_t *msg, int version,
-int credits, lnet_nid_t dstnid, __u64 dststamp)
+void kiblnd_pack_msg(lnet_ni_t *ni, kib_msg_t *msg, int version,
+int credits, lnet_nid_t dstnid, __u64 dststamp)
 {
kib_net_t *net = ni-ni_data;
 
@@ -212,8 +207,7 @@ kiblnd_pack_msg (lnet_ni_t *ni, kib_msg_t *msg, int version,
}
 }
 
-int
-kiblnd_unpack_msg(kib_msg_t *msg, int nob)
+int kiblnd_unpack_msg(kib_msg_t *msg, int nob)
 {
const int hdr_size = offsetof(kib_msg_t, ibm_u);
__u32 msg_cksum;
@@ -269,8 +263,8 @@ kiblnd_unpack_msg(kib_msg_t *msg, int nob)
if (flip) {
/* leave magic unflipped as a clue to peer endianness */
msg-ibm_version = version;
-   CLASSERT (sizeof(msg-ibm_type) == 1);
-   CLASSERT (sizeof(msg-ibm_credits) == 1);
+   CLASSERT(sizeof(msg-ibm_type) == 1);
+   CLASSERT(sizeof(msg-ibm_credits) == 1);
msg-ibm_nob = msg_nob;
__swab64s(msg-ibm_srcnid);
__swab64s(msg-ibm_srcstamp);
@@ -324,8 +318,7 @@ kiblnd_unpack_msg(kib_msg_t *msg, int nob)
return 0;
 }
 
-int
-kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, lnet_nid_t nid)
+int kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, lnet_nid_t nid)
 {
kib_peer_t  *peer;
kib_net_t   *net = ni-ni_data;
@@ -356,7 +349,7 @@ kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, 
lnet_nid_t nid)
write_lock_irqsave(kiblnd_data.kib_global_lock, flags);
 
/* always called with a ref on ni, which prevents ni being shutdown */
-   LASSERT (net-ibn_shutdown == 0);
+   LASSERT(net-ibn_shutdown == 0);
 
/* npeers only grows with the global lock held */
atomic_inc(net-ibn_npeers);
@@ -367,18 +360,17 @@ kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, 
lnet_nid_t nid)
return 0;
 }
 
-void
-kiblnd_destroy_peer (kib_peer_t *peer)
+void kiblnd_destroy_peer(kib_peer_t *peer)
 {
kib_net_t *net = peer-ibp_ni-ni_data;
 
-   LASSERT (net != NULL);
-   LASSERT (atomic_read(peer-ibp_refcount) == 0);
-   LASSERT (!kiblnd_peer_active(peer));
-   LASSERT (peer-ibp_connecting == 0);
-   LASSERT (peer-ibp_accepting == 0);
-   LASSERT (list_empty(peer-ibp_conns));
-   LASSERT (list_empty(peer-ibp_tx_queue));
+   LASSERT(net != NULL);
+   LASSERT(atomic_read(peer-ibp_refcount) == 0);
+   LASSERT(!kiblnd_peer_active(peer));
+   LASSERT(peer-ibp_connecting == 0);
+   LASSERT(peer-ibp_accepting == 0);
+   LASSERT(list_empty(peer-ibp_conns));
+   LASSERT(list_empty(peer-ibp_tx_queue));
 
LIBCFS_FREE(peer, sizeof(*peer));
 
@@ -389,8 +381,7 @@ kiblnd_destroy_peer