[PATCH] staging: wlan-ng: if statement style cleanup

2016-09-16 Thread Jon Eyolfson
Formatted code to follow coding style guidelines.

Signed-off-by: Jon Eyolfson 
---
 drivers/staging/wlan-ng/cfg80211.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wlan-ng/cfg80211.c 
b/drivers/staging/wlan-ng/cfg80211.c
index a36e40d..457f176 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -476,11 +476,11 @@ static int prism2_connect(struct wiphy *wiphy, struct 
net_device *dev,
 
/* Set the authorization */
if ((sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) ||
-   ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && !is_wep))
-   msg_join.authtype.data = P80211ENUM_authalg_opensystem;
+   ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && !is_wep))
+   msg_join.authtype.data = P80211ENUM_authalg_opensystem;
else if ((sme->auth_type == NL80211_AUTHTYPE_SHARED_KEY) ||
-   ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && is_wep))
-   msg_join.authtype.data = P80211ENUM_authalg_sharedkey;
+((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && is_wep))
+   msg_join.authtype.data = P80211ENUM_authalg_sharedkey;
else
netdev_warn(dev,
"Unhandled authorisation type for connect (%d)\n",
-- 
2.9.3
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: lustre/ldlm: Fixed sparse warnings

2016-09-16 Thread Dilger, Andreas
On Sep 15, 2016, at 12:33, nayeem  wrote:
> On Wednesday 14 September 2016 10:44 AM, Dilger, Andreas wrote:
>> On Sep 12, 2016, at 04:27, Greg KH  wrote:
>>> 
>>> On Fri, Sep 09, 2016 at 08:50:35PM +0530, Nayeemahmed Badebade wrote:
 Added __acquires / __releases sparse locking annotations
 to lock_res_and_lock and unlock_res_and_lock functions in
 l_lock.c, to fix below sparse warnings:
 
 l_lock.c:47:22: warning: context imbalance in 'lock_res_and_lock' - wrong 
 count at exit
 l_lock.c:62:6: warning: context imbalance in 'unlock_res_and_lock' - 
 unexpected unlock
 
 Signed-off-by: Nayeemahmed Badebade 
 ---
 drivers/staging/lustre/lustre/ldlm/l_lock.c | 4 
 1 file changed, 4 insertions(+)
 
 diff --git a/drivers/staging/lustre/lustre/ldlm/l_lock.c 
 b/drivers/staging/lustre/lustre/ldlm/l_lock.c
 index ea8840c..c4b9612 100644
 --- a/drivers/staging/lustre/lustre/ldlm/l_lock.c
 +++ b/drivers/staging/lustre/lustre/ldlm/l_lock.c
 @@ -45,6 +45,8 @@
  * being an atomic operation.
  */
 struct ldlm_resource *lock_res_and_lock(struct ldlm_lock *lock)
 +  __acquires(>l_lock)
 +  __acquires(lock->l_resource)
>>> 
>>> Hm, these are tricky, I don't want to take this type of change without
>>> an ack from the lustre developers...
>> 
>> The "__acquires(>l_lock)" line here looks correct, along with the
>> corresponding "__releases(>l_lock)" at unlock_res_and_lock().
>> 
>> The problem, however, is that "l_resource" is not a lock, but rather a
>> struct.  The call to "lock_res(lock->l_resource)" is actually locking
>> "lr_lock" internally.
>> 
>> It would be better to add "__acquires(>lr_lock)" at lock_res() and
>> "__releases(>lr_lock)" at unlock_res().  That will also forestall
>> any other warnings about an imbalance with lock_res()/unlock_res() or
>> their callsites.
>> 
>> Cheers, Andreas
>> 
> 
> Hi Andreas,
> 
> Thank you for your review comments. I did the change according to your 
> comments and the diff is attached to mail. But this change doesn't seem to 
> fix the sparse warning.
> With this change when i compile the code "make C=2 
> ./drivers/staging/lustre/lustre/", sparse warning still comes:

> {{{
>  CHECK   drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/l_lock.c
> drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/l_lock.c:47:22: 
> warning: context imbalance in 'lock_res_and_lock' - wrong count at exit
> drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/l_lock.c:62:6: 
> warning: context imbalance in 'unlock_res_and_lock' - unexpected unlock
>  CC [M]  drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/l_lock.o
> }}}

Strange, one would think that your patch should work properly.  Maybe the
__acquires() label doesn't work on inline functions?

> Would it be a good idea to add "__acquires(>l_resource->lr_lock)" & 
> "__acquires(>l_lock)" at lock_res_and_lock() and 
> "__releases(>l_resource->lr_lock)" & "__releases(>l_lock)" at 
> unlock_res_and_lock() ?
> Because with that change the sparse warning is fixed.
> {{{
>  CHECK   drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/l_lock.c
>  CC [M]  drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/l_lock.o
> }}}

This would also be possible, but then it exposes any callers of lock_res()
and unlock() res to similar compiler warnings in the future.  I'm not
against this in principle, but it is worthwhile to see why sparse is not
handling this case correctly.

Cheers, Andreas

> Could you please confirm this.
> 
> Regards,
> Nayeem
> 
> 

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


Re: [PATCH -next] staging: rtl8712: fix double lock bug in SetPSModeWorkItemCallback()

2016-09-16 Thread Greg KH
On Fri, Sep 16, 2016 at 10:01:47AM +0200, Greg KH wrote:
> On Thu, Sep 15, 2016 at 10:12:05AM +, Wei Yongjun wrote:
> > From: Wei Yongjun 
> > 
> > Fix a double lock bug in SetPSModeWorkItemCallback().
> > 
> > Fixes: 5c2ba8b85e35 ("rtl8712: pwrctrl_priv: Replace semaphore lock > with 
> > mutex")
> 
> I don't see that commit id in any tree that I can find, are you sure it
> is correct?

Oh nevermind, I was looking at the wrong tree, sorry, this is fine...

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


Re: [PATCH -next] staging: rtl8712: fix double lock bug in SetPSModeWorkItemCallback()

2016-09-16 Thread Greg KH
On Thu, Sep 15, 2016 at 10:12:05AM +, Wei Yongjun wrote:
> From: Wei Yongjun 
> 
> Fix a double lock bug in SetPSModeWorkItemCallback().
> 
> Fixes: 5c2ba8b85e35 ("rtl8712: pwrctrl_priv: Replace semaphore lock > with 
> mutex")

I don't see that commit id in any tree that I can find, are you sure it
is correct?

thanks,

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


[PATCH v2] drivers: staging: vme: convert to octal notation for permission bits

2016-09-16 Thread Andrew Kanner
Ran checkpatch.pl -f vme_pio2_core.c
Fixed: WARNING: Symbolic permissions are not preferred. Consider using
octal permissions (0444)

Signed-off-by: Andrew Kanner 
---
 drivers/staging/vme/devices/vme_pio2_core.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c 
b/drivers/staging/vme/devices/vme_pio2_core.c
index 28a4568..8e66a52 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -466,23 +466,23 @@ static void __exit pio2_exit(void)
 
 /* These are required for each board */
 MODULE_PARM_DESC(bus, "Enumeration of VMEbus to which the board is connected");
-module_param_array(bus, int, _num, S_IRUGO);
+module_param_array(bus, int, _num, 0444);
 
 MODULE_PARM_DESC(base, "Base VME address for PIO2 Registers");
-module_param_array(base, long, _num, S_IRUGO);
+module_param_array(base, long, _num, 0444);
 
 MODULE_PARM_DESC(vector, "VME IRQ Vector (Lower 4 bits masked)");
-module_param_array(vector, int, _num, S_IRUGO);
+module_param_array(vector, int, _num, 0444);
 
 MODULE_PARM_DESC(level, "VME IRQ Level");
-module_param_array(level, int, _num, S_IRUGO);
+module_param_array(level, int, _num, 0444);
 
 MODULE_PARM_DESC(variant, "Last 4 characters of PIO2 board variant");
-module_param_array(variant, charp, _num, S_IRUGO);
+module_param_array(variant, charp, _num, 0444);
 
 /* This is for debugging */
 MODULE_PARM_DESC(loopback, "Enable loopback mode on all cards");
-module_param(loopback, bool, S_IRUGO);
+module_param(loopback, bool, 0444);
 
 MODULE_DESCRIPTION("GE PIO2 6U VME I/O Driver");
 MODULE_AUTHOR("Martyn Welch 

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-16 Thread Todd Kjos
Thanks Peter. We'll give that patch a try as part of our refactoring.
Looking at finer-grained locking and we'll try going back to rt_mutex
plus this patch.

On Wed, Sep 14, 2016 at 9:55 AM, Peter Zijlstra  wrote:
> On Wed, Sep 14, 2016 at 06:13:40PM +0200, Peter Zijlstra wrote:
>> On Wed, Sep 14, 2016 at 06:11:03PM +0200, Peter Zijlstra wrote:
>> > On Tue, Sep 13, 2016 at 12:53:27PM -0700, Arve Hjønnevåg wrote:
>> > > On Tue, Sep 13, 2016 at 12:32 AM, Peter Zijlstra  
>> > > wrote:
>> > > > cgroups should be irrelevant, PI is unaware of them.
>> > >
>> > > I don't think cgroups are irrelevant. PI being unaware of them
>> > > explains the problem I described. If the task that holds the lock is
>> > > in a cgroup that has a low cpu.shares value, then boosting the task's
>> > > priority within that group does necessarily make it any more likely to
>> > > run.
>> >
>> > Thing is, for FIFO/DL the important parameters (prio and deadline resp.)
>> > are not cgroup dependent.
>> >
>> > For CFS you're right, and as per usual, cgroups will be a royal pain.
>> > While we can compute the total weight in the block chain, getting that
>> > back to a task which is stuck in a cgroup is just not going to work
>> > well.
>>
>> Not to mention the fact that the weight depends on the current running
>> state. Having those tasks block insta changes the actual weight.
>>
>> > /me curses @ cgroups.. bloody stupid things.
>>
>> More of that.
>
>
> Something a little like so... completely untested, and has a fair number
> of corner cases still left open I think..
>
>
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1691,8 +1691,8 @@ struct task_struct {
> struct seccomp seccomp;
>
>  /* Thread group tracking */
> -   u32 parent_exec_id;
> -   u32 self_exec_id;
> +   u32 parent_exec_id;
> +   u32 self_exec_id;
>  /* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed,
>   * mempolicy */
> spinlock_t alloc_lock;
> @@ -1710,6 +1710,11 @@ struct task_struct {
> struct task_struct *pi_top_task;
> /* Deadlock detection and priority inheritance handling */
> struct rt_mutex_waiter *pi_blocked_on;
> +   unsigned long pi_weight;
> +#ifdef CONFIG_CGROUP_SCHED
> +   struct task_group *orig_task_group;
> +   unsigned long normal_weight;
> +#endif
>  #endif
>
>  #ifdef CONFIG_DEBUG_MUTEXES
> @@ -1977,6 +1982,8 @@ static inline int tsk_nr_cpus_allowed(st
> return p->nr_cpus_allowed;
>  }
>
> +extern unsigned long task_pi_weight(struct task_struct *p);
> +
>  #define TNF_MIGRATED   0x01
>  #define TNF_NO_GROUP   0x02
>  #define TNF_SHARED 0x04
> --- a/kernel/locking/rtmutex.c
> +++ b/kernel/locking/rtmutex.c
> @@ -20,6 +20,19 @@
>  #include "rtmutex_common.h"
>
>  /*
> + * !(rt_prio || dl_prio)
> + */
> +static inline bool other_prio(int prio)
> +{
> +   return prio >= MAX_RT_PRIO;
> +}
> +
> +static inline bool other_task(struct task_struct *task)
> +{
> +   return other_prio(task->prio);
> +}
> +
> +/*
>   * lock->owner state tracking:
>   *
>   * lock->owner holds the task_struct pointer of the owner. Bit 0
> @@ -226,6 +239,11 @@ rt_mutex_enqueue(struct rt_mutex *lock,
>
> rb_link_node(>tree_entry, parent, link);
> rb_insert_color(>tree_entry, >waiters);
> +   /*
> +* We want the lock->waiter_weight to reflect the sum of all queued
> +* waiters.
> +*/
> +   lock->waiters_weight += waiter->weight;
>  }
>
>  static void
> @@ -239,6 +257,7 @@ rt_mutex_dequeue(struct rt_mutex *lock,
>
> rb_erase(>tree_entry, >waiters);
> RB_CLEAR_NODE(>tree_entry);
> +   lock->waiters_weight += waiter->weight;
>  }
>
>  static void
> @@ -265,6 +284,18 @@ rt_mutex_enqueue_pi(struct task_struct *
>
> rb_link_node(>pi_tree_entry, parent, link);
> rb_insert_color(>pi_tree_entry, >pi_waiters);
> +
> +   /*
> +* Since a task can own multiple locks, and we have one pi_waiter
> +* for every lock, propagate the lock->waiter_weight, which is the sum
> +* of all weights queued on that lock, into the top waiter, and add
> +* that to the owning task's pi_weight.
> +*
> +* This results in pi_weight being the sum of all blocked waiters
> +* on this task.
> +*/
> +   waiter->top_weight = waiter->lock->waiters_weight;
> +   task->pi_weight += waiter->top_weight;
>  }
>
>  static void
> @@ -278,6 +309,7 @@ rt_mutex_dequeue_pi(struct task_struct *
>
> rb_erase(>pi_tree_entry, >pi_waiters);
> RB_CLEAR_NODE(>pi_tree_entry);
> +   task->pi_weight -= waiter->top_weight;
>  }
>
>  static void rt_mutex_adjust_prio(struct task_struct *p)
> @@ -497,7 +529,7 @@ static int rt_mutex_adjust_prio_chain(st
>  * detection is enabled we continue, but stop the
>  * requeueing in the chain walk.
>  */
> -   

[PATCH -next] vme: fake: remove unexpected unlock in fake_master_set()

2016-09-16 Thread Wei Yongjun
From: Wei Yongjun 

image->lock is unlocked in some error handling path without take the
lock, so remove those unexpected unlock.

Fixes: 658bcdae9c67 ("vme: Adding Fake VME driver")
Signed-off-by: Wei Yongjun 
---
 drivers/vme/bridges/vme_fake.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/vme/bridges/vme_fake.c b/drivers/vme/bridges/vme_fake.c
index ebf35d3..4b2613d 100644
--- a/drivers/vme/bridges/vme_fake.c
+++ b/drivers/vme/bridges/vme_fake.c
@@ -273,7 +273,6 @@ static int fake_master_set(struct vme_master_resource 
*image, int enabled,
}
 
if (size & 0x) {
-   spin_unlock(>lock);
pr_err("Invalid size alignment\n");
retval = -EINVAL;
goto err_window;
@@ -292,7 +291,6 @@ static int fake_master_set(struct vme_master_resource 
*image, int enabled,
case VME_D32:
break;
default:
-   spin_unlock(>lock);
pr_err("Invalid data width\n");
retval = -EINVAL;
goto err_dwidth;
@@ -311,7 +309,6 @@ static int fake_master_set(struct vme_master_resource 
*image, int enabled,
case VME_USER4:
break;
default:
-   spin_unlock(>lock);
pr_err("Invalid address space\n");
retval = -EINVAL;
goto err_aspace;

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


[PATCH 2/2] Drivers: hv: get rid of id in struct vmbus_channel

2016-09-16 Thread kys
From: Vitaly Kuznetsov 

The auto incremented counter is not being used anymore, get rid of it.

Signed-off-by: Vitaly Kuznetsov 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/channel_mgmt.c |2 --
 include/linux/hyperv.h|3 ---
 2 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 759ba4d..96a85cd 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -274,14 +274,12 @@ EXPORT_SYMBOL_GPL(vmbus_prep_negotiate_resp);
  */
 static struct vmbus_channel *alloc_channel(void)
 {
-   static atomic_t chan_num = ATOMIC_INIT(0);
struct vmbus_channel *channel;
 
channel = kzalloc(sizeof(*channel), GFP_ATOMIC);
if (!channel)
return NULL;
 
-   channel->id = atomic_inc_return(_num);
channel->acquire_ring_lock = true;
spin_lock_init(>inbound_lock);
spin_lock_init(>lock);
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 7d7cbff..cd184bd 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -706,9 +706,6 @@ struct vmbus_device {
 };
 
 struct vmbus_channel {
-   /* Unique channel id */
-   int id;
-
struct list_head listentry;
 
struct hv_device *device_obj;
-- 
1.7.4.1

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


[PATCH 1/3] staging: r8188eu: remove ODM_CmnInfoUpdate function

2016-09-16 Thread Ivan Safonov
This function does not improve code readability.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/hal/odm.c   | 43 +--
 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c   | 12 +++
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c |  4 +--
 3 files changed, 9 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm.c 
b/drivers/staging/rtl8188eu/hal/odm.c
index 57a1275..33f4839 100644
--- a/drivers/staging/rtl8188eu/hal/odm.c
+++ b/drivers/staging/rtl8188eu/hal/odm.c
@@ -385,46 +385,6 @@ void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct 
*pDM_Odm, enum odm_common_info
}
 }
 
-/*  Update Band/CHannel/.. The values are dynamic but non-per-packet. */
-void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value)
-{
-   /*  */
-   /*  This init variable may be changed in run time. */
-   /*  */
-   switch  (CmnInfo) {
-   caseODM_CMNINFO_ABILITY:
-   pDM_Odm->SupportAbility = (u32)Value;
-   break;
-   caseODM_CMNINFO_RF_TYPE:
-   pDM_Odm->RFType = (u8)Value;
-   break;
-   caseODM_CMNINFO_WIFI_DIRECT:
-   pDM_Odm->bWIFI_Direct = (bool)Value;
-   break;
-   caseODM_CMNINFO_WIFI_DISPLAY:
-   pDM_Odm->bWIFI_Display = (bool)Value;
-   break;
-   caseODM_CMNINFO_LINK:
-   pDM_Odm->bLinked = (bool)Value;
-   break;
-   caseODM_CMNINFO_RSSI_MIN:
-   pDM_Odm->RSSI_Min = (u8)Value;
-   break;
-   caseODM_CMNINFO_DBG_COMP:
-   pDM_Odm->DebugComponents = Value;
-   break;
-   caseODM_CMNINFO_DBG_LEVEL:
-   pDM_Odm->DebugLevel = (u32)Value;
-   break;
-   caseODM_CMNINFO_RA_THRESHOLD_HIGH:
-   pDM_Odm->RateAdaptive.HighRSSIThresh = (u8)Value;
-   break;
-   caseODM_CMNINFO_RA_THRESHOLD_LOW:
-   pDM_Odm->RateAdaptive.LowRSSIThresh = (u8)Value;
-   break;
-   }
-}
-
 void odm_CommonInfoSelfInit(struct odm_dm_struct *pDM_Odm)
 {
struct adapter *adapter = pDM_Odm->Adapter;
@@ -1179,8 +1139,7 @@ void odm_RSSIMonitorCheckCE(struct odm_dm_struct *pDM_Odm)
pdmpriv->EntryMinUndecoratedSmoothedPWDB = 0;
 
FindMinimumRSSI(Adapter);
-   ODM_CmnInfoUpdate(>odmpriv, ODM_CMNINFO_RSSI_MIN,
- pdmpriv->MinUndecoratedPWDBForDM);
+   pHalData->odmpriv.RSSI_Min = pdmpriv->MinUndecoratedPWDBForDM;
 }
 
 /* 3 */
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
index 11e7246..b99008b 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
@@ -67,18 +67,18 @@ static void Init_ODM_ComInfo_88E(struct adapter *Adapter)
 
 
if (hal_data->rf_type == RF_1T1R)
-   ODM_CmnInfoUpdate(dm_odm, ODM_CMNINFO_RF_TYPE, ODM_1T1R);
+   dm_odm->RFType = ODM_1T1R;
else if (hal_data->rf_type == RF_2T2R)
-   ODM_CmnInfoUpdate(dm_odm, ODM_CMNINFO_RF_TYPE, ODM_2T2R);
+   dm_odm->RFType = ODM_2T2R;
else if (hal_data->rf_type == RF_1T2R)
-   ODM_CmnInfoUpdate(dm_odm, ODM_CMNINFO_RF_TYPE, ODM_1T2R);
+   dm_odm->RFType = ODM_1T2R;
 
ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_RF_ANTENNA_TYPE, 
hal_data->TRxAntDivType);
 
pdmpriv->InitODMFlag =  ODM_RF_CALIBRATION |
ODM_RF_TX_PWR_TRACK;
 
-   ODM_CmnInfoUpdate(dm_odm, ODM_CMNINFO_ABILITY, pdmpriv->InitODMFlag);
+   dm_odm->SupportAbility = pdmpriv->InitODMFlag;
 }
 
 static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
@@ -109,7 +109,7 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
ODM_RF_TX_PWR_TRACK;
}
 
-   ODM_CmnInfoUpdate(dm_odm, ODM_CMNINFO_ABILITY, pdmpriv->InitODMFlag);
+   dm_odm->SupportAbility = pdmpriv->InitODMFlag;
 
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_TX_UNI, 
&(Adapter->xmitpriv.tx_bytes));
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_RX_UNI, 
&(Adapter->recvpriv.rx_bytes));
@@ -166,7 +166,7 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
bLinked = true;
}
 
-   ODM_CmnInfoUpdate(_data->odmpriv, ODM_CMNINFO_LINK, bLinked);
+   hal_data->odmpriv.bLinked = bLinked;
ODM_DMWatchdog(_data->odmpriv);
 skip_dm:
/*  Check GPIO to determine current RF on/off and Pbc status. */
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
index 938d6f5..a1812dd 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
@@ -165,10 +165,10 @@ void 

[PATCH 2/3] staging: r8188eu: remove ODM_CmnInfoHook function

2016-09-16 Thread Ivan Safonov
This function used once, and does not improve code readability.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/hal/odm.c | 77 -
 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 22 -
 2 files changed, 11 insertions(+), 88 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm.c 
b/drivers/staging/rtl8188eu/hal/odm.c
index 33f4839..534e919 100644
--- a/drivers/staging/rtl8188eu/hal/odm.c
+++ b/drivers/staging/rtl8188eu/hal/odm.c
@@ -293,83 +293,6 @@ void ODM_CmnInfoInit(struct odm_dm_struct *pDM_Odm, enum 
odm_common_info_def Cmn
pDM_Odm->BbSwingFlagOfdm= false;
 }
 
-void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def 
CmnInfo, void *pValue)
-{
-   /*  */
-   /*  Hook call by reference pointer. */
-   /*  */
-   switch  (CmnInfo) {
-   /*  Dynamic call by reference pointer. */
-   caseODM_CMNINFO_MAC_PHY_MODE:
-   pDM_Odm->pMacPhyMode = (u8 *)pValue;
-   break;
-   caseODM_CMNINFO_TX_UNI:
-   pDM_Odm->pNumTxBytesUnicast = (u64 *)pValue;
-   break;
-   caseODM_CMNINFO_RX_UNI:
-   pDM_Odm->pNumRxBytesUnicast = (u64 *)pValue;
-   break;
-   caseODM_CMNINFO_WM_MODE:
-   pDM_Odm->pWirelessMode = (u8 *)pValue;
-   break;
-   caseODM_CMNINFO_BAND:
-   pDM_Odm->pBandType = (u8 *)pValue;
-   break;
-   caseODM_CMNINFO_SEC_CHNL_OFFSET:
-   pDM_Odm->pSecChOffset = (u8 *)pValue;
-   break;
-   caseODM_CMNINFO_SEC_MODE:
-   pDM_Odm->pSecurity = (u8 *)pValue;
-   break;
-   caseODM_CMNINFO_BW:
-   pDM_Odm->pBandWidth = (u8 *)pValue;
-   break;
-   caseODM_CMNINFO_CHNL:
-   pDM_Odm->pChannel = (u8 *)pValue;
-   break;
-   caseODM_CMNINFO_DMSP_GET_VALUE:
-   pDM_Odm->pbGetValueFromOtherMac = (bool *)pValue;
-   break;
-   caseODM_CMNINFO_BUDDY_ADAPTOR:
-   pDM_Odm->pBuddyAdapter = (struct adapter **)pValue;
-   break;
-   caseODM_CMNINFO_DMSP_IS_MASTER:
-   pDM_Odm->pbMasterOfDMSP = (bool *)pValue;
-   break;
-   caseODM_CMNINFO_SCAN:
-   pDM_Odm->pbScanInProcess = (bool *)pValue;
-   break;
-   caseODM_CMNINFO_POWER_SAVING:
-   pDM_Odm->pbPowerSaving = (bool *)pValue;
-   break;
-   caseODM_CMNINFO_ONE_PATH_CCA:
-   pDM_Odm->pOnePathCCA = (u8 *)pValue;
-   break;
-   caseODM_CMNINFO_DRV_STOP:
-   pDM_Odm->pbDriverStopped =  (bool *)pValue;
-   break;
-   caseODM_CMNINFO_PNP_IN:
-   pDM_Odm->pbDriverIsGoingToPnpSetPowerSleep =  (bool *)pValue;
-   break;
-   caseODM_CMNINFO_INIT_ON:
-   pDM_Odm->pinit_adpt_in_progress =  (bool *)pValue;
-   break;
-   caseODM_CMNINFO_ANT_TEST:
-   pDM_Odm->pAntennaTest =  (u8 *)pValue;
-   break;
-   caseODM_CMNINFO_NET_CLOSED:
-   pDM_Odm->pbNet_closed = (bool *)pValue;
-   break;
-   caseODM_CMNINFO_MP_MODE:
-   pDM_Odm->mp_mode = (u8 *)pValue;
-   break;
-   /* To remove the compiler warning, must add an empty default statement 
to handle the other values. */
-   default:
-   /* do nothing */
-   break;
-   }
-}
-
 void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct *pDM_Odm, enum 
odm_common_info_def CmnInfo, u16 Index, void *pValue)
 {
/*  Hook call by reference pointer. */
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
index b99008b..8070a24 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
@@ -111,17 +111,17 @@ static void Update_ODM_ComInfo_88E(struct adapter 
*Adapter)
 
dm_odm->SupportAbility = pdmpriv->InitODMFlag;
 
-   ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_TX_UNI, 
&(Adapter->xmitpriv.tx_bytes));
-   ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_RX_UNI, 
&(Adapter->recvpriv.rx_bytes));
-   ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_WM_MODE, 
&(pmlmeext->cur_wireless_mode));
-   ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_SEC_CHNL_OFFSET, 
&(hal_data->nCur40MhzPrimeSC));
-   ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_SEC_MODE, 
&(Adapter->securitypriv.dot11PrivacyAlgrthm));
-   ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_BW, &(hal_data->CurrentChannelBW));
-   ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_CHNL, &(hal_data->CurrentChannel));
-   ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_NET_CLOSED, &(Adapter->net_closed));
-   ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_MP_MODE, 
&(Adapter->registrypriv.mp_mode));
-   

[PATCH 3/3] staging: r8188eu: remove ODM_CmnInfoPtrArrayHook function

2016-09-16 Thread Ivan Safonov
This function used once, and does not improve code readability.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/hal/odm.c | 67 -
 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 37 
 2 files changed, 20 insertions(+), 84 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm.c 
b/drivers/staging/rtl8188eu/hal/odm.c
index 534e919..d1c9ef3 100644
--- a/drivers/staging/rtl8188eu/hal/odm.c
+++ b/drivers/staging/rtl8188eu/hal/odm.c
@@ -226,73 +226,6 @@ void ODM_DMWatchdog(struct odm_dm_struct *pDM_Odm)
odm_EdcaTurboCheck(pDM_Odm);
 }
 
-/*  Init /.. Fixed HW value. Only init time. */
-void ODM_CmnInfoInit(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def 
CmnInfo, u32 Value)
-{
-   /*  This section is used for init value */
-   switch  (CmnInfo) {
-   /*  Fixed ODM value. */
-   caseODM_CMNINFO_ABILITY:
-   pDM_Odm->SupportAbility = (u32)Value;
-   break;
-   caseODM_CMNINFO_PLATFORM:
-   pDM_Odm->SupportPlatform = (u8)Value;
-   break;
-   caseODM_CMNINFO_INTERFACE:
-   pDM_Odm->SupportInterface = (u8)Value;
-   break;
-   caseODM_CMNINFO_MP_TEST_CHIP:
-   pDM_Odm->bIsMPChip = (u8)Value;
-   break;
-   caseODM_CMNINFO_IC_TYPE:
-   pDM_Odm->SupportICType = Value;
-   break;
-   caseODM_CMNINFO_CUT_VER:
-   pDM_Odm->CutVersion = (u8)Value;
-   break;
-   caseODM_CMNINFO_RF_TYPE:
-   pDM_Odm->RFType = (u8)Value;
-   break;
-   caseODM_CMNINFO_RF_ANTENNA_TYPE:
-   pDM_Odm->AntDivType = (u8)Value;
-   break;
-   caseODM_CMNINFO_BOARD_TYPE:
-   pDM_Odm->BoardType = (u8)Value;
-   break;
-   caseODM_CMNINFO_EXT_LNA:
-   pDM_Odm->ExtLNA = (u8)Value;
-   break;
-   caseODM_CMNINFO_EXT_PA:
-   pDM_Odm->ExtPA = (u8)Value;
-   break;
-   caseODM_CMNINFO_EXT_TRSW:
-   pDM_Odm->ExtTRSW = (u8)Value;
-   break;
-   caseODM_CMNINFO_PATCH_ID:
-   pDM_Odm->PatchID = (u8)Value;
-   break;
-   caseODM_CMNINFO_BINHCT_TEST:
-   pDM_Odm->bInHctTest = (bool)Value;
-   break;
-   caseODM_CMNINFO_BWIFI_TEST:
-   pDM_Odm->bWIFITest = (bool)Value;
-   break;
-   caseODM_CMNINFO_SMART_CONCURRENT:
-   pDM_Odm->bDualMacSmartConcurrent = (bool)Value;
-   break;
-   /* To remove the compiler warning, must add an empty default statement 
to handle the other values. */
-   default:
-   /* do nothing */
-   break;
-   }
-
-   /*  Tx power tracking BB swing table. */
-   /*  The base index = 12. +((12-n)/2)dB 13~?? = decrease tx pwr by 
-((n-12)/2)dB */
-   pDM_Odm->BbSwingIdxOfdm = 12; /*  Set defalut value as 
index 12. */
-   pDM_Odm->BbSwingIdxOfdmCurrent  = 12;
-   pDM_Odm->BbSwingFlagOfdm= false;
-}
-
 void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct *pDM_Odm, enum 
odm_common_info_def CmnInfo, u16 Index, void *pValue)
 {
/*  Hook call by reference pointer. */
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
index 8070a24..0c853fc 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
@@ -45,26 +45,17 @@ static void Init_ODM_ComInfo_88E(struct adapter *Adapter)
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
struct dm_priv  *pdmpriv = _data->dmpriv;
struct odm_dm_struct *dm_odm = &(hal_data->odmpriv);
-   u8 cut_ver;
 
/*  Init Value */
memset(dm_odm, 0, sizeof(*dm_odm));
 
dm_odm->Adapter = Adapter;
-
-   ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_PLATFORM, ODM_CE);
-
-   ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_IC_TYPE, ODM_RTL8188E);
-
-   cut_ver = ODM_CUT_A;
-
-   ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_CUT_VER, cut_ver);
-
-   ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_MP_TEST_CHIP, 
hal_data->VersionID.ChipType == NORMAL_CHIP ? true : false);
-
-   ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_PATCH_ID, hal_data->CustomerID);
-   ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_BWIFI_TEST, 
Adapter->registrypriv.wifi_spec);
-
+   dm_odm->SupportPlatform = ODM_CE;
+   dm_odm->SupportICType = ODM_RTL8188E;
+   dm_odm->CutVersion = ODM_CUT_A;
+   dm_odm->bIsMPChip = hal_data->VersionID.ChipType == NORMAL_CHIP;
+   dm_odm->PatchID = hal_data->CustomerID;
+   dm_odm->bWIFITest = Adapter->registrypriv.wifi_spec;
 
if (hal_data->rf_type == RF_1T1R)
dm_odm->RFType = ODM_1T1R;
@@ -73,7 +64,13 @@ static void Init_ODM_ComInfo_88E(struct 

RE: [PATCH 1/1] Drivers: hv: hv_util: Avoid dynamic allocation in time synch

2016-09-16 Thread KY Srinivasan


> -Original Message-
> From: k...@exchange.microsoft.com [mailto:k...@exchange.microsoft.com]
> Sent: Friday, September 16, 2016 9:31 PM
> To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> vkuzn...@redhat.com; jasow...@redhat.com;
> leann.ogasaw...@canonical.com
> Cc: Vivek Yadav ; KY Srinivasan
> 
> Subject: [PATCH 1/1] Drivers: hv: hv_util: Avoid dynamic allocation in time
> synch
> 
> From: Vivek yadav 
> 
> Under stress, we have seen allocation failure in time synch code. Avoid
> this dynamic allocation.
> 
> Signed-off-by: Vivek Yadav 
> Signed-off-by: K. Y. Srinivasan 

Greg, 
Please ignore this patch, It is already committed and got sent because of a 
glitch.

Regards,

K. Y
> ---
>  drivers/hv/hv_util.c |   39 ---
>  1 files changed, 28 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
> index 6286bdc..4aa3cb6 100644
> --- a/drivers/hv/hv_util.c
> +++ b/drivers/hv/hv_util.c
> @@ -64,9 +64,14 @@ static struct hv_util_service util_shutdown = {
>   .util_cb = shutdown_onchannelcallback,
>  };
> 
> +static int hv_timesync_init(struct hv_util_service *srv);
> +static void hv_timesync_deinit(void);
> +
>  static void timesync_onchannelcallback(void *context);
>  static struct hv_util_service util_timesynch = {
>   .util_cb = timesync_onchannelcallback,
> + .util_init = hv_timesync_init,
> + .util_deinit = hv_timesync_deinit,
>  };
> 
>  static void heartbeat_onchannelcallback(void *context);
> @@ -201,7 +206,6 @@ static void hv_set_host_time(struct work_struct
> *work)
>   host_ts = ns_to_timespec(host_tns);
> 
>   do_settimeofday(_ts);
> - kfree(wrk);
>  }
> 
>  /*
> @@ -217,22 +221,24 @@ static void hv_set_host_time(struct work_struct
> *work)
>   * typically used as a hint to the guest. The guest is under no obligation
>   * to discipline the clock.
>   */
> +static struct adj_time_work  wrk;
>  static inline void adj_guesttime(u64 hosttime, u64 reftime, u8 flags)
>  {
> - struct adj_time_work*wrk;
> 
> - wrk = kmalloc(sizeof(struct adj_time_work), GFP_ATOMIC);
> - if (wrk == NULL)
> + /*
> +  * This check is safe since we are executing in the
> +  * interrupt context and time synch messages arre always
> +  * delivered on the same CPU.
> +  */
> + if (work_pending())
>   return;
> 
> - wrk->host_time = hosttime;
> - wrk->ref_time = reftime;
> - wrk->flags = flags;
> + wrk.host_time = hosttime;
> + wrk.ref_time = reftime;
> + wrk.flags = flags;
>   if ((flags & (ICTIMESYNCFLAG_SYNC | ICTIMESYNCFLAG_SAMPLE)) !=
> 0) {
> - INIT_WORK(>work, hv_set_host_time);
> - schedule_work(>work);
> - } else
> - kfree(wrk);
> + schedule_work();
> + }
>  }
> 
>  /*
> @@ -457,6 +463,17 @@ static  struct hv_driver util_drv = {
>   .remove =  util_remove,
>  };
> 
> +static int hv_timesync_init(struct hv_util_service *srv)
> +{
> + INIT_WORK(, hv_set_host_time);
> + return 0;
> +}
> +
> +static void hv_timesync_deinit(void)
> +{
> + cancel_work_sync();
> +}
> +
>  static int __init init_hyperv_utils(void)
>  {
>   pr_info("Registering HyperV Utility Driver\n");
> --
> 1.7.4.1

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


[PATCH 1/2] Drivers: hv: make VMBus bus ids persistent

2016-09-16 Thread kys
From: Vitaly Kuznetsov 

Some tools use bus ids to identify devices and they count on the fact
that these ids are persistent across reboot. This may be not true for
VMBus as we use auto incremented counter from alloc_channel() as such
id. Switch to using if_instance from channel offer, this id is supposed
to be persistent.

Signed-off-by: Vitaly Kuznetsov 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/vmbus_drv.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 6cbe074..a259e18 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -961,8 +961,8 @@ int vmbus_device_register(struct hv_device 
*child_device_obj)
 {
int ret = 0;
 
-   dev_set_name(_device_obj->device, "vmbus_%d",
-child_device_obj->channel->id);
+   dev_set_name(_device_obj->device, "vmbus-%pUl",
+child_device_obj->channel->offermsg.offer.if_instance.b);
 
child_device_obj->device.bus = _bus;
child_device_obj->device.parent = _acpi_dev->dev;
-- 
1.7.4.1

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


[PATCH 0/2] Drivers: hv: vmbus: Use persistent IDs for vmbus device names

2016-09-16 Thread kys
From: K. Y. Srinivasan 

Use IDs that persist across reboots as vmbus device IDs.

Vitaly Kuznetsov (2):
  Drivers: hv: make VMBus bus ids persistent
  Drivers: hv: get rid of id in struct vmbus_channel

 drivers/hv/channel_mgmt.c |2 --
 drivers/hv/vmbus_drv.c|4 ++--
 include/linux/hyperv.h|3 ---
 3 files changed, 2 insertions(+), 7 deletions(-)

-- 
1.7.4.1

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


[PATCH 1/1] Drivers: hv: hv_util: Avoid dynamic allocation in time synch

2016-09-16 Thread kys
From: Vivek yadav 

Under stress, we have seen allocation failure in time synch code. Avoid
this dynamic allocation.

Signed-off-by: Vivek Yadav 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/hv_util.c |   39 ---
 1 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index 6286bdc..4aa3cb6 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -64,9 +64,14 @@ static struct hv_util_service util_shutdown = {
.util_cb = shutdown_onchannelcallback,
 };
 
+static int hv_timesync_init(struct hv_util_service *srv);
+static void hv_timesync_deinit(void);
+
 static void timesync_onchannelcallback(void *context);
 static struct hv_util_service util_timesynch = {
.util_cb = timesync_onchannelcallback,
+   .util_init = hv_timesync_init,
+   .util_deinit = hv_timesync_deinit,
 };
 
 static void heartbeat_onchannelcallback(void *context);
@@ -201,7 +206,6 @@ static void hv_set_host_time(struct work_struct *work)
host_ts = ns_to_timespec(host_tns);
 
do_settimeofday(_ts);
-   kfree(wrk);
 }
 
 /*
@@ -217,22 +221,24 @@ static void hv_set_host_time(struct work_struct *work)
  * typically used as a hint to the guest. The guest is under no obligation
  * to discipline the clock.
  */
+static struct adj_time_work  wrk;
 static inline void adj_guesttime(u64 hosttime, u64 reftime, u8 flags)
 {
-   struct adj_time_work*wrk;
 
-   wrk = kmalloc(sizeof(struct adj_time_work), GFP_ATOMIC);
-   if (wrk == NULL)
+   /*
+* This check is safe since we are executing in the
+* interrupt context and time synch messages arre always
+* delivered on the same CPU.
+*/
+   if (work_pending())
return;
 
-   wrk->host_time = hosttime;
-   wrk->ref_time = reftime;
-   wrk->flags = flags;
+   wrk.host_time = hosttime;
+   wrk.ref_time = reftime;
+   wrk.flags = flags;
if ((flags & (ICTIMESYNCFLAG_SYNC | ICTIMESYNCFLAG_SAMPLE)) != 0) {
-   INIT_WORK(>work, hv_set_host_time);
-   schedule_work(>work);
-   } else
-   kfree(wrk);
+   schedule_work();
+   }
 }
 
 /*
@@ -457,6 +463,17 @@ static  struct hv_driver util_drv = {
.remove =  util_remove,
 };
 
+static int hv_timesync_init(struct hv_util_service *srv)
+{
+   INIT_WORK(, hv_set_host_time);
+   return 0;
+}
+
+static void hv_timesync_deinit(void)
+{
+   cancel_work_sync();
+}
+
 static int __init init_hyperv_utils(void)
 {
pr_info("Registering HyperV Utility Driver\n");
-- 
1.7.4.1

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


RE: [PATCH v2 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent

2016-09-16 Thread KY Srinivasan


> -Original Message-
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Friday, September 16, 2016 4:53 PM
> To: KY Srinivasan 
> Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; Haiyang
> Zhang 
> Subject: Re: [PATCH v2 0/2] Drivers: hv: vmbus: make bus ids in sysfs
> persistent
> 
> Vitaly Kuznetsov  writes:
> 
> > Bus ids for VMBus devices in /sys/bus/vmbus/devices/ are not guaranteed
> > to be persistent across reboot or kernel restart and this causes problems
> > for some tools. E.g. kexec tools use these ids to identify NIC on kdump.
> > Fix the issue by using if_instance from channel offer as the unique id
> > instead of an auto incremented counter.
> >
> > Changes since v1:
> > - Use if_instance instead of relid [K. Y. Srinivasan]
> >
> > Vitaly Kuznetsov (2):
> >   Drivers: hv: make VMBus bus ids persistent
> >   Drivers: hv: get rid of id in struct vmbus_channel
> >
> 
> K. Y.,
> 
> I don't see these patches in your submissions to Greg. Could you please
> pick them up (in case there are no issues with them in your opinion, of
> course).
> 
> Thanks!

Sorry about that; patches sent out.

K. Y
> 
> >  drivers/hv/channel_mgmt.c | 2 --
> >  drivers/hv/vmbus_drv.c| 4 ++--
> >  include/linux/hyperv.h| 3 ---
> >  3 files changed, 2 insertions(+), 7 deletions(-)
> 
> --
>   Vitaly
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wlan-ng: if statement style cleanup

2016-09-16 Thread Greg Kroah-Hartman
On Fri, Sep 16, 2016 at 06:48:50AM -0400, Jon Eyolfson wrote:
> Formatted code to follow coding style guidelines.

What specific style guidelines did you have to change the code for?

Please always be specific.

can you fix this up and resend it?

thanks,

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


Re: [PATCH v2 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent

2016-09-16 Thread Vitaly Kuznetsov
Vitaly Kuznetsov  writes:

> Bus ids for VMBus devices in /sys/bus/vmbus/devices/ are not guaranteed
> to be persistent across reboot or kernel restart and this causes problems
> for some tools. E.g. kexec tools use these ids to identify NIC on kdump.
> Fix the issue by using if_instance from channel offer as the unique id
> instead of an auto incremented counter.
>
> Changes since v1:
> - Use if_instance instead of relid [K. Y. Srinivasan]
>
> Vitaly Kuznetsov (2):
>   Drivers: hv: make VMBus bus ids persistent
>   Drivers: hv: get rid of id in struct vmbus_channel
>

K. Y.,

I don't see these patches in your submissions to Greg. Could you please
pick them up (in case there are no issues with them in your opinion, of
course).

Thanks!

>  drivers/hv/channel_mgmt.c | 2 --
>  drivers/hv/vmbus_drv.c| 4 ++--
>  include/linux/hyperv.h| 3 ---
>  3 files changed, 2 insertions(+), 7 deletions(-)

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


Re: [PATCH] Staging: wlan-ng: if statement style cleanup

2016-09-16 Thread Dan Carpenter
On Thu, Sep 15, 2016 at 02:59:35PM -0400, Jon Eyolfson wrote:
> Signed-off-by: Jon Eyolfson 
> 

Patch is corrupt.  Read Documentation/email-clients.txt

regards,
dan carpenter

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


Re: [PATCH] staging: rts5208: Comparisons should place the constant on the right side of the test

2016-09-16 Thread Dan Carpenter
On Thu, Sep 15, 2016 at 07:22:40PM +0200, Sergio Paracuellos wrote:
> That's true. It seems that checkpatch script is getting a false
> positive. Just trying to do checkpatch happy.

Also the old code was better than new code so leave it alone.

regards,
dan carpenter

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


Re: [PATCH 01/11] staging: most: hdm-dim2: fix channel configuration

2016-09-16 Thread Dan Carpenter
On Thu, Sep 15, 2016 at 04:19:03PM +0200, Christian Gromm wrote:
> From: Andrey Shvetsov 
> 
> The DIM2 HDM checks the parameters passed to the function
> configure_channel() and adapts the buffer sizes of the configuration
> according to the hardware limitation. This patch is needed to init
> the HAL layer with the correct values.
> 

Correct values are good, but what are the user visible effects of this
bug?  I assume it's memory corruption.  How is it triggered?  Are there
security implications?

regards,
dan carpenter

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


[PATCHv2] staging: wlan-ng: if statement style cleanup

2016-09-16 Thread Jon Eyolfson
Changed if statement bodies from 2 levels deeper than if statement to 1.

Signed-off-by: Jon Eyolfson 
---
 drivers/staging/wlan-ng/cfg80211.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wlan-ng/cfg80211.c 
b/drivers/staging/wlan-ng/cfg80211.c
index a36e40d..457f176 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -476,11 +476,11 @@ static int prism2_connect(struct wiphy *wiphy, struct 
net_device *dev,
 
/* Set the authorization */
if ((sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) ||
-   ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && !is_wep))
-   msg_join.authtype.data = P80211ENUM_authalg_opensystem;
+   ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && !is_wep))
+   msg_join.authtype.data = P80211ENUM_authalg_opensystem;
else if ((sme->auth_type == NL80211_AUTHTYPE_SHARED_KEY) ||
-   ((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && is_wep))
-   msg_join.authtype.data = P80211ENUM_authalg_sharedkey;
+((sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC) && is_wep))
+   msg_join.authtype.data = P80211ENUM_authalg_sharedkey;
else
netdev_warn(dev,
"Unhandled authorisation type for connect (%d)\n",
-- 
2.9.3
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: include/lustre_net.h: Remove unnecessary space before function pointer arguments.

2016-09-16 Thread Richard Groux
Minor warnings spotted by checkpatch.pl in lustre
Remove unnecessary space before function pointer arguments.

Signed-off-by: Richard Groux 
---
 drivers/staging/lustre/lustre/include/lustre_net.h | 46 +++---
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index d5debd6..24ddccab 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -570,13 +570,13 @@ struct ptlrpc_nrs_pol_ops {
 *
 * \param[in,out] policy The policy being initialized
 */
-   int (*op_policy_init) (struct ptlrpc_nrs_policy *policy);
+   int (*op_policy_init)(struct ptlrpc_nrs_policy *policy);
/**
 * Called during policy unregistration; this operation is optional.
 *
 * \param[in,out] policy The policy being unregistered/finalized
 */
-   void(*op_policy_fini) (struct ptlrpc_nrs_policy *policy);
+   void(*op_policy_fini)(struct ptlrpc_nrs_policy *policy);
/**
 * Called when activating a policy via lprocfs; policies allocate and
 * initialize their resources here; this operation is optional.
@@ -585,7 +585,7 @@ struct ptlrpc_nrs_pol_ops {
 *
 * \see nrs_policy_start_locked()
 */
-   int (*op_policy_start) (struct ptlrpc_nrs_policy *policy);
+   int (*op_policy_start)(struct ptlrpc_nrs_policy *policy);
/**
 * Called when deactivating a policy via lprocfs; policies deallocate
 * their resources here; this operation is optional
@@ -594,7 +594,7 @@ struct ptlrpc_nrs_pol_ops {
 *
 * \see nrs_policy_stop0()
 */
-   void(*op_policy_stop) (struct ptlrpc_nrs_policy *policy);
+   void(*op_policy_stop)(struct ptlrpc_nrs_policy *policy);
/**
 * Used for policy-specific operations; i.e. not generic ones like
 * \e PTLRPC_NRS_CTL_START and \e PTLRPC_NRS_CTL_GET_INFO; analogous
@@ -610,8 +610,8 @@ struct ptlrpc_nrs_pol_ops {
 *
 * \see ptlrpc_nrs_policy_control()
 */
-   int (*op_policy_ctl) (struct ptlrpc_nrs_policy *policy,
- enum ptlrpc_nrs_ctl opc, void *arg);
+   int (*op_policy_ctl)(struct ptlrpc_nrs_policy *policy,
+enum ptlrpc_nrs_ctl opc, void *arg);
 
/**
 * Called when obtaining references to the resources of the resource
@@ -648,11 +648,11 @@ struct ptlrpc_nrs_pol_ops {
 * \see ptlrpc_nrs_req_initialize()
 * \see ptlrpc_nrs_hpreq_add_nolock()
 */
-   int (*op_res_get) (struct ptlrpc_nrs_policy *policy,
-  struct ptlrpc_nrs_request *nrq,
-  const struct ptlrpc_nrs_resource *parent,
-  struct ptlrpc_nrs_resource **resp,
-  bool moving_req);
+   int (*op_res_get)(struct ptlrpc_nrs_policy *policy,
+ struct ptlrpc_nrs_request *nrq,
+ const struct ptlrpc_nrs_resource *parent,
+ struct ptlrpc_nrs_resource **resp,
+ bool moving_req);
/**
 * Called when releasing references taken for resources in the resource
 * hierarchy for the request; this operation is optional.
@@ -663,8 +663,8 @@ struct ptlrpc_nrs_pol_ops {
 * \see ptlrpc_nrs_req_finalize()
 * \see ptlrpc_nrs_hpreq_add_nolock()
 */
-   void(*op_res_put) (struct ptlrpc_nrs_policy *policy,
-  const struct ptlrpc_nrs_resource *res);
+   void(*op_res_put)(struct ptlrpc_nrs_policy *policy,
+ const struct ptlrpc_nrs_resource *res);
 
/**
 * Obtains a request for handling from the policy, and optionally
@@ -683,8 +683,8 @@ struct ptlrpc_nrs_pol_ops {
 * \see ptlrpc_nrs_req_get_nolock()
 */
struct ptlrpc_nrs_request *
-   (*op_req_get) (struct ptlrpc_nrs_policy *policy, bool peek,
-  bool force);
+   (*op_req_get)(struct ptlrpc_nrs_policy *policy, bool peek,
+ bool force);
/**
 * Called when attempting to add a request to a policy for later
 * handling; this operation is mandatory.
@@ -697,8 +697,8 @@ struct ptlrpc_nrs_pol_ops {
 *
 * \see ptlrpc_nrs_req_add_nolock()
 */
-   int (*op_req_enqueue) (struct ptlrpc_nrs_policy *policy,
-  struct ptlrpc_nrs_request *nrq);
+   int (*op_req_enqueue)(struct ptlrpc_nrs_policy *policy,
+ struct ptlrpc_nrs_request *nrq);
/**
 * Removes a