driverdev-devel@linuxdriverproject.org

2017-08-01 Thread janani-sankarababu
This patch is created to solve the coding style issues reported
by the checkpatch script.

Signed-off-by: Janani Sankara Babu 
---
 drivers/staging/rtl8188eu/core/rtw_ap.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 647a922..66d4e6c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -119,7 +119,7 @@ static void update_BCNTIM(struct adapter *padapter)
}
*dst_ie++ = _TIM_IE_;

-   if ((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
+   if ((pstapriv->tim_bitmap & 0xff00) && (pstapriv->tim_bitmap & 0x00fc))
tim_ielen = 5;
else
tim_ielen = 4;
@@ -129,7 +129,7 @@ static void update_BCNTIM(struct adapter *padapter)
*dst_ie++ = 0;/* DTIM count */
*dst_ie++ = 1;/* DTIM period */

-   if (pstapriv->tim_bitmap&BIT(0))/* for bc/mc frames */
+   if (pstapriv->tim_bitmap & BIT(0))/* for bc/mc frames */
*dst_ie++ = BIT(0);/* bitmap ctrl */
else
*dst_ie++ = 0;
@@ -583,7 +583,7 @@ static void update_bmc_sta(struct adapter *padapter)
{
u8 arg = 0;

-   arg = psta->mac_id&0x1f;
+   arg = psta->mac_id & 0x1f;
arg |= BIT(7);
tx_ra_bitmap |= ((raid << 28) & 0xf000);
DBG_88E("update_bmc_sta, mask = 0x%x, arg = 0x%x\n", 
tx_ra_bitmap, arg);
@@ -1043,7 +1043,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
(psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP))
pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY & (0x07 << 2));
else
-   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
+   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00);

/* set  Max Rx AMPDU size  to 64K */
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 
0x03);
@@ -1719,7 +1719,7 @@ int rtw_sta_flush(struct adapter *padapter)

DBG_88E(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev));

-   if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+   if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
return 0;

spin_lock_bh(&pstapriv->asoc_list_lock);
@@ -1754,7 +1754,7 @@ void sta_info_update(struct adapter *padapter, struct 
sta_info *psta)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

/* update wmm cap. */
-   if (WLAN_STA_WME&flags)
+   if (WLAN_STA_WME & flags)
psta->qos_option = 1;
else
psta->qos_option = 0;
@@ -1763,7 +1763,7 @@ void sta_info_update(struct adapter *padapter, struct 
sta_info *psta)
psta->qos_option = 0;

/* update 802.11n ht cap. */
-   if (WLAN_STA_HT&flags) {
+   if (WLAN_STA_HT & flags) {
psta->htpriv.ht_option = true;
psta->qos_option = 1;
} else {
--
1.9.1

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


Re: [PATCH] staging: comedi: comedi_fops: do not call blocking ops when !TASK_RUNNING

2017-08-01 Thread Piotr Gregor
On Fri, Jul 28, 2017 at 04:22:31PM +0100, Ian Abbott wrote:
> Comedi's read and write file operation handlers (`comedi_read()` and
> `comedi_write()`) currently call `copy_to_user()` or `copy_from_user()`
> whilst in the `TASK_INTERRUPTIBLE` state, which falls foul of the
> `might_fault()` checks when enabled.  Fix it by setting the current task
> state back to `TASK_RUNNING` a bit earlier before calling these
> functions.
> 
> Reported-by: Piotr Gregor 
> Signed-off-by: Ian Abbott 
> Cc:  # 4.5+
> ---
> Note: stable kernel versions 4.4 and earlier will need a slightly more
> extensive change in `comedi_write()` than provided by this patch due to
> a call to `mutex_lock()` whilst in the `TASK_INTERRUPTIBLE` state.
> ---
>  drivers/staging/comedi/comedi_fops.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/staging/comedi/comedi_fops.c 
> b/drivers/staging/comedi/comedi_fops.c
> index ca11be21f64b..34ca7823255d 100644
> --- a/drivers/staging/comedi/comedi_fops.c
> +++ b/drivers/staging/comedi/comedi_fops.c
> @@ -2396,6 +2396,7 @@ static ssize_t comedi_write(struct file *file, const 
> char __user *buf,
>   continue;
>   }
>  
> + set_current_state(TASK_RUNNING);
>   wp = async->buf_write_ptr;
>   n1 = min(n, async->prealloc_bufsz - wp);
>   n2 = n - n1;
> @@ -2528,6 +2529,8 @@ static ssize_t comedi_read(struct file *file, char 
> __user *buf, size_t nbytes,
>   }
>   continue;
>   }
> +
> + set_current_state(TASK_RUNNING);
>   rp = async->buf_read_ptr;
>   n1 = min(n, async->prealloc_bufsz - rp);
>   n2 = n - n1;
> -- 
> 2.13.2
> 

Hi Ian,

I will be able to test this in a couple of days.

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


[PATCH 2/2] staging:rtl8188eu:core Fix Avoid CamelCase

2017-08-01 Thread janani-sankarababu
This patch is created to solve CamelCase issue. The
members 'IEs' and 'IELength' of struct wlan_bssid_ex
are modified to 'ies' and 'ielength' to solve CamelCase.
And all the places where these variables are referenced
inside rtl8188eu driver are also changed.
---
 drivers/staging/rtl8188eu/core/rtw_ap.c |  75 +-
 drivers/staging/rtl8188eu/core/rtw_cmd.c|  26 +++---
 drivers/staging/rtl8188eu/core/rtw_ieee80211.c  |  20 ++---
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c  |   2 +-
 drivers/staging/rtl8188eu/core/rtw_mlme.c   |  66 
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c   | 100 
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c  |  34 
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c|  16 ++--
 drivers/staging/rtl8188eu/include/wlan_bssdef.h |  10 +--
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c  |  12 +--
 10 files changed, 182 insertions(+), 179 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 66d4e6c..2cd20f1 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -69,19 +69,22 @@ static void update_BCNTIM(struct adapter *padapter)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network;
-   unsigned char *pie = pnetwork_mlmeext->IEs;
+   //unsigned char *pie = pnetwork_mlmeext->ies;
+   unsigned char *pie = pnetwork_mlmeext->ies;
u8 *p, *dst_ie, *premainder_ie = NULL;
u8 *pbackup_remainder_ie = NULL;
uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen;

/* update TIM IE */
+   //p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen,
+   //pnetwork_mlmeext->ie_length - _FIXED_IE_LENGTH_);
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen,
-   pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
+   pnetwork_mlmeext->ie_length - _FIXED_IE_LENGTH_);
if (p && tim_ielen > 0) {
tim_ielen += 2;
premainder_ie = p + tim_ielen;
tim_ie_offset = (int)(p - pie);
-   remainder_ielen = pnetwork_mlmeext->IELength -
+   remainder_ielen = pnetwork_mlmeext->ie_length -
tim_ie_offset - tim_ielen;
/* append TIM IE from dst_ie offset */
dst_ie = p;
@@ -94,7 +97,7 @@ static void update_BCNTIM(struct adapter *padapter)

/*  get supported rates len */
p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_,
-  &tmp_len, (pnetwork_mlmeext->IELength -
+  &tmp_len, (pnetwork_mlmeext->ie_length -
  _BEACON_IE_OFFSET_));
if (p)
offset += tmp_len+2;
@@ -104,7 +107,7 @@ static void update_BCNTIM(struct adapter *padapter)

premainder_ie = pie + offset;

-   remainder_ielen = pnetwork_mlmeext->IELength -
+   remainder_ielen = pnetwork_mlmeext->ie_length -
offset - tim_ielen;

/* append TIM IE from offset */
@@ -148,7 +151,7 @@ static void update_BCNTIM(struct adapter *padapter)
kfree(pbackup_remainder_ie);
}
offset =  (uint)(dst_ie - pie);
-   pnetwork_mlmeext->IELength = offset + remainder_ielen;
+   pnetwork_mlmeext->ie_length = offset + remainder_ielen;

set_tx_beacon_cmd(padapter);
 }
@@ -158,13 +161,13 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct 
wlan_bssid_ex *pnetwork,
 {
struct ndis_802_11_var_ie *pIE;
u8 bmatch = false;
-   u8 *pie = pnetwork->IEs;
+   u8 *pie = pnetwork->ies;
u8 *p = NULL, *dst_ie = NULL, *premainder_ie = NULL;
u8 *pbackup_remainder_ie = NULL;
u32 i, offset, ielen = 0, ie_offset, remainder_ielen = 0;

-   for (i = sizeof(struct ndis_802_11_fixed_ie); i < pnetwork->IELength;) {
-   pIE = (struct ndis_802_11_var_ie *)(pnetwork->IEs + i);
+   for (i = sizeof(struct ndis_802_11_fixed_ie); i < pnetwork->ie_length;) 
{
+   pIE = (struct ndis_802_11_var_ie *)(pnetwork->ies + i);

if (pIE->ElementID > index) {
break;
@@ -187,7 +190,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct 
wlan_bssid_ex *pnetwork,

ie_offset = (int)(p - pie);

-   remainder_ielen = pnetwork->IELength - ie_offset - ielen;
+   remainder_ielen = pnetwork->ie_length - ie_offset - ielen;

if (bmatch)
dst_ie = p;
@@ -216,7 +219,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct 
w

Re: [sm750fb] Sunix 2D VGA controller causes kernel panic and crash on boot

2017-08-01 Thread Bartlomiej Zolnierkiewicz

Hi,

I added staging mailing list and Greg to Cc:
(sm750fb driver is a part of STAGING subsystem,, not FBDEV one).

On Tuesday, August 01, 2017 08:44:42 AM Tommy Giesler wrote:
> I have recently submitted a bug report to the Ubuntu bugtracker, since 
> one of our test installations of Ubuntu 17.10 kept failing to boot and I 
> was pointed to this mailing list.
> 
> The system is using a Sunix 2D graphics controller, which uses a Silicon 
> Motion SM750, for video output.
> 
> Starting with Kernel 4.11 the system was no longer able to boot when 
> using the sm750fb module.
> 
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1707641
> 
> After blacklisting the module the system was working fine again. There 
> were no known issues prior to Kernel 4.11.
> 
> Since all the log files were already attached in the Ubuntu bugtracker, 
> I hope it is fine, that I don't attach them here again.
> 
> Please let me know, if you need any further information.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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


[PATCH V2 2/2] staging:rtl8188eu:core Fix Avoid CamelCase

2017-08-01 Thread janani-sankarababu
This patch is created to solve CamelCase issue. The
variables 'IEs' and 'IELength' of struct wlan_bssid_ex
are replaced with 'ies' and 'ie_length' to solve the 
CamelCase issue and these changes are applied to all the 
places where these variables are referenced inside the 
rtl8188eu driver.

Signed-off-by: Janani Sankara Babu 
---
Changelog:
v2 Addressed missing patch sign-off
v1 Solved CamelCase Issue

 drivers/staging/rtl8188eu/core/rtw_ap.c |  75 +-
 drivers/staging/rtl8188eu/core/rtw_cmd.c|  26 +++---
 drivers/staging/rtl8188eu/core/rtw_ieee80211.c  |  20 ++---
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c  |   2 +-
 drivers/staging/rtl8188eu/core/rtw_mlme.c   |  66 
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c   | 100 
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c  |  34 
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c|  16 ++--
 drivers/staging/rtl8188eu/include/wlan_bssdef.h |  10 +--
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c  |  12 +--
 10 files changed, 182 insertions(+), 179 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 66d4e6c..2cd20f1 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -69,19 +69,22 @@ static void update_BCNTIM(struct adapter *padapter)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network;
-   unsigned char *pie = pnetwork_mlmeext->IEs;
+   //unsigned char *pie = pnetwork_mlmeext->ies;
+   unsigned char *pie = pnetwork_mlmeext->ies;
u8 *p, *dst_ie, *premainder_ie = NULL;
u8 *pbackup_remainder_ie = NULL;
uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen;
 
/* update TIM IE */
+   //p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen,
+   //pnetwork_mlmeext->ie_length - _FIXED_IE_LENGTH_);
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen,
-   pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
+   pnetwork_mlmeext->ie_length - _FIXED_IE_LENGTH_);
if (p && tim_ielen > 0) {
tim_ielen += 2;
premainder_ie = p + tim_ielen;
tim_ie_offset = (int)(p - pie);
-   remainder_ielen = pnetwork_mlmeext->IELength -
+   remainder_ielen = pnetwork_mlmeext->ie_length -
tim_ie_offset - tim_ielen;
/* append TIM IE from dst_ie offset */
dst_ie = p;
@@ -94,7 +97,7 @@ static void update_BCNTIM(struct adapter *padapter)
 
/*  get supported rates len */
p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_,
-  &tmp_len, (pnetwork_mlmeext->IELength -
+  &tmp_len, (pnetwork_mlmeext->ie_length -
  _BEACON_IE_OFFSET_));
if (p)
offset += tmp_len+2;
@@ -104,7 +107,7 @@ static void update_BCNTIM(struct adapter *padapter)
 
premainder_ie = pie + offset;
 
-   remainder_ielen = pnetwork_mlmeext->IELength -
+   remainder_ielen = pnetwork_mlmeext->ie_length -
offset - tim_ielen;
 
/* append TIM IE from offset */
@@ -148,7 +151,7 @@ static void update_BCNTIM(struct adapter *padapter)
kfree(pbackup_remainder_ie);
}
offset =  (uint)(dst_ie - pie);
-   pnetwork_mlmeext->IELength = offset + remainder_ielen;
+   pnetwork_mlmeext->ie_length = offset + remainder_ielen;
 
set_tx_beacon_cmd(padapter);
 }
@@ -158,13 +161,13 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct 
wlan_bssid_ex *pnetwork,
 {
struct ndis_802_11_var_ie *pIE;
u8 bmatch = false;
-   u8 *pie = pnetwork->IEs;
+   u8 *pie = pnetwork->ies;
u8 *p = NULL, *dst_ie = NULL, *premainder_ie = NULL;
u8 *pbackup_remainder_ie = NULL;
u32 i, offset, ielen = 0, ie_offset, remainder_ielen = 0;
 
-   for (i = sizeof(struct ndis_802_11_fixed_ie); i < pnetwork->IELength;) {
-   pIE = (struct ndis_802_11_var_ie *)(pnetwork->IEs + i);
+   for (i = sizeof(struct ndis_802_11_fixed_ie); i < pnetwork->ie_length;) 
{
+   pIE = (struct ndis_802_11_var_ie *)(pnetwork->ies + i);
 
if (pIE->ElementID > index) {
break;
@@ -187,7 +190,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct 
wlan_bssid_ex *pnetwork,
 
ie_offset = (int)(p - pie);
 
-   remainder_ielen = pnetwork->IELength - ie_offset - ielen;
+   remainder_ielen = pnetwork->ie_length - ie_of

[PATCH v3] staging: octeon: fix line over 80 characters

2017-08-01 Thread catalinnow
From: John Smith 

ethernet-rx.c:

fix WARNING: line over 80 characters

The code was restructured a bit, a helper function
was added to cvm_oct_poll.

Signed-off-by: John Smith 
---
Changes since version 2:
- silenced build warning

 drivers/staging/octeon/ethernet-rx.c | 79 +++-
 1 file changed, 41 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-rx.c 
b/drivers/staging/octeon/ethernet-rx.c
index 72baede..1a44291 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -149,6 +149,46 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
return 0;
 }
 
+static void copy_segments_to_skb(cvmx_wqe_t *work, struct sk_buff *skb)
+{
+   int segments = work->word2.s.bufs;
+   union cvmx_buf_ptr segment_ptr = work->packet_ptr;
+   int len = work->word1.len;
+   int segment_size;
+
+   while (segments--) {
+   union cvmx_buf_ptr next_ptr;
+
+   next_ptr = *(union cvmx_buf_ptr *)
+   cvmx_phys_to_ptr(segment_ptr.s.addr - 8);
+
+   /*
+* Octeon Errata PKI-100: The segment size is wrong.
+*
+* Until it is fixed, calculate the segment size based on
+* the packet pool buffer size.
+* When it is fixed, the following line should be replaced
+* with this one:
+* int segment_size = segment_ptr.s.size;
+*/
+   segment_size =
+   CVMX_FPA_PACKET_POOL_SIZE -
+   (segment_ptr.s.addr -
+(((segment_ptr.s.addr >> 7) -
+  segment_ptr.s.back) << 7));
+
+   /* Don't copy more than what is left in the packet */
+   if (segment_size > len)
+   segment_size = len;
+
+   /* Copy the data into the packet */
+   skb_put_data(skb, cvmx_phys_to_ptr(segment_ptr.s.addr),
+segment_size);
+   len -= segment_size;
+   segment_ptr = next_ptr;
+   }
+}
+
 static int cvm_oct_poll(struct oct_rx_group *rx_group, int budget)
 {
const int   coreid = cvmx_get_core_num();
@@ -290,44 +330,7 @@ static int cvm_oct_poll(struct oct_rx_group *rx_group, int 
budget)
skb_put_data(skb, ptr, work->word1.len);
/* No packet buffers to free */
} else {
-   int segments = work->word2.s.bufs;
-   union cvmx_buf_ptr segment_ptr =
-   work->packet_ptr;
-   int len = work->word1.len;
-
-   while (segments--) {
-   union cvmx_buf_ptr next_ptr =
-   *(union cvmx_buf_ptr *)
- cvmx_phys_to_ptr(
- segment_ptr.s.addr - 8);
-
-   /*
-* Octeon Errata PKI-100: The segment size is
-* wrong. Until it is fixed, calculate the
-* segment size based on the packet pool
-* buffer size. When it is fixed, the
-* following line should be replaced with this
-* one: int segment_size =
-* segment_ptr.s.size;
-*/
-   int segment_size =
-   CVMX_FPA_PACKET_POOL_SIZE -
-   (segment_ptr.s.addr -
-(((segment_ptr.s.addr >> 7) -
-  segment_ptr.s.back) << 7));
-   /*
-* Don't copy more than what
-* is left in the packet.
-*/
-   if (segment_size > len)
-   segment_size = len;
-   /* Copy the data into the packet */
-   skb_put_data(skb,
-
cvmx_phys_to_ptr(segment_ptr.s.addr),
-segment_size);
-   len -= segment_size;
-   segment_ptr = next_ptr;
-   }
+   copy_segments_to_skb(work, skb);
}
packet_not_copied = 0;
}
-- 
2.7.4

__

[bug report] staging: lustre: lov: Ensure correct operation for large object sizes

2017-08-01 Thread Dan Carpenter
Hello Nathaniel Clark,

The patch 476f575cf070: "staging: lustre: lov: Ensure correct
operation for large object sizes" from Jul 26, 2017, leads to the
following static checker warning:

drivers/staging/lustre/lustre/lov/lov_ea.c:207 lsm_unpackmd_common()
warn: signed overflow undefined. 'min_stripe_maxbytes * stripe_count < 
min_stripe_maxbytes'

drivers/staging/lustre/lustre/lov/lov_ea.c
   148  static int lsm_unpackmd_common(struct lov_obd *lov,
   149 struct lov_stripe_md *lsm,
   150 struct lov_mds_md *lmm,
   151 struct lov_ost_data_v1 *objects)
   152  {
   153  loff_t min_stripe_maxbytes = 0;
^^
loff_t is long long.

   154  unsigned int stripe_count;
   155  struct lov_oinfo *loi;
   156  loff_t lov_bytes;
   157  unsigned int i;
   158  
   159  /*
   160   * This supposes lov_mds_md_v1/v3 first fields are
   161   * are the same
   162   */
   163  lmm_oi_le_to_cpu(&lsm->lsm_oi, &lmm->lmm_oi);
   164  lsm->lsm_stripe_size = le32_to_cpu(lmm->lmm_stripe_size);
   165  lsm->lsm_pattern = le32_to_cpu(lmm->lmm_pattern);
   166  lsm->lsm_layout_gen = le16_to_cpu(lmm->lmm_layout_gen);
   167  lsm->lsm_pool_name[0] = '\0';
   168  
   169  stripe_count = lsm_is_released(lsm) ? 0 : lsm->lsm_stripe_count;
   170  
   171  for (i = 0; i < stripe_count; i++) {
   172  loi = lsm->lsm_oinfo[i];
   173  ostid_le_to_cpu(&objects[i].l_ost_oi, &loi->loi_oi);
   174  loi->loi_ost_idx = le32_to_cpu(objects[i].l_ost_idx);
   175  loi->loi_ost_gen = le32_to_cpu(objects[i].l_ost_gen);
   176  if (lov_oinfo_is_dummy(loi))
   177  continue;
   178  
   179  if (loi->loi_ost_idx >= lov->desc.ld_tgt_count &&
   180  !lov2obd(lov)->obd_process_conf) {
   181  CERROR("%s: OST index %d more than OST count 
%d\n",
   182 (char *)lov->desc.ld_uuid.uuid,
   183 loi->loi_ost_idx, 
lov->desc.ld_tgt_count);
   184  lov_dump_lmm_v1(D_WARNING, lmm);
   185  return -EINVAL;
   186  }
   187  
   188  if (!lov->lov_tgts[loi->loi_ost_idx]) {
   189  CERROR("%s: OST index %d missing\n",
   190 (char *)lov->desc.ld_uuid.uuid,
   191 loi->loi_ost_idx);
   192  lov_dump_lmm_v1(D_WARNING, lmm);
   193  continue;
   194  }
   195  
   196  lov_bytes = 
lov_tgt_maxbytes(lov->lov_tgts[loi->loi_ost_idx]);
   197  if (min_stripe_maxbytes == 0 || lov_bytes < 
min_stripe_maxbytes)
   198  min_stripe_maxbytes = lov_bytes;
   199  }
   200  
   201  if (min_stripe_maxbytes == 0)
   202  min_stripe_maxbytes = LUSTRE_EXT3_STRIPE_MAXBYTES;
   203  
   204  stripe_count = lsm->lsm_stripe_count ?: lov->desc.ld_tgt_count;
   205  lov_bytes = min_stripe_maxbytes * stripe_count;
^^
This is undefined in C.

   206  
   207  if (lov_bytes < min_stripe_maxbytes) /* handle overflow */
^^^
So this might be wrong.

   208  lsm->lsm_maxbytes = MAX_LFS_FILESIZE;
   209  else
   210  lsm->lsm_maxbytes = lov_bytes;
   211  
   212  return 0;
   213  }

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


Re: [PATCH] staging/ccree: Declare compiled out fuctions static inline

2017-08-01 Thread Gilad Ben-Yossef
On Mon, Jul 31, 2017 at 12:17 PM, RishabhHardas
 wrote:
> From: RishabhHardas 
>
> Sparse was giving out a warning for symbols 'cc_set_ree_fips_status' and 
> 'fips_handler'
> that they were not declared and need to be made static. This patch makes both 
> the symbols
> static inline, to remove the warnings.
>
> Signed-off-by: RishabhHardas 

Acked-by: Gilad Ben-Yossef 

Thanks,
Gilad



-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/45] staging: unisys: visorbus: Adding a new line between function definition

2017-08-01 Thread David Kershner
From: Zohaib Javed 

Added a new line before issue_vmcall_io_controlvm_addr() function
definition.

Signed-off-by: Zohaib Javed 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index c8a5cb2..12def21 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1325,6 +1325,7 @@ static int unisys_vmcall(unsigned long tuple, unsigned 
long param)
return -EFAULT;
}
 }
+
 static unsigned int
 issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes)
 {
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/45] staging: unisys: more changes to the code.

2017-08-01 Thread David Kershner
The following patch series addresses issues from internal code-review as
well as checkpatch errors and suggestions from GregKH.

We have updated our commenting style to be more readable (and adopted a
kernel-doc like format). We have intentionally not made them kernel-doc by
removing the extra asterisk from the first line.

Charles Daniels (1):
  staging: unisys: visorbus: fix multi-line function definition

David Binder (10):
  staging: unisys: visorbus: Merge vmcallinterface.h into visorchipset.c
  staging: unisys: visorbus: Remove unnecessary comments
  staging: unisys: visorbus: visorchipset.c: Fix SonarQube sprintf findings
  staging: unisys: visorbus: visorbus_main.c: Remove filename in top comment
  staging: unisys: visorbus: visorchannel.c: Remove filename in top comment
  staging: unisys: visorinput: visorinput.c: Remove filename in top comment
  staging: unisys: include: visorbus.h: Remove filename in top comment
  staging: unisys: visorhba: Adjust top comment formatting
  staging: unisys: visorinput: ultrainputreport.h: Adjust comment formatting
  staging: unisys: include: iochannel.h: Add proper copyright statement

David Kershner (21):
  staging: unisys: include: Remove unused #define MAXNUM
  staging: unisys: use the kernel min define
  staging: unisys: include: iochannel.h: Update comments for #defines
  staging: unisys: include: Remove unused vdiskmgmt commands
  staging: unisys: include: Remove unused throttling defines.
  staging: unisys: include: cleanup channel comment
  staging: unisys: include: Fix up comment style in visorbus.h
  staging: unisys: include: Remove unnecessary forward declaration
  staging: unisys: include: Remove unneeded includes from visorbus.h
  staging: unisys: visorbus: fix include dependency
  staging: unisys: visorbus: Remove unnecessary includes for visorchipset.c
  staging: unisys: include: iochannel needs to include skbuff
  staging: unisys: visorinput: Get rid of unused includes
  staging: unisys: include: remove unnecessary blank line from channel.h
  staging: unisys: Move VNIC GUID to visornic
  staging: unisys: Move SIOVM guid to visorbus
  staging: unisys: visorbus: Remove confusing comment in controlvmchannel.
  staging: unisys: don't copy to local variable
  staging: unisys: reference bus_no and dev_no directly
  staging: unisys: visorbus: Get rid of passthrough function 
visorchipset_bus_create
  staging: unisys: use ATTRIBUTE_GROUPS instead of creating our own

Mark Foresta (2):
  staging: unisys: visorbus: Update comment style vbuschannel.h
  staging: unisys: visorbus: visorbus_private.h remove filename

Sameer Wadgaonkar (7):
  staging: unisys: visornic: update the struct viosrnic_devdata comments
  staging: unisys: visornic: visornic_main.c: fix multiline dereference.
  staging: unisys: visorbus: merging the visorbus_*_response functions into one.
  staging: unisys: visorbus: merging the visorbus_device_pause_response and 
visorbus_device_resume_response functions into one.
  staging: unisys: visorbus: Get rid of passthrough function 
visorchipset_bus_destroy
  staging: unisys: visorbus: Get rid of passthrough function 
visorchipset_device_create
  staging: unisys: visorbus: Get rid of passthrough function 
visorchipset_device_destroy

Steven Matthews (1):
  staging: unisys: include: fix improper use of dma_data_direction

Zohaib Javed (3):
  staging: unisys: visorbus: remove filename from beginning of file
  staging: unisys: include: iochannel.h: Removed unused DEFINE
  staging: unisys: visorbus: Adding a new line between function definition

 drivers/staging/unisys/include/channel.h |  40 +--
 drivers/staging/unisys/include/iochannel.h   |  82 +---
 drivers/staging/unisys/include/visorbus.h|  16 +-
 drivers/staging/unisys/visorbus/controlvmchannel.h   |   1 +-
 drivers/staging/unisys/visorbus/vbuschannel.h|   3 +-
 drivers/staging/unisys/visorbus/visorbus_main.c  |  94 +
 drivers/staging/unisys/visorbus/visorbus_private.h   |  22 +-
 drivers/staging/unisys/visorbus/visorchannel.c   |   3 +-
 drivers/staging/unisys/visorbus/visorchipset.c   | 268 
 drivers/staging/unisys/visorbus/vmcallinterface.h|  61 +---
 drivers/staging/unisys/visorhba/visorhba_main.c  |  30 +-
 drivers/staging/unisys/visorinput/ultrainputreport.h |   3 +-
 drivers/staging/unisys/visorinput/visorinput.c   |   6 +-
 drivers/staging/unisys/visornic/visornic_main.c  | 105 +++--
 14 files changed, 291 insertions(+), 443 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorbus/vmcallinterface.h

base-commit: 5551ad1e9fad2cf06288c6e93cb95f879b8cdf5e
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/45] staging: unisys: visorbus: fix multi-line function definition

2017-08-01 Thread David Kershner
From: Charles Daniels 

Fixed incorrectly styled function definitions in visorbus/visorchipset.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 153 +++---
 1 file changed, 62 insertions(+), 91 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 12def21..a3c8552 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -267,8 +267,7 @@ static ssize_t remaining_steps_store(struct device *dev,
 }
 static DEVICE_ATTR_RW(remaining_steps);
 
-static uuid_le
-parser_id_get(struct parser_context *ctx)
+static uuid_le parser_id_get(struct parser_context *ctx)
 {
struct visor_controlvm_parameters_header *phdr = NULL;
 
@@ -282,8 +281,7 @@ static void parser_done(struct parser_context *ctx)
kfree(ctx);
 }
 
-static void *
-parser_string_get(struct parser_context *ctx)
+static void *parser_string_get(struct parser_context *ctx)
 {
u8 *pscan;
unsigned long nscan;
@@ -316,8 +314,7 @@ parser_string_get(struct parser_context *ctx)
return value;
 }
 
-static void *
-parser_name_get(struct parser_context *ctx)
+static void *parser_name_get(struct parser_context *ctx)
 {
struct visor_controlvm_parameters_header *phdr = NULL;
 
@@ -370,9 +367,9 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, 
u32 dev_no,
return vdev;
 }
 
-static void
-controlvm_init_response(struct controlvm_message *msg,
-   struct controlvm_message_header *msg_hdr, int response)
+static void controlvm_init_response(struct controlvm_message *msg,
+   struct controlvm_message_header *msg_hdr,
+   int response)
 {
memset(msg, 0, sizeof(struct controlvm_message));
memcpy(&msg->hdr, msg_hdr, sizeof(struct controlvm_message_header));
@@ -385,10 +382,10 @@ controlvm_init_response(struct controlvm_message *msg,
}
 }
 
-static int
-controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
-  int response,
-  enum visor_chipset_feature features)
+static int controlvm_respond_chipset_init(
+   struct controlvm_message_header *msg_hdr,
+   int response,
+   enum visor_chipset_feature features)
 {
struct controlvm_message outmsg;
 
@@ -398,8 +395,7 @@ controlvm_respond_chipset_init(struct 
controlvm_message_header *msg_hdr,
 CONTROLVM_QUEUE_REQUEST, &outmsg);
 }
 
-static int
-chipset_init(struct controlvm_message *inmsg)
+static int chipset_init(struct controlvm_message *inmsg)
 {
static int chipset_inited;
enum visor_chipset_feature features = 0;
@@ -433,9 +429,9 @@ chipset_init(struct controlvm_message *inmsg)
return res;
 }
 
-static int
-controlvm_respond(struct controlvm_message_header *msg_hdr, int response,
- struct visor_segment_state *state)
+static int controlvm_respond(struct controlvm_message_header *msg_hdr,
+int response,
+struct visor_segment_state *state)
 {
struct controlvm_message outmsg;
 
@@ -457,8 +453,8 @@ enum crash_obj_type {
CRASH_BUS,
 };
 
-static int
-save_crash_message(struct controlvm_message *msg, enum crash_obj_type cr_type)
+static int save_crash_message(struct controlvm_message *msg,
+ enum crash_obj_type cr_type)
 {
u32 local_crash_msg_offset;
u16 local_crash_msg_count;
@@ -522,10 +518,9 @@ save_crash_message(struct controlvm_message *msg, enum 
crash_obj_type cr_type)
return 0;
 }
 
-static int
-controlvm_responder(enum controlvm_id cmd_id,
-   struct controlvm_message_header *pending_msg_hdr,
-   int response)
+static int controlvm_responder(enum controlvm_id cmd_id,
+  struct controlvm_message_header *pending_msg_hdr,
+  int response)
 {
if (!pending_msg_hdr)
return -EIO;
@@ -536,10 +531,10 @@ controlvm_responder(enum controlvm_id cmd_id,
return controlvm_respond(pending_msg_hdr, response, NULL);
 }
 
-static int
-device_changestate_responder(enum controlvm_id cmd_id,
-struct visor_device *p, int response,
-struct visor_segment_state response_state)
+static int device_changestate_responder(
+   enum controlvm_id cmd_id,
+   struct visor_device *p, int response,
+   struct visor_segment_state response_state)
 {
  

[PATCH 10/45] staging: unisys: visorbus: Remove unnecessary comments

2017-08-01 Thread David Kershner
From: David Binder 

Removes comments that do not provide any valuable information.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 5979b63..d07eb9d 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -49,18 +49,7 @@ struct parser_context {
char data[0];
 };
 
-/*
- * VMCALL_CONTROLVM_ADDR: Used by all guests, not just IO.
- *
- * Note: When a new VMCALL is added:
- * - The 1st 2 hex digits correspond to one of the VMCALL_MONITOR_INTERFACE
- *   types.
- * - The next 2 hex digits are the nth relative instance of within a type.
- * E.G. for VMCALL_VIRTPART_RECYCLE_PART,
- * - The 0x02 identifies it as a VMCALL_VIRTPART type.
- * - The 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART type of
- *   VMCALL.
- */
+/* VMCALL_CONTROLVM_ADDR: Used by all guests, not just IO. */
 #define VMCALL_CONTROLVM_ADDR 0x0501
 
 enum vmcall_result {
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/45] staging: unisys: visorbus: Merge vmcallinterface.h into visorchipset.c

2017-08-01 Thread David Kershner
From: David Binder 

The contents of vmcallinterface.h are better placed within
visorchipset.c from an organizational perspective. The values are only
used in that file.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c| 42 ++-
 drivers/staging/unisys/visorbus/vmcallinterface.h | 61 +
 2 files changed, 41 insertions(+), 62 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorbus/vmcallinterface.h

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index a3c8552..5979b63 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -20,7 +20,6 @@
 
 #include "visorbus.h"
 #include "visorbus_private.h"
-#include "vmcallinterface.h"
 
 #define POLLJIFFIES_CONTROLVMCHANNEL_FAST 1
 #define POLLJIFFIES_CONTROLVMCHANNEL_SLOW 100
@@ -50,6 +49,47 @@ struct parser_context {
char data[0];
 };
 
+/*
+ * VMCALL_CONTROLVM_ADDR: Used by all guests, not just IO.
+ *
+ * Note: When a new VMCALL is added:
+ * - The 1st 2 hex digits correspond to one of the VMCALL_MONITOR_INTERFACE
+ *   types.
+ * - The next 2 hex digits are the nth relative instance of within a type.
+ * E.G. for VMCALL_VIRTPART_RECYCLE_PART,
+ * - The 0x02 identifies it as a VMCALL_VIRTPART type.
+ * - The 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART type of
+ *   VMCALL.
+ */
+#define VMCALL_CONTROLVM_ADDR 0x0501
+
+enum vmcall_result {
+   VMCALL_RESULT_SUCCESS = 0,
+   VMCALL_RESULT_INVALID_PARAM = 1,
+   VMCALL_RESULT_DATA_UNAVAILABLE = 2,
+   VMCALL_RESULT_FAILURE_UNAVAILABLE = 3,
+   VMCALL_RESULT_DEVICE_ERROR = 4,
+   VMCALL_RESULT_DEVICE_NOT_READY = 5
+};
+
+/*
+ * struct vmcall_io_controlvm_addr_params - Structure for IO VMCALLS. Has
+ * parameters to VMCALL_CONTROLVM_ADDR
+ * interface.
+ * @address:  The Guest-relative physical address of the ControlVm channel.
+ *This VMCall fills this in with the appropriate address.
+ *Contents provided by this VMCALL (OUT).
+ * @channel_bytes: The size of the ControlVm channel in bytes This VMCall fills
+ *this in with the appropriate address. Contents provided by
+ *this VMCALL (OUT).
+ * @unused:   Unused Bytes in the 64-Bit Aligned Struct.
+ */
+struct vmcall_io_controlvm_addr_params {
+   u64 address;
+   u32 channel_bytes;
+   u8 unused[4];
+} __packed;
+
 struct vmcall_controlvm_addr {
struct vmcall_io_controlvm_addr_params params;
int err;
diff --git a/drivers/staging/unisys/visorbus/vmcallinterface.h 
b/drivers/staging/unisys/visorbus/vmcallinterface.h
deleted file mode 100644
index 541911b..000
--- a/drivers/staging/unisys/visorbus/vmcallinterface.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2010 - 2015 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#ifndef __VMCALLINTERFACE_H__
-#define __VMCALLINTERFACE_H__
-
-/*
- * VMCALL_CONTROLVM_ADDR: Used by all guests, not just IO.
- *
- * Note: When a new VMCALL is added:
- * - The 1st 2 hex digits correspond to one of the VMCALL_MONITOR_INTERFACE
- *   types.
- * - The next 2 hex digits are the nth relative instance of within a type.
- * E.G. for VMCALL_VIRTPART_RECYCLE_PART,
- * - The 0x02 identifies it as a VMCALL_VIRTPART type.
- * - The 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART type of
- *   VMCALL.
- */
-#define VMCALL_CONTROLVM_ADDR 0x0501
-
-enum vmcall_result {
-   VMCALL_RESULT_SUCCESS = 0,
-   VMCALL_RESULT_INVALID_PARAM = 1,
-   VMCALL_RESULT_DATA_UNAVAILABLE = 2,
-   VMCALL_RESULT_FAILURE_UNAVAILABLE = 3,
-   VMCALL_RESULT_DEVICE_ERROR = 4,
-   VMCALL_RESULT_DEVICE_NOT_READY = 5
-};
-
-/*
- * struct vmcall_io_controlvm_addr_params - Structure for IO VMCALLS. Has
- * parameters to VMCALL_CONTROLVM_ADDR
- * interface.
- * @address:  The Guest-relative physical address of the ControlVm channel.
- *This VMCall fills this in with the appropriate address.
- *Contents provided by this VMCALL (OUT).
- * @channel_bytes: The size of the ControlVm channel in bytes This VMCall fills
- *this in with the appropriate addres

[PATCH 16/45] staging: unisys: include: iochannel.h: Update comments for #defines

2017-08-01 Thread David Kershner
Cleaned up some #defines to make the beginning of the file read easier.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/iochannel.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index b4f8a3e..7ccf86c 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -46,12 +46,12 @@
  * IO Partition is defined below.
  */
 
-/* Define the two queues per data channel between iopart and ioguestparts. */
-
-/* Used by ioguestpart to 'insert' signals to iopart. */
+/*
+ * Define the two queues per data channel between iopart and ioguestparts.
+ * IOCHAN_TO_IOPART -- used by guest to 'insert' signals to iopart.
+ * IOCHAN_FROM_IOPART -- used by guest to 'remove' signals from IO part.
+ */
 #define IOCHAN_TO_IOPART 0
-
-/* Used by ioguestpart to 'remove' signals from iopart, same previous queue. */
 #define IOCHAN_FROM_IOPART 1
 
 /* Size of cdb - i.e., SCSI cmnd */
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/45] staging: unisys: use the kernel min define

2017-08-01 Thread David Kershner
The kernel already provides a min function, we should be using that
instead of creating our own MINNUM.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/iochannel.h  | 3 ---
 drivers/staging/unisys/visornic/visornic_main.c | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 9e4fcce..b4f8a3e 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -46,9 +46,6 @@
  * IO Partition is defined below.
  */
 
-/* Defines and enums. */
-#define MINNUM(a, b) (((a) < (b)) ? (a) : (b))
-
 /* Define the two queues per data channel between iopart and ioguestparts. */
 
 /* Used by ioguestpart to 'insert' signals to iopart. */
diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 16907a6..fe3f72e 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -221,7 +221,7 @@ static u16 add_physinfo_entries(u64 inp_pfn, u16 inp_off, 
u32 inp_len,
} else {
pi_arr[index + i].pi_off = 0;
pi_arr[index + i].pi_len =
-   (u16)MINNUM(len, (u32)PI_PAGE_SIZE);
+   (u16)min_t(u32, len, (u32)PI_PAGE_SIZE);
}
}
return index + i;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/45] staging: unisys: visorbus: merging the visorbus_device_pause_response and visorbus_device_resume_response functions into one.

2017-08-01 Thread David Kershner
From: Sameer Wadgaonkar 

The functions viosrbus_device_pause_response() and
viosrbus_device_resume_response() are functionally similar.
Merging these functions into a single function called
visorbus_device_changestate_response().

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c|  6 +++--
 drivers/staging/unisys/visorbus/visorbus_private.h |  4 +--
 drivers/staging/unisys/visorbus/visorchipset.c | 19 +++
 3 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index f6e539a..79a394d 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1170,7 +1170,8 @@ static void pause_state_change_complete(struct 
visor_device *dev, int status)
return;
 
dev->pausing = false;
-   visorbus_device_pause_response(dev, status);
+   visorbus_device_changestate_response(dev, status,
+segment_state_standby);
 }
 
 /*
@@ -1194,7 +1195,8 @@ static void resume_state_change_complete(struct 
visor_device *dev, int status)
 * which will presumably want to send some sort of response to
 * the initiator.
 */
-   visorbus_device_resume_response(dev, status);
+   visorbus_device_changestate_response(dev, status,
+segment_state_running);
 }
 
 /*
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 67adc60..ef4a987 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -30,8 +30,8 @@ int visorchipset_device_pause(struct visor_device *dev_info);
 int visorchipset_device_resume(struct visor_device *dev_info);
 
 void visorbus_response(struct visor_device *p, int response, int controlvm_id);
-void visorbus_device_resume_response(struct visor_device *p, int response);
-void visorbus_device_pause_response(struct visor_device *p, int response);
+void visorbus_device_changestate_response(struct visor_device *p, int response,
+ struct visor_segment_state state);
 
 int visorbus_init(void);
 void visorbus_exit(void);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index ea5c5dc..3295c8d 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1450,23 +1450,12 @@ void visorbus_response(struct visor_device *bus_info, 
int response,
bus_info->pending_msg_hdr = NULL;
 }
 
-void visorbus_device_pause_response(struct visor_device *dev_info,
-   int response)
-{
-   device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
-dev_info, response,
-segment_state_standby);
-
-   kfree(dev_info->pending_msg_hdr);
-   dev_info->pending_msg_hdr = NULL;
-}
-
-void visorbus_device_resume_response(struct visor_device *dev_info,
-int response)
+void visorbus_device_changestate_response(struct visor_device *dev_info,
+ int response,
+ struct visor_segment_state state)
 {
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
-dev_info, response,
-segment_state_running);
+dev_info, response, state);
 
kfree(dev_info->pending_msg_hdr);
dev_info->pending_msg_hdr = NULL;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/45] staging: unisys: include: Remove unused #define MAXNUM

2017-08-01 Thread David Kershner
The MAXNUM #define was not being used, and it shouldn't be used.
Remove it.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/iochannel.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index a52e1ce..9e4fcce 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -48,7 +48,6 @@
 
 /* Defines and enums. */
 #define MINNUM(a, b) (((a) < (b)) ? (a) : (b))
-#define MAXNUM(a, b) (((a) > (b)) ? (a) : (b))
 
 /* Define the two queues per data channel between iopart and ioguestparts. */
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/45] staging: unisys: include: Remove unused vdiskmgmt commands

2017-08-01 Thread David Kershner
The vdisk task management commands are no longer used by s-Par, this
patch removes the definitions for them.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/iochannel.h | 32 +---
 1 file changed, 32 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 7ccf86c..01af17c 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -495,36 +495,6 @@ struct uiscmdrsp_disknotify {
u32 channel, id, lun;
 } __packed;
 
-/*
- * struct uiscmdrsp_vdiskmgmt - The following is used by virthba/vSCSI to send
- * the Acquire/Release commands to the IOVM.
- * @enum vdisktype: The type of task.
- * @struct vdest:   The vdisk for which this task mgmt is generated.
- * @handle: This is a handle that the guest has saved off for its
- *  own use. It's value is preserved by iopart and returned
- *  as in the task mgmt rsp.
- * @notify_handle:  For Linux guests, this is a pointer to wait_queue_head
- *  that a thread is waiting on to see if the tskmgmt
- *  command has completed. When the rsp is received by
- *  guest, the thread receiving the response uses this to
- *  notify the thread waiting for taskmgmt command
- *  completion. It's value is preserved by iopart and
- *  returned as in the task mgmt rsp.
- * @notifyresult_handle: Handle to the location in guest where the result of 
the
- *  taskmgmt command (result field) is saved to when the
- *  response is handled. It's value is preserved by iopart
- *  and returned as in the task mgmt rsp.
- * @result: Result of taskmgmt command - set by IOPart.
- */
-struct uiscmdrsp_vdiskmgmt {
-   enum vdisk_mgmt_types vdisktype;
-   struct uisscsi_dest vdest;
-   u64 handle;
-   u64 notify_handle;
-   u64 notifyresult_handle;
-   char result;
-} __packed;
-
 /* Keeping cmd and rsp info in one structure for now cmd rsp packet for SCSI */
 struct uiscmdrsp {
char cmdtype;
@@ -533,13 +503,11 @@ struct uiscmdrsp {
 #define CMD_NET_TYPE 2
 #define CMD_SCSITASKMGMT_TYPE 3
 #define CMD_NOTIFYGUEST_TYPE  4
-#define CMD_VDISKMGMT_TYPE5
union {
struct uiscmdrsp_scsi scsi;
struct uiscmdrsp_net net;
struct uiscmdrsp_scsitaskmgmt scsitaskmgmt;
struct uiscmdrsp_disknotify disknotify;
-   struct uiscmdrsp_vdiskmgmt vdiskmgmt;
};
/* Send the response when the cmd is done (scsi and scsittaskmgmt). */
void *private_data;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 23/45] staging: unisys: visorbus: fix include dependency

2017-08-01 Thread David Kershner
Due to include order, the visorbus_private.h file was missing a required
include header visorbus.h. If visorchipset.c or visorbus_main.c ever were
to change the order of the includes for visobus.h and visorbus_private.h,
the code would fail to compile.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_private.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index ef4a987..64b373c 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -21,6 +21,7 @@
 
 #include "controlvmchannel.h"
 #include "vbuschannel.h"
+#include "visorbus.h"
 
 int visorchipset_bus_create(struct visor_device *bus_info);
 void visorchipset_bus_destroy(struct visor_device *bus_info);
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/45] staging: unisys: visorbus: Update comment style vbuschannel.h

2017-08-01 Thread David Kershner
From: Mark Foresta 

Moved blocked comment on to own line at beginning of struct to follow
standard. Since this is an internal structure, the block comment isn't
actually a kernel-doc so we only start the block with one asterisk.

Signed-off-by: Mark Foresta 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/vbuschannel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h 
b/drivers/staging/unisys/visorbus/vbuschannel.h
index 2c820e2..f374e72 100644
--- a/drivers/staging/unisys/visorbus/vbuschannel.h
+++ b/drivers/staging/unisys/visorbus/vbuschannel.h
@@ -45,7 +45,8 @@
 
 static const uuid_le visor_vbus_channel_uuid = VISOR_VBUS_CHANNEL_UUID;
 
-/* struct visor_vbus_deviceinfo
+/*
+ * struct visor_vbus_deviceinfo
  * @devtype:  Short string identifying the device type.
  * @drvname:  Driver .sys file name.
  * @infostrs: Kernel vversion.
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 25/45] staging: unisys: include: iochannel needs to include skbuff

2017-08-01 Thread David Kershner
The iochannel.h header file references ETH_HLEN which is defined in
skbuff. Removed it from visorhba since it was no longer needed.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/iochannel.h  | 1 +
 drivers/staging/unisys/visorhba/visorhba_main.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 01af17c..c35d092 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -28,6 +28,7 @@
  */
 
 #include 
+#include 
 
 #include "channel.h"
 
diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index 0eaefbd..fc1d441 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -14,7 +14,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 28/45] staging: unisys: Move VNIC GUID to visornic

2017-08-01 Thread David Kershner
Instead of including it in the global channel.h, move the VNIC GUID to the
visornic module.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/channel.h| 7 ---
 drivers/staging/unisys/visornic/visornic_main.c | 8 
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index adfb0c8..2d6389f 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -191,13 +191,6 @@ struct signal_queue_header {
 static const uuid_le visor_vhba_channel_uuid = VISOR_VHBA_CHANNEL_UUID;
 #define VISOR_VHBA_CHANNEL_UUID_STR \
"414815ed-c58c-11da-95a9-00e08161165f"
-/* {8cd5994d-c58e-11da-95a9-00e08161165f} */
-#define VISOR_VNIC_CHANNEL_UUID \
-   UUID_LE(0x8cd5994d, 0xc58e, 0x11da, \
-   0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
-static const uuid_le visor_vnic_channel_uuid = VISOR_VNIC_CHANNEL_UUID;
-#define VISOR_VNIC_CHANNEL_UUID_STR \
-   "8cd5994d-c58e-11da-95a9-00e08161165f"
 /* {72120008-4AAB-11DC-8530-444553544200} */
 #define VISOR_SIOVM_UUID \
UUID_LE(0x72120008, 0x4AAB, 0x11DC, \
diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index fe3f72e..5bb991f 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -37,6 +37,14 @@
 #define NAPI_WEIGHT 64
 
 /* GUIDS for director channel type supported by this driver.  */
+/* {8cd5994d-c58e-11da-95a9-00e08161165f} */
+#define VISOR_VNIC_CHANNEL_UUID \
+   UUID_LE(0x8cd5994d, 0xc58e, 0x11da, \
+   0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
+static const uuid_le visor_vnic_channel_uuid = VISOR_VNIC_CHANNEL_UUID;
+#define VISOR_VNIC_CHANNEL_UUID_STR \
+   "8cd5994d-c58e-11da-95a9-00e08161165f"
+
 static struct visor_channeltype_descriptor visornic_channel_types[] = {
/* Note that the only channel type we expect to be reported by the
 * bus driver is the VISOR_VNIC channel.
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/45] staging: unisys: visorbus: remove filename from beginning of file

2017-08-01 Thread David Kershner
From: Zohaib Javed 

The filename was in a comment at the beginning of the file. It is not
needed.

Signed-off-by: Zohaib Javed 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 6d4498f..c8a5cb2 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1,5 +1,4 @@
-/* visorchipset_main.c
- *
+/*
  * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/45] staging: unisys: visornic: visornic_main.c: fix multiline dereference.

2017-08-01 Thread David Kershner
From: Sameer Wadgaonkar 

This patch fixes two checkpatch warnings in the visornic_main.c
file to avoid multiline dereference.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visornic/visornic_main.c |  9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 90d9d03..16907a6 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -288,11 +288,10 @@ static int visor_copy_fragsinfo_from_skb(struct sk_buff 
*skb,
 
for (frag = 0; frag < numfrags; frag++) {
count = add_physinfo_entries(page_to_pfn(
-   skb_frag_page(&skb_shinfo(skb)->frags[frag])),
- skb_shinfo(skb)->frags[frag].
- page_offset,
- skb_shinfo(skb)->frags[frag].
- size, count, frags_max, frags);
+ skb_frag_page(&skb_shinfo(skb)->frags[frag])),
+ skb_shinfo(skb)->frags[frag].page_offset,
+ skb_shinfo(skb)->frags[frag].size, count,
+ frags_max, frags);
/* add_physinfo_entries only returns
 * zero if the frags array is out of room
 * That should never happen because we
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 24/45] staging: unisys: visorbus: Remove unnecessary includes for visorchipset.c

2017-08-01 Thread David Kershner
Visorchipset.c was including unnecessary include files, either included by
other headers or not needed at all.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 3295c8d..0e9e529 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -14,8 +14,6 @@
  */
 
 #include 
-#include 
-#include 
 #include 
 
 #include "visorbus.h"
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/45] staging: unisys: visornic: update the struct viosrnic_devdata comments

2017-08-01 Thread David Kershner
From: Sameer Wadgaonkar 

Cleaned up the in-line comments in the structure and added a single block
comment for the structure.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visornic/visornic_main.c | 86 --
 1 file changed, 61 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 0b39676..90d9d03 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -68,10 +68,68 @@ struct chanstat {
unsigned long extra_rcvbufs_sent;
 };
 
+/* struct visornic_devdata
+ *
+ * @enabled:0 disabled 1 enabled to receive.
+ * @enab_dis_acked: NET_RCV_ENABLE/DISABLE acked by IOPART.
+ * @struct *dev:
+ * @struct *netdev:
+ * @struct net_stats:
+ * @interrupt_rcvd:
+ * @rsp_queue:
+ * @struct **rcvbuf:
+ * @incarnation_id: incarnation_id lets IOPART know about
+ *  re-birth.
+ * @old_flags:  flags as they were prior to
+ *  set_multicast_list.
+ * @usage:  count of users.
+ * @num_rcv_bufs:   number of rcv buffers the vnic will post.
+ * @num_rcv_bufs_could_not_alloc:
+ * @num_rcvbuf_in_iovm:
+ * @alloc_failed_in_if_needed_cnt:
+ * @alloc_failed_in_repost_rtn_cnt:
+ * @max_outstanding_net_xmits:  absolute max number of outstanding xmits
+ *  - should never hit this.
+ * @upper_threshold_net_xmits:  high water mark for calling
+ *  netif_stop_queue().
+ * @lower_threshold_net_xmits:  high water mark for calling
+ *  netif_wake_queue().
+ * @struct xmitbufhead: xmitbufhead - head of the xmit buffer list
+ *  sent to the IOPART end.
+ * @server_down_complete_func:
+ * @struct timeout_reset:
+ * @struct *cmdrsp_rcv: cmdrsp_rcv is used for posting/unposting 
rcv
+ *  buffers.
+ * @struct *xmit_cmdrsp:xmit_cmdrsp - issues NET_XMIT - only one
+ *  active xmit at a time.
+ * @server_down:IOPART is down.
+ * @server_change_state:Processing SERVER_CHANGESTATE msg.
+ * @going_away: device is being torn down.
+ * @struct *eth_debugfs_dir:
+ * @interrupts_rcvd:
+ * @interrupts_notme:
+ * @interrupts_disabled:
+ * @busy_cnt:
+ * @priv_lock:  spinlock to access devdata structures.
+ * @flow_control_upper_hits:
+ * @flow_control_lower_hits:
+ * @n_rcv0: # rcvs of 0 buffers.
+ * @n_rcv1: # rcvs of 1 buffers.
+ * @n_rcv2: # rcvs of 2 buffers.
+ * @n_rcvx: # rcvs of >2 buffers.
+ * @found_repost_rcvbuf_cnt:# repost_rcvbuf_cnt.
+ * @repost_found_skb_cnt:   # of found the skb.
+ * @n_repost_deficit:   # of lost rcv buffers.
+ * @bad_rcv_buf:# of unknown rcv skb not freed.
+ * @n_rcv_packets_not_accepted: # bogs rcv packets.
+ * @queuefullmsg_logged:
+ * @struct chstat:
+ * @struct irq_poll_timer:
+ * @struct napi:
+ * @struct cmdrsp:
+ */
 struct visornic_devdata {
-   /* 0 disabled 1 enabled to receive */
unsigned short enabled;
-   /* NET_RCV_ENABLE/DISABLE acked by IOPART */
unsigned short enab_dis_acked;
 
struct visor_device *dev;
@@ -80,47 +138,34 @@ struct visornic_devdata {
atomic_t interrupt_rcvd;
wait_queue_head_t rsp_queue;
struct sk_buff **rcvbuf;
-   /* incarnation_id lets IOPART know about re-birth */
u64 incarnation_id;
-   /* flags as they were prior to set_multicast_list */
unsigned short old_flags;
-   /* count of users */
atomic_t usage;
 
-   /* number of rcv buffers the vnic will post */
int num_rcv_bufs;
int num_rcv_bufs_could_not_alloc;
atomic_t num_rcvbuf_in_iovm;
unsigned long alloc_failed_in_if_needed_cnt;
unsigned long alloc_failed_in_repost_rtn_cnt;
 
-   /* absolute max number of outstanding xmits - should never hit this */
unsigned long max_outstanding_net_xmits;
-   /* high water mark for calling netif_stop_queue() */
unsigned long upper_threshold_net_xmits;
-   /* high water mark for calling netif_wake_queue() */
unsigned long lower_threshold_net_xmits;
-   /* xmitbufhead - head of the xmit buffer list sent to the IOPART end */
struct sk_buff_head xmitbufhead;
 
visorbus_state_complete_func server_down_complete_func;
struct work_struct timeout_reset;
-   /* cmdrsp_rcv is used for posting/unposting rcv buffers  */
   

[PATCH 05/45] staging: unisys: visorbus: visorbus_private.h remove filename

2017-08-01 Thread David Kershner
From: Mark Foresta 

Remove the filename in the comment at the beginning of the file.

Signed-off-by: Mark Foresta 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_private.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 7ccf756..2fe5b93 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -1,5 +1,4 @@
-/* visorbus_private.h
- *
+/*
  * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/45] staging: unisys: visorbus: merging the visorbus_*_response functions into one.

2017-08-01 Thread David Kershner
From: Sameer Wadgaonkar 

The functions visorbus_create_response(), visorbus_destroy_response(),
viosrbus_device_create_response(), viosrbus_device_destroy_response()
are all functionally similar. Merging these four functions into a
single function called visorbus_response().

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c| 10 ++--
 drivers/staging/unisys/visorbus/visorbus_private.h |  5 +--
 drivers/staging/unisys/visorbus/visorchipset.c | 41 +--
 3 files changed, 10 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index ff80ab2..f6e539a 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1123,7 +1123,8 @@ int visorchipset_bus_create(struct visor_device *dev)
if (err < 0)
return err;
 
-   visorbus_create_response(dev, err);
+   visorbus_response(dev, err, CONTROLVM_BUS_CREATE);
+   dev->state.created = 1;
 
return 0;
 }
@@ -1131,7 +1132,7 @@ int visorchipset_bus_create(struct visor_device *dev)
 void visorchipset_bus_destroy(struct visor_device *dev)
 {
visorbus_remove_instance(dev);
-   visorbus_destroy_response(dev, 0);
+   visorbus_response(dev, 0, CONTROLVM_BUS_DESTROY);
 }
 
 int visorchipset_device_create(struct visor_device *dev_info)
@@ -1142,7 +1143,8 @@ int visorchipset_device_create(struct visor_device 
*dev_info)
if (err < 0)
return err;
 
-   visorbus_device_create_response(dev_info, err);
+   visorbus_response(dev_info, err, CONTROLVM_DEVICE_CREATE);
+   dev_info->state.created = 1;
 
return 0;
 }
@@ -1150,7 +1152,7 @@ int visorchipset_device_create(struct visor_device 
*dev_info)
 void visorchipset_device_destroy(struct visor_device *dev_info)
 {
remove_visor_device(dev_info);
-   visorbus_device_destroy_response(dev_info, 0);
+   visorbus_response(dev_info, 0, CONTROLVM_DEVICE_DESTROY);
 }
 
 /*
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 2fe5b93..67adc60 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -29,10 +29,7 @@ void visorchipset_device_destroy(struct visor_device 
*dev_info);
 int visorchipset_device_pause(struct visor_device *dev_info);
 int visorchipset_device_resume(struct visor_device *dev_info);
 
-void visorbus_create_response(struct visor_device *p, int response);
-void visorbus_destroy_response(struct visor_device *p, int response);
-void visorbus_device_create_response(struct visor_device *p, int response);
-void visorbus_device_destroy_response(struct visor_device *p, int response);
+void visorbus_response(struct visor_device *p, int response, int controlvm_id);
 void visorbus_device_resume_response(struct visor_device *p, int response);
 void visorbus_device_pause_response(struct visor_device *p, int response);
 
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index d07eb9d..ea5c5dc 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1441,50 +1441,15 @@ static void setup_crash_devices_work_queue(struct 
work_struct *work)
visorbus_device_create(&local_crash_dev_msg);
 }
 
-void visorbus_create_response(struct visor_device *bus_info, int response)
+void visorbus_response(struct visor_device *bus_info, int response,
+  int controlvm_id)
 {
-   if (response >= 0)
-   bus_info->state.created = 1;
-
-   controlvm_responder(CONTROLVM_BUS_CREATE, bus_info->pending_msg_hdr,
-   response);
+   controlvm_responder(controlvm_id, bus_info->pending_msg_hdr, response);
 
kfree(bus_info->pending_msg_hdr);
bus_info->pending_msg_hdr = NULL;
 }
 
-void visorbus_destroy_response(struct visor_device *bus_info, int response)
-{
-   controlvm_responder(CONTROLVM_BUS_DESTROY, bus_info->pending_msg_hdr,
-   response);
-
-   kfree(bus_info->pending_msg_hdr);
-   bus_info->pending_msg_hdr = NULL;
-}
-
-void visorbus_device_create_response(struct visor_device *dev_info,
-int response)
-{
-   if (response >= 0)
-   dev_info->state.created = 1;
-
-   controlvm_responder(CONTROLVM_DEVICE_CREATE, dev_info->pending_msg_hdr,
-   response);
-
-   kfree(dev_info->pending_msg_hdr);
-   dev_info->pending_msg_hdr = NULL;
-}
-
-void visorbus_device_destroy_response(struct visor_device *dev_info,
- int response)
-{
-   controlvm_responder(CONTROLVM_DEVICE_DESTROY, dev_info->pending_msg_hdr,
- 

[PATCH 21/45] staging: unisys: include: Remove unnecessary forward declaration

2017-08-01 Thread David Kershner
The struct visor_device had a forward declaration that was not needed.
Remove it.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/visorbus.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index 352d102..f256d5c 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -39,7 +39,6 @@
 
 #include "channel.h"
 
-struct visor_driver;
 struct visor_device;
 extern struct bus_type visorbus_type;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 32/45] staging: unisys: reference bus_no and dev_no directly

2017-08-01 Thread David Kershner
Don't store it in a local variable but reference it from the
visor_device.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 962fd97..6d8d6b2 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -562,8 +562,6 @@ static int device_changestate_responder(
struct visor_segment_state response_state)
 {
struct controlvm_message outmsg;
-   u32 bus_no = p->chipset_bus_no;
-   u32 dev_no = p->chipset_dev_no;
 
if (!p->pending_msg_hdr)
return -EIO;
@@ -572,8 +570,8 @@ static int device_changestate_responder(
 
controlvm_init_response(&outmsg, p->pending_msg_hdr, response);
 
-   outmsg.cmd.device_change_state.bus_no = bus_no;
-   outmsg.cmd.device_change_state.dev_no = dev_no;
+   outmsg.cmd.device_change_state.bus_no = p->chipset_bus_no;
+   outmsg.cmd.device_change_state.dev_no = p->chipset_dev_no;
outmsg.cmd.device_change_state.state = response_state;
 
return visorchannel_signalinsert(chipset_dev->controlvm_channel,
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 26/45] staging: unisys: visorinput: Get rid of unused includes

2017-08-01 Thread David Kershner
Cleanups caused us to not need to include a bunch of headers, got rid of
them.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorinput/visorinput.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/unisys/visorinput/visorinput.c 
b/drivers/staging/unisys/visorinput/visorinput.c
index 65060e9..a27a8f5 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -21,11 +21,8 @@
  * standard way the Linux expects for input drivers.
  */
 
-#include 
 #include 
-#include 
 #include 
-#include 
 #include 
 #include 
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/45] staging: unisys: include: fix improper use of dma_data_direction

2017-08-01 Thread David Kershner
From: Steven Matthews 

Replace use of standard Linux dma_data_direction with a Unisys-
specific uis_dma_data_direction and provide a function to convert
from the latter to the former.  This is necessary because Unisys
s-Par depends on the exact format of this field in multiple OSs
and languages, and so using the standard version creates an
unnecessary dependency between the kernel and s-Par.

Signed-off-by: Steven Matthews 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/iochannel.h  | 15 --
 drivers/staging/unisys/visorhba/visorhba_main.c | 26 +-
 2 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 40eb7d5..a52e1ce 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -28,7 +28,7 @@
  */
 
 #include 
-#include 
+
 #include "channel.h"
 
 /*
@@ -60,6 +60,15 @@
 
 /* Size of cdb - i.e., SCSI cmnd */
 #define MAX_CMND_SIZE 16
+
+/* Unisys-specific DMA direction values */
+enum uis_dma_data_direction {
+   UIS_DMA_BIDIRECTIONAL = 0,
+   UIS_DMA_TO_DEVICE = 1,
+   UIS_DMA_FROM_DEVICE = 2,
+   UIS_DMA_NONE = 3
+};
+
 #define MAX_SENSE_SIZE 64
 #define MAX_PHYS_INFO 64
 
@@ -182,7 +191,7 @@ struct vhba_config_max {
  * @bufflen:   Length of data to be transferred out or in.
  * @guest_phys_entries:Number of entries in scatter-gather list.
  * @struct gpi_list:   Physical address information for each fragment.
- * @enum data_dir: Direction of the data, if any.
+ * @data_dir:  Direction of the data, if any.
  * @struct vdest:  Identifies the virtual hba, id, channel, lun to which
  * cmd was sent.
  * @linuxstat: Original Linux status used by Linux vdisk.
@@ -205,7 +214,7 @@ struct uiscmdrsp_scsi {
u32 bufflen;
u16 guest_phys_entries;
struct guest_phys_info gpi_list[MAX_PHYS_INFO];
-   enum dma_data_direction data_dir;
+   u32 data_dir;
struct uisscsi_dest vdest;
/* Needed to queue the rsp back to cmd originator. */
int linuxstat;
diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index 178d022..0eaefbd 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -478,6 +478,29 @@ static const char *visorhba_get_info(struct Scsi_Host *shp)
 }
 
 /*
+ * dma_data_dir_linux_to_spar - convert dma_data_direction value to
+ * Unisys-specific equivalent
+ * @d: dma direction value to convert
+ *
+ * Returns the Unisys-specific dma direction value corresponding to @d
+ */
+static u32 dma_data_dir_linux_to_spar(enum dma_data_direction d)
+{
+   switch (d) {
+   case DMA_BIDIRECTIONAL:
+   return UIS_DMA_BIDIRECTIONAL;
+   case DMA_TO_DEVICE:
+   return UIS_DMA_TO_DEVICE;
+   case DMA_FROM_DEVICE:
+   return UIS_DMA_FROM_DEVICE;
+   case DMA_NONE:
+   return UIS_DMA_NONE;
+   default:
+   return UIS_DMA_NONE;
+   }
+}
+
+/*
  * visorhba_queue_command_lck - Queues command to the Service Partition
  * @scsicmd:   Command to be queued
  * @vsiorhba_cmnd_done: Done command to call when scsicmd is returned
@@ -525,7 +548,8 @@ static int visorhba_queue_command_lck(struct scsi_cmnd 
*scsicmd,
cmdrsp->scsi.vdest.id = scsidev->id;
cmdrsp->scsi.vdest.lun = scsidev->lun;
/* save datadir */
-   cmdrsp->scsi.data_dir = scsicmd->sc_data_direction;
+   cmdrsp->scsi.data_dir =
+   dma_data_dir_linux_to_spar(scsicmd->sc_data_direction);
memcpy(cmdrsp->scsi.cmnd, cdb, MAX_CMND_SIZE);
cmdrsp->scsi.bufflen = scsi_bufflen(scsicmd);
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 36/45] staging: unisys: visorbus: visorchannel.c: Remove filename in top comment

2017-08-01 Thread David Kershner
From: David Binder 

Removes unnecessary filename in the top file comment.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index c7eea65..5d43a68 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -1,5 +1,4 @@
-/* visorchannel_funcs.c
- *
+/*
  * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 18/45] staging: unisys: include: Remove unused throttling defines.

2017-08-01 Thread David Kershner
We no longer send messages directly to the s-Par event log, so we do not
need the throttling defines anymore.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/channel.h | 17 -
 1 file changed, 17 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index d6d99cc..5ff34bb 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -58,23 +58,6 @@ enum channel_clientstate {
CHANNELCLI_OWNED = 5
 };
 
-/* Values for VISORA_CHANNEL_PROTOCOL.CliErrorBoot: */
-
-/*
- * Throttling invalid boot channel statetransition error due to client
- * disabled.
- */
-#define VISOR_CLIERRORBOOT_THROTTLEMSG_DISABLED 0x01
-
-/*
- * Throttling invalid boot channel statetransition error due to client
- * not attached.
- */
-#define VISOR_CLIERRORBOOT_THROTTLEMSG_NOTATTACHED 0x02
-
-/* Throttling invalid boot channel statetransition error due to busy channel */
-#define VISOR_CLIERRORBOOT_THROTTLEMSG_BUSY 0x04
-
 /*
  * Values for VISOR_CHANNEL_PROTOCOL.Features: This define exists so that
  * windows guest can look at the FeatureFlags in the io channel, and configure
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 22/45] staging: unisys: include: Remove unneeded includes from visorbus.h

2017-08-01 Thread David Kershner
A bunch of code churn has caused the following include files to not be
needed by visorbus.h:

linux/poll.h
linux/kernel.h
linux/uuid.h
linux/seq_file.h

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/visorbus.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index f256d5c..e3b9d14 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -31,10 +31,6 @@
 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
 #include 
 
 #include "channel.h"
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 38/45] staging: unisys: include: visorbus.h: Remove filename in top comment

2017-08-01 Thread David Kershner
From: David Binder 

Removes unnecessary filename in the top file comment.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/visorbus.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index e3b9d14..480edfc 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -1,6 +1,4 @@
 /*
- * visorbus.h
- *
  * Copyright (C) 2010 - 2013 UNISYS CORPORATION
  * All rights reserved.
  *
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 39/45] staging: unisys: visorhba: Adjust top comment formatting

2017-08-01 Thread David Kershner
From: David Binder 

The first line of the top file comment should begin on the line following
the block comment opening, thereby following the convention used elsewhere
in the driver set.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorhba/visorhba_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index fc1d441..294ab34 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2012 - 2015 UNISYS CORPORATION
+/*
+ * Copyright (c) 2012 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 42/45] staging: unisys: visorbus: Get rid of passthrough function visorchipset_bus_destroy

2017-08-01 Thread David Kershner
From: Sameer Wadgaonkar 

The function visorchipset_bus_destroy just called viosrbus_remove_instance,
we can just combine it with visorbus_remove_instance.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c|  9 ++---
 drivers/staging/unisys/visorbus/visorbus_private.h |  2 +-
 drivers/staging/unisys/visorbus/visorchipset.c |  4 ++--
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 39c2954..aabb0c4 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1085,7 +1085,7 @@ int visorbus_create_instance(struct visor_device *dev)
  * visorbus_remove_instance() - remove a device instance for the visorbus 
itself
  * @dev: struct visor_device indentifying the bus to remove
  */
-static void visorbus_remove_instance(struct visor_device *dev)
+void visorbus_remove_instance(struct visor_device *dev)
 {
/*
 * Note that this will result in the release method for
@@ -1099,6 +1099,7 @@ static void visorbus_remove_instance(struct visor_device 
*dev)
kfree(dev->vbus_hdr_info);
list_del(&dev->list_all);
device_unregister(&dev->device);
+   visorbus_response(dev, 0, CONTROLVM_BUS_DESTROY);
 }
 
 /*
@@ -1116,12 +1117,6 @@ static void remove_all_visor_devices(void)
}
 }
 
-void visorchipset_bus_destroy(struct visor_device *dev)
-{
-   visorbus_remove_instance(dev);
-   visorbus_response(dev, 0, CONTROLVM_BUS_DESTROY);
-}
-
 int visorchipset_device_create(struct visor_device *dev_info)
 {
int err;
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index bb91a6c..60230cb 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -24,7 +24,7 @@
 #include "visorbus.h"
 
 int visorbus_create_instance(struct visor_device *dev);
-void visorchipset_bus_destroy(struct visor_device *bus_info);
+void visorbus_remove_instance(struct visor_device *bus_info);
 int visorchipset_device_create(struct visor_device *dev_info);
 void visorchipset_device_destroy(struct visor_device *dev_info);
 int visorchipset_device_pause(struct visor_device *dev_info);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 4668daf..f875088 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -698,8 +698,8 @@ static int visorbus_destroy(struct controlvm_message *inmsg)
bus_info->pending_msg_hdr = pmsg_hdr;
}
 
-   /* Response will be handled by visorchipset_bus_destroy */
-   visorchipset_bus_destroy(bus_info);
+   /* Response will be handled by visorbus_remove_instance */
+   visorbus_remove_instance(bus_info);
return 0;
 
 err_respond:
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 45/45] staging: unisys: use ATTRIBUTE_GROUPS instead of creating our own

2017-08-01 Thread David Kershner
Greg noticed that we were creating our own attribute groups, instead of
using the ATTRIBUTE_GROUPS macro, this patch fixes our mistake.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 33 ++
 1 file changed, 5 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1d72af5..c6d421e 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -49,15 +49,7 @@ static struct attribute *visorbus_dev_attrs[] = {
NULL,
 };
 
-/* sysfs example for bridge-only sysfs files using device_type's */
-static const struct attribute_group visorbus_dev_group = {
-   .attrs = visorbus_dev_attrs,
-};
-
-static const struct attribute_group *visorbus_dev_groups[] = {
-   &visorbus_dev_group,
-   NULL,
-};
+ATTRIBUTE_GROUPS(visorbus_dev);
 
 /* filled in with info about parent chipset driver when we register with it */
 static struct visor_vbus_deviceinfo chipset_driverinfo;
@@ -292,15 +284,7 @@ static struct attribute *channel_attrs[] = {
NULL
 };
 
-static const struct attribute_group channel_attr_grp = {
-   .name = "channel",
-   .attrs = channel_attrs,
-};
-
-static const struct attribute_group *visorbus_channel_groups[] = {
-   &channel_attr_grp,
-   NULL
-};
+ATTRIBUTE_GROUPS(channel);
 
 /* end implementation of specific channel attributes */
 
@@ -379,7 +363,7 @@ static ssize_t channel_id_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(channel_id);
 
-static struct attribute *dev_attrs[] = {
+static struct attribute *visorbus_attrs[] = {
&dev_attr_partition_handle.attr,
&dev_attr_partition_guid.attr,
&dev_attr_partition_name.attr,
@@ -389,14 +373,7 @@ static struct attribute *dev_attrs[] = {
NULL
 };
 
-static const struct attribute_group dev_attr_grp = {
-   .attrs = dev_attrs,
-};
-
-static const struct attribute_group *visorbus_groups[] = {
-   &dev_attr_grp,
-   NULL
-};
+ATTRIBUTE_GROUPS(visorbus);
 
 /*
  *  BUS debugfs entries
@@ -666,7 +643,7 @@ int create_visor_device(struct visor_device *dev)
 
mutex_init(&dev->visordriver_callback_lock);
dev->device.bus = &visorbus_type;
-   dev->device.groups = visorbus_channel_groups;
+   dev->device.groups = channel_groups;
device_initialize(&dev->device);
dev->device.release = visorbus_release_device;
/* keep a reference just for us (now 2) */
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 31/45] staging: unisys: don't copy to local variable

2017-08-01 Thread David Kershner
Do the check with the values in the structure instead of copying them to
local variables.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 7047989..962fd97 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -364,11 +364,9 @@ static int match_visorbus_dev_by_id(struct device *dev, 
void *data)
 {
struct visor_device *vdev = to_visor_device(dev);
struct visor_busdev *id = data;
-   u32 bus_no = id->bus_no;
-   u32 dev_no = id->dev_no;
 
-   if ((vdev->chipset_bus_no == bus_no) &&
-   (vdev->chipset_dev_no == dev_no))
+   if ((vdev->chipset_bus_no == id->bus_no) &&
+   (vdev->chipset_dev_no == id->dev_no))
return 1;
 
return 0;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 41/45] staging: unisys: include: iochannel.h: Add proper copyright statement

2017-08-01 Thread David Kershner
From: David Binder 

Adds the proper Unisys copyright statement to the top of iochannel.h.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/iochannel.h | 18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index c35d092..97fc7ed 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -1,5 +1,19 @@
-/* Copyright (C) 2010 - 2016 UNISYS CORPORATION */
-/* All rights reserved. */
+/*
+ * Copyright (C) 2010 - 2016 UNISYS CORPORATION
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ */
+
 #ifndef __IOCHANNEL_H__
 #define __IOCHANNEL_H__
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 30/45] staging: unisys: visorbus: Remove confusing comment in controlvmchannel.

2017-08-01 Thread David Kershner
Referencing a SegmentIndex doesn't make sense in the Linux drivers, get rid
of the comment.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/controlvmchannel.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index 96ac574..257f604 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -273,7 +273,6 @@ struct controlvm_packet_device_create  {
  */
 struct controlvm_packet_device_configure  {
u32 bus_no;
-   /* Control uses header SegmentIndex field to access bus number. */
u32 dev_no;
 } __packed;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 33/45] staging: unisys: visorbus: Get rid of passthrough function visorchipset_bus_create

2017-08-01 Thread David Kershner
The function visorchipset_bus_create just called visorbus_create_instance,
we should just combine it with visorbus_create_instance.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c| 19 +++
 drivers/staging/unisys/visorbus/visorbus_private.h |  3 +--
 drivers/staging/unisys/visorbus/visorchipset.c |  5 +---
 3 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 79a394d..2c89f15 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1032,7 +1032,7 @@ EXPORT_SYMBOL_GPL(visorbus_register_visor_driver);
  * Return: 0 for success, otherwise negative errno value indicating reason for
  * failure
  */
-static int visorbus_create_instance(struct visor_device *dev)
+int visorbus_create_instance(struct visor_device *dev)
 {
int id = dev->chipset_bus_no;
int err;
@@ -1065,12 +1065,15 @@ static int visorbus_create_instance(struct visor_device 
*dev)
 
list_add_tail(&dev->list_all, &list_all_bus_instances);
 
+   dev->state.created = 1;
dev->vbus_hdr_info = (void *)hdr_info;
write_vbus_chp_info(dev->visorchannel, hdr_info,
&chipset_driverinfo);
write_vbus_bus_info(dev->visorchannel, hdr_info,
&clientbus_driverinfo);
 
+   visorbus_response(dev, err, CONTROLVM_BUS_CREATE);
+
return 0;
 
 err_debugfs_dir:
@@ -1115,20 +1118,6 @@ static void remove_all_visor_devices(void)
}
 }
 
-int visorchipset_bus_create(struct visor_device *dev)
-{
-   int err;
-
-   err = visorbus_create_instance(dev);
-   if (err < 0)
-   return err;
-
-   visorbus_response(dev, err, CONTROLVM_BUS_CREATE);
-   dev->state.created = 1;
-
-   return 0;
-}
-
 void visorchipset_bus_destroy(struct visor_device *dev)
 {
visorbus_remove_instance(dev);
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 64b373c..bb91a6c 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -23,7 +23,7 @@
 #include "vbuschannel.h"
 #include "visorbus.h"
 
-int visorchipset_bus_create(struct visor_device *bus_info);
+int visorbus_create_instance(struct visor_device *dev);
 void visorchipset_bus_destroy(struct visor_device *bus_info);
 int visorchipset_device_create(struct visor_device *dev_info);
 void visorchipset_device_destroy(struct visor_device *dev_info);
@@ -38,7 +38,6 @@ int visorbus_init(void);
 void visorbus_exit(void);
 
 /* visorchannel access functions */
-
 struct visorchannel *visorchannel_create(u64 physaddr,
 unsigned long channel_bytes,
 gfp_t gfp, uuid_le guid);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 6d8d6b2..72131ce 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -642,9 +642,8 @@ static int visorbus_create(struct controlvm_message *inmsg)
 
bus_info->visorchannel = visorchannel;
 
-   /* Response will be handled by visorchipset_bus_create */
-   err = visorchipset_bus_create(bus_info);
-   /* If visorchipset_bus_create didn't respond, need to respond here */
+   /* Response will be handled by visorbus_create_instance on success */
+   err = visorbus_create_instance(bus_info);
if (err)
goto err_destroy_channel;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 44/45] staging: unisys: visorbus: Get rid of passthrough function visorchipset_device_destroy

2017-08-01 Thread David Kershner
From: Sameer Wadgaonkar 

The function visorchipset_device_destroy just called remove_visor_device,
we can just combine it with remove_visor_device.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c|  9 ++---
 drivers/staging/unisys/visorbus/visorbus_private.h |  2 +-
 drivers/staging/unisys/visorbus/visorchipset.c |  2 +-
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 9093a25..1d72af5 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -716,11 +716,12 @@ int create_visor_device(struct visor_device *dev)
return err;
 }
 
-static void remove_visor_device(struct visor_device *dev)
+void remove_visor_device(struct visor_device *dev)
 {
list_del(&dev->list_all);
put_device(&dev->device);
device_unregister(&dev->device);
+   visorbus_response(dev, 0, CONTROLVM_DEVICE_DESTROY);
 }
 
 static int get_vbus_header_info(struct visorchannel *chan,
@@ -1119,12 +1120,6 @@ static void remove_all_visor_devices(void)
}
 }
 
-void visorchipset_device_destroy(struct visor_device *dev_info)
-{
-   remove_visor_device(dev_info);
-   visorbus_response(dev_info, 0, CONTROLVM_DEVICE_DESTROY);
-}
-
 /*
  * pause_state_change_complete() - the callback function to be called by a
  * visorbus function driver when a
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index e87e76d..dd96485 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -26,7 +26,7 @@
 int visorbus_create_instance(struct visor_device *dev);
 void visorbus_remove_instance(struct visor_device *bus_info);
 int create_visor_device(struct visor_device *dev_info);
-void visorchipset_device_destroy(struct visor_device *dev_info);
+void remove_visor_device(struct visor_device *dev_info);
 int visorchipset_device_pause(struct visor_device *dev_info);
 int visorchipset_device_resume(struct visor_device *dev_info);
 
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 756988f..abdfc80 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -945,7 +945,7 @@ static int visorbus_device_destroy(struct controlvm_message 
*inmsg)
}
 
kfree(dev_info->name);
-   visorchipset_device_destroy(dev_info);
+   remove_visor_device(dev_info);
return 0;
 
 err_respond:
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 43/45] staging: unisys: visorbus: Get rid of passthrough function visorchipset_device_create

2017-08-01 Thread David Kershner
From: Sameer Wadgaonkar 

The function visorchipset_device_create just called create_visor_device,
we can just combine it with create_visor_device.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c| 18 ++-
 drivers/staging/unisys/visorbus/visorbus_private.h |  2 +-
 drivers/staging/unisys/visorbus/visorchipset.c |  4 +--
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index aabb0c4..9093a25 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -658,7 +658,7 @@ EXPORT_SYMBOL_GPL(visorbus_disable_channel_interrupts);
  * Return: 0 if successful, otherwise the negative value returned by
  * device_add() indicating the reason for failure
  */
-static int create_visor_device(struct visor_device *dev)
+int create_visor_device(struct visor_device *dev)
 {
int err;
u32 chipset_bus_no = dev->chipset_bus_no;
@@ -705,6 +705,8 @@ static int create_visor_device(struct visor_device *dev)
goto err_put;
 
list_add_tail(&dev->list_all, &list_all_device_instances);
+   dev->state.created = 1;
+   visorbus_response(dev, err, CONTROLVM_DEVICE_CREATE);
/* success: reference kept via unmatched get_device() */
return 0;
 
@@ -1117,20 +1119,6 @@ static void remove_all_visor_devices(void)
}
 }
 
-int visorchipset_device_create(struct visor_device *dev_info)
-{
-   int err;
-
-   err = create_visor_device(dev_info);
-   if (err < 0)
-   return err;
-
-   visorbus_response(dev_info, err, CONTROLVM_DEVICE_CREATE);
-   dev_info->state.created = 1;
-
-   return 0;
-}
-
 void visorchipset_device_destroy(struct visor_device *dev_info)
 {
remove_visor_device(dev_info);
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 60230cb..e87e76d 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -25,7 +25,7 @@
 
 int visorbus_create_instance(struct visor_device *dev);
 void visorbus_remove_instance(struct visor_device *bus_info);
-int visorchipset_device_create(struct visor_device *dev_info);
+int create_visor_device(struct visor_device *dev_info);
 void visorchipset_device_destroy(struct visor_device *dev_info);
 int visorchipset_device_pause(struct visor_device *dev_info);
 int visorchipset_device_resume(struct visor_device *dev_info);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index f875088..756988f 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -830,8 +830,8 @@ static int visorbus_device_create(struct controlvm_message 
*inmsg)
   sizeof(struct controlvm_message_header));
dev_info->pending_msg_hdr = pmsg_hdr;
}
-   /* visorchipset_device_create will send response */
-   err = visorchipset_device_create(dev_info);
+   /* create_visor_device will send response */
+   err = create_visor_device(dev_info);
if (err)
goto err_destroy_visorchannel;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 40/45] staging: unisys: visorinput: ultrainputreport.h: Adjust comment formatting

2017-08-01 Thread David Kershner
From: David Binder 

The first line of the top file comment should begin on the line following
the block comment opening, thereby following the convention used elsewhere
in the driver set.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorinput/ultrainputreport.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorinput/ultrainputreport.h 
b/drivers/staging/unisys/visorinput/ultrainputreport.h
index 3ffad83..53975a0 100644
--- a/drivers/staging/unisys/visorinput/ultrainputreport.h
+++ b/drivers/staging/unisys/visorinput/ultrainputreport.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2010 - 2015 UNISYS CORPORATION
+/*
+ * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 37/45] staging: unisys: visorinput: visorinput.c: Remove filename in top comment

2017-08-01 Thread David Kershner
From: David Binder 

Removes unnecessary filename in the top file comment.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorinput/visorinput.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorinput/visorinput.c 
b/drivers/staging/unisys/visorinput/visorinput.c
index a27a8f5..788023d 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -1,5 +1,4 @@
-/* visorinput.c
- *
+/*
  * Copyright (C) 2011 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 35/45] staging: unisys: visorbus: visorbus_main.c: Remove filename in top comment

2017-08-01 Thread David Kershner
From: David Binder 

Removes unnecessary filename in the top file comment.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 2c89f15..39c2954 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1,6 +1,4 @@
 /*
- * visorbus_main.c
- *
  * Copyright ďż˝ 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 34/45] staging: unisys: visorbus: visorchipset.c: Fix SonarQube sprintf findings

2017-08-01 Thread David Kershner
From: David Binder 

Fixes two sprintf invocations where we attempt to format an unsigned
integer as a signed integer.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 72131ce..4668daf 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -201,7 +201,7 @@ static ssize_t error_show(struct device *dev, struct 
device_attribute *attr,
&error, sizeof(u32));
if (err)
return err;
-   return sprintf(buf, "%i\n", error);
+   return sprintf(buf, "%u\n", error);
 }
 
 static ssize_t error_store(struct device *dev, struct device_attribute *attr,
@@ -236,7 +236,7 @@ static ssize_t textid_show(struct device *dev, struct 
device_attribute *attr,
if (err)
return err;
 
-   return sprintf(buf, "%i\n", text_id);
+   return sprintf(buf, "%u\n", text_id);
 }
 
 static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 27/45] staging: unisys: include: remove unnecessary blank line from channel.h

2017-08-01 Thread David Kershner
Remove unnecessary blank line from channel.h #defines.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/channel.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index 9a2e41c..adfb0c8 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -24,7 +24,6 @@
 #define SIGNATURE_16(A, B) ((A) | ((B) << 8))
 #define SIGNATURE_32(A, B, C, D) \
(SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16))
-
 #define VISOR_CHANNEL_SIGNATURE SIGNATURE_32('E', 'C', 'N', 'L')
 
 /*
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 20/45] staging: unisys: include: Fix up comment style in visorbus.h

2017-08-01 Thread David Kershner
Visorbus.h had comments that did not have /* on its own line, this patch
makes it uniform.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/visorbus.h | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index 17c9229..352d102 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -1,4 +1,5 @@
-/* visorbus.h
+/*
+ * visorbus.h
  *
  * Copyright (C) 2010 - 2013 UNISYS CORPORATION
  * All rights reserved.
@@ -54,8 +55,9 @@ struct visorchipset_state {
/* Remaining bits in this 32-bit word are unused. */
 };
 
-/** This struct describes a specific Supervisor channel, by providing its
- *  GUID, name, and sizes.
+/*
+ * This struct describes a specific Supervisor channel, by providing its
+ * GUID, name, and sizes.
  */
 struct visor_channeltype_descriptor {
const uuid_le guid;
@@ -187,7 +189,8 @@ int visorbus_write_channel(struct visor_device *dev,
 int visorbus_enable_channel_interrupts(struct visor_device *dev);
 void visorbus_disable_channel_interrupts(struct visor_device *dev);
 
-/* Levels of severity for diagnostic events, in order from lowest severity to
+/*
+ * Levels of severity for diagnostic events, in order from lowest severity to
  * highest (i.e. fatal errors are the most severe, and should always be logged,
  * but info events rarely need to be logged except during debugging). The
  * values DIAG_SEVERITY_ENUM_BEGIN and DIAG_SEVERITY_ENUM_END are not valid
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 19/45] staging: unisys: include: cleanup channel comment

2017-08-01 Thread David Kershner
A comment in channel.h was referencing windows guests, in reality the OS
of the guest is agnostic and the comment should reflect that.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/channel.h |  9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index 5ff34bb..9a2e41c 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -60,11 +60,10 @@ enum channel_clientstate {
 
 /*
  * Values for VISOR_CHANNEL_PROTOCOL.Features: This define exists so that
- * windows guest can look at the FeatureFlags in the io channel, and configure
- * the windows driver to use interrupts or not based on this setting.  This 
flag
- * is set in uislib after the VISOR_VHBA_init_channel is called.  All feature
- * bits for all channels should be defined here.  The io channel feature bits
- * are defined right here
+ * a guest can look at the FeatureFlags in the io channel, and configure the
+ * driver to use interrupts or not based on this setting. All feature bits for
+ * all channels should be defined here. The io channel feature bits are defined
+ * below.
  */
 #define VISOR_DRIVER_ENABLES_INTS (0x1ULL << 1)
 #define VISOR_CHANNEL_IS_POLLING (0x1ULL << 3)
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/45] staging: unisys: include: iochannel.h: Removed unused DEFINE

2017-08-01 Thread David Kershner
From: Zohaib Javed 

Removed unused #define GPI_ENTRIES_PER_PAGE

Signed-off-by: Zohaib Javed 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/iochannel.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 80b9ef3..40eb7d5 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -133,8 +133,6 @@ struct guest_phys_info {
u64 length;
 } __packed;
 
-#define GPI_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(struct guest_phys_info))
-
 /*
  * struct uisscsi_dest
  * @channel: Bus number.
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 29/45] staging: unisys: Move SIOVM guid to visorbus

2017-08-01 Thread David Kershner
The SIOVM guid is only used by visorchipset. So define it there instead
of a global header file.

Reviewed-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/include/channel.h   | 6 --
 drivers/staging/unisys/visorbus/visorchipset.c | 7 +++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index 2d6389f..40e5b0f 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -191,10 +191,4 @@ struct signal_queue_header {
 static const uuid_le visor_vhba_channel_uuid = VISOR_VHBA_CHANNEL_UUID;
 #define VISOR_VHBA_CHANNEL_UUID_STR \
"414815ed-c58c-11da-95a9-00e08161165f"
-/* {72120008-4AAB-11DC-8530-444553544200} */
-#define VISOR_SIOVM_UUID \
-   UUID_LE(0x72120008, 0x4AAB, 0x11DC, \
-   0x85, 0x30, 0x44, 0x45, 0x53, 0x54, 0x42, 0x00)
-static const uuid_le visor_siovm_uuid = VISOR_SIOVM_UUID;
-
 #endif
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 0e9e529..7047989 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -582,6 +582,13 @@ static int device_changestate_responder(
 CONTROLVM_QUEUE_REQUEST, &outmsg);
 }
 
+/* CHANNEL Guids */
+/* {72120008-4AAB-11DC-8530-444553544200} */
+#define VISOR_SIOVM_UUID \
+   UUID_LE(0x72120008, 0x4AAB, 0x11DC, \
+   0x85, 0x30, 0x44, 0x45, 0x53, 0x54, 0x42, 0x00)
+static const uuid_le visor_siovm_uuid = VISOR_SIOVM_UUID;
+
 static int visorbus_create(struct controlvm_message *inmsg)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: fix styling WARNINGs

2017-08-01 Thread Ashish Kalra
Signed-off-by: Ashish Kalra 
---
 drivers/staging/ks7010/ks7010_sdio.c | 47 +---
 1 file changed, 33 insertions(+), 14 deletions(-)

Trivial style changes. There are still "line over 80 characters"
checkpatch.pl warnings, but I think they are best left alone as
breaking these could hurt readability

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 9b28ee1..274fed8 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -9,7 +9,6 @@
  *   it under the terms of the GNU General Public License version 2 as
  *   published by the Free Software Foundation.
  */
-
 #include 
 #include 
 #include 
@@ -32,19 +31,39 @@
 };
 MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
 
-#define inc_txqhead(priv) \
-   (priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE)
-#define inc_txqtail(priv) \
-   (priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE)
-#define cnt_txqbody(priv) \
-   (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - (priv->tx_dev.qhead)) % 
TX_DEVICE_BUFF_SIZE)
-
-#define inc_rxqhead(priv) \
-   (priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE)
-#define inc_rxqtail(priv) \
-   (priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE)
-#define cnt_rxqbody(priv) \
-   (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % 
RX_DEVICE_BUFF_SIZE)
+static int inc_txqhead(struct ks_wlan_private *priv)
+{
+   priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE;
+   return 0;
+}
+
+static int inc_txqtail(struct ks_wlan_private *priv)
+{
+   priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE;
+   return 0;
+}
+
+static int inc_rxqtail(struct ks_wlan_private *priv)
+{
+   priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE;
+   return 0;
+}
+
+static int inc_rxqhead(struct ks_wlan_private *priv)
+{
+   priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE;
+   return 0;
+}
+
+static int cnt_rxqbody(struct ks_wlan_private *priv)
+{
+   return  (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - 
(priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE);
+}
+
+static int cnt_txqbody(struct ks_wlan_private *priv)
+{
+   return (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - 
(priv->tx_dev.qhead)) % TX_DEVICE_BUFF_SIZE);
+}
 
 /* Read single byte from device address into byte (CMD52) */
 static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int 
address,
-- 
1.9.1

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


Re: [PATCH] staging: ks7010: fix styling WARNINGs

2017-08-01 Thread Joe Perches
On Tue, 2017-08-01 at 17:11 +0100, Ashish Kalra wrote:
> Signed-off-by: Ashish Kalra 

Still many issues with this patch submission:

o no commit message
o no version of patch submission in subject line

And other issues below:

> ---
>  drivers/staging/ks7010/ks7010_sdio.c | 47 
> +---
>  1 file changed, 33 insertions(+), 14 deletions(-)
> 
> Trivial style changes. There are still "line over 80 characters"
> checkpatch.pl warnings, but I think they are best left alone as
> breaking these could hurt readability

This message should go above the --- line and the
version information about what changed between
each submission should go below the --- line.

> diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
> b/drivers/staging/ks7010/ks7010_sdio.c
[]
> @@ -9,7 +9,6 @@
>   *   it under the terms of the GNU General Public License version 2 as
>   *   published by the Free Software Foundation.
>   */
> -

Why is this line removed?

>  #include 
>  #include 
>  #include 
> @@ -32,19 +31,39 @@
>  };
>  MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
>  
> -#define inc_txqhead(priv) \
> - (priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE)
> -#define inc_txqtail(priv) \
> - (priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE)
> -#define cnt_txqbody(priv) \
> - (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - (priv->tx_dev.qhead)) % 
> TX_DEVICE_BUFF_SIZE)
> -
> -#define inc_rxqhead(priv) \
> - (priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE)
> -#define inc_rxqtail(priv) \
> - (priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE)
> -#define cnt_rxqbody(priv) \
> - (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % 
> RX_DEVICE_BUFF_SIZE)
> +static int inc_txqhead(struct ks_wlan_private *priv)
> +{
> + priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE;
> + return 0;
> +}
> +
> +static int inc_txqtail(struct ks_wlan_private *priv)
> +{
> + priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE;
> + return 0;
> +}
> +
> +static int inc_rxqtail(struct ks_wlan_private *priv)
> +{
> + priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE;
> + return 0;
> +}
> +
> +static int inc_rxqhead(struct ks_wlan_private *priv)
> +{
> + priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE;
> + return 0;
> +}

Why are the functions above not returning void?

> +
> +static int cnt_rxqbody(struct ks_wlan_private *priv)
> +{
> + return  (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - 
> (priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE);
> +}
> +
> +static int cnt_txqbody(struct ks_wlan_private *priv)
> +{
> + return (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - 
> (priv->tx_dev.qhead)) % TX_DEVICE_BUFF_SIZE);
> +}

Why are these 2 functions above not returning unsigned int?

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


Re: [PATCH v2] Staging: greybus: Match alignment with open parenthesis.

2017-08-01 Thread Bryan O'Donoghue

On 28/07/17 20:50, Shreeya Patel wrote:

Alignment should match with open parenthesis.
I was going to crib about the use of parenthesis instead of 
parentheses... but as the man would say that would be #sad #sosad


So - thanks for taking the time to send this patch.


This fixes the coding style issue.

Signed-off-by: Shreeya Patel 


Reviewed-by: Bryan O'Donoghue 


---
Changes in v2:
   -Rebase the patch.


  drivers/staging/greybus/tools/loopback_test.c | 35 ---
  1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/greybus/tools/loopback_test.c 
b/drivers/staging/greybus/tools/loopback_test.c
index 32a4369..a29e091a 100644
--- a/drivers/staging/greybus/tools/loopback_test.c
+++ b/drivers/staging/greybus/tools/loopback_test.c
@@ -420,10 +420,10 @@ void log_csv_error(int len, int err)
  }
  
  int format_output(struct loopback_test *t,

-   struct loopback_results *r,
-   const char *dev_name,
-   char *buf, int buf_len,
-   struct tm *tm)
+ struct loopback_results *r,
+ const char *dev_name,
+ char *buf, int buf_len,
+ struct tm *tm)
  {
int len = 0;
  
@@ -535,7 +535,7 @@ static int log_results(struct loopback_test *t)

*/
if (t->file_output && !t->porcelain) {
snprintf(file_name, sizeof(file_name), "%s_%d_%d.csv",
-   t->test_name, t->size, t->iteration_max);
+t->test_name, t->size, t->iteration_max);
  
  		fd = open(file_name, O_WRONLY | O_CREAT | O_APPEND, 0644);

if (fd < 0) {
@@ -549,8 +549,8 @@ static int log_results(struct loopback_test *t)
continue;
  
  		len = format_output(t, &t->devices[i].results,

-   t->devices[i].name,
-   data, sizeof(data), &tm);
+   t->devices[i].name,
+   data, sizeof(data), &tm);
if (t->file_output && !t->porcelain) {
ret = write(fd, data, len);
if (ret == -1)
@@ -562,7 +562,7 @@ static int log_results(struct loopback_test *t)
  
  	if (t->aggregate_output) {

len = format_output(t, &t->aggregate_results, "aggregate",
-   data, sizeof(data), &tm);
+   data, sizeof(data), &tm);
if (t->file_output && !t->porcelain) {
ret = write(fd, data, len);
if (ret == -1)
@@ -623,14 +623,13 @@ int find_loopback_devices(struct loopback_test *t)
snprintf(d->name, MAX_STR_LEN, "gb_loopback%u", dev_id);
  
  		snprintf(d->sysfs_entry, MAX_SYSFS_PATH, "%s%s/",

-   t->sysfs_prefix, d->name);
+t->sysfs_prefix, d->name);
  
  		snprintf(d->debugfs_entry, MAX_SYSFS_PATH, "%sraw_latency_%s",

-   t->debugfs_prefix, d->name);
+t->debugfs_prefix, d->name);
  
  		if (t->debug)

-   printf("add %s %s\n", d->sysfs_entry,
-   d->debugfs_entry);
+   printf("add %s %s\n", d->sysfs_entry, d->debugfs_entry);
}
  
  	ret = 0;

@@ -802,16 +801,14 @@ static void prepare_devices(struct loopback_test *t)
t->iteration_max);
  
  		if (t->use_async) {

+   write_sysfs_val(t->devices[i].sysfs_entry, "async", 1);
write_sysfs_val(t->devices[i].sysfs_entry,
-   "async", 1);
+   "timeout", t->async_timeout);
write_sysfs_val(t->devices[i].sysfs_entry,
-   "timeout", t->async_timeout);
-   write_sysfs_val(t->devices[i].sysfs_entry,
-   "outstanding_operations_max",
-   t->async_outstanding_operations);
+   "outstanding_operations_max",
+   t->async_outstanding_operations);
} else
-   write_sysfs_val(t->devices[i].sysfs_entry,
-   "async", 0);
+   write_sysfs_val(t->devices[i].sysfs_entry, "async", 0);
}
  }
  



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


[PATCH v2]staging: ks7010: fix styling WARNINGs

2017-08-01 Thread Ashish Kalra
Signed-off-by: Ashish Kalra 

Trivial style changes. There are still "line over 80 characters"
checkpatch.pl warnings, but I think they are best left alone as
breaking these could hurt readability
v2: Updated Patch as per review comments recievd
---
 drivers/staging/ks7010/ks7010_sdio.c | 42 +---
 1 file changed, 29 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 9b28ee1..091dedd 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -32,19 +32,35 @@
 };
 MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
 
-#define inc_txqhead(priv) \
-   (priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE)
-#define inc_txqtail(priv) \
-   (priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE)
-#define cnt_txqbody(priv) \
-   (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - (priv->tx_dev.qhead)) % 
TX_DEVICE_BUFF_SIZE)
-
-#define inc_rxqhead(priv) \
-   (priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE)
-#define inc_rxqtail(priv) \
-   (priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE)
-#define cnt_rxqbody(priv) \
-   (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % 
RX_DEVICE_BUFF_SIZE)
+static void inc_txqhead(struct ks_wlan_private *priv)
+{
+   priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE;
+}
+
+static void inc_txqtail(struct ks_wlan_private *priv)
+{
+   priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE;
+}
+
+static void inc_rxqtail(struct ks_wlan_private *priv)
+{
+   priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE;
+}
+
+static void inc_rxqhead(struct ks_wlan_private *priv)
+{
+   priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE;
+}
+
+static unsigned int cnt_rxqbody(struct ks_wlan_private *priv)
+{
+   return  (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - 
(priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE);
+}
+
+static unsigned int cnt_txqbody(struct ks_wlan_private *priv)
+{
+   return (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - 
(priv->tx_dev.qhead)) % TX_DEVICE_BUFF_SIZE);
+}
 
 /* Read single byte from device address into byte (CMD52) */
 static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int 
address,
-- 
1.9.1

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


[PATCH] staging: vboxvideo: select DRM_TTM

2017-08-01 Thread Cihangir Akturk
vboxvideo code uses various ttm_* functions, so it needs
"drivers/gpu/drm/ttm/*" to be built. In order to build these objects
select DRM_TTM.

This commit fixes "ttm_*" undefined build errors.

Signed-off-by: Cihangir Akturk 
---
 drivers/staging/vboxvideo/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/vboxvideo/Kconfig 
b/drivers/staging/vboxvideo/Kconfig
index f89f931..1f4182e 100644
--- a/drivers/staging/vboxvideo/Kconfig
+++ b/drivers/staging/vboxvideo/Kconfig
@@ -2,6 +2,7 @@ config DRM_VBOXVIDEO
tristate "Virtual Box Graphics Card"
depends on DRM && X86 && PCI
select DRM_KMS_HELPER
+   select DRM_TTM
select GENERIC_ALLOCATOR
help
  This is a KMS driver for the virtual Graphics Card used in
-- 
2.7.4

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


RE: [PATCH v2] staging: unisys: Switch to use new generic UUID API

2017-08-01 Thread Kershner, David A


> -Original Message-
> From: Andy Shevchenko [mailto:andriy.shevche...@linux.intel.com]
> Sent: Monday, July 31, 2017 1:19 PM
> Subject: [PATCH v2] staging: unisys: Switch to use new generic UUID API
> 
> There are new types and helpers that are supposed to be used in new code.
> 
> As a preparation to get rid of legacy types and API functions do
> the conversion here.
> 
> While here, re-indent couple of lines to increase readability.
> 
> Cc: David Kershner 
> Cc: Greg Kroah-Hartman 
> Cc: sparmaintai...@unisys.com
> Cc: de...@driverdev.osuosl.org
> Signed-off-by: Andy Shevchenko 

Acked-by: David Kershner 

> ---
>  drivers/staging/unisys/Documentation/overview.txt  | 14 +++
>  drivers/staging/unisys/include/channel.h   | 29 ++
>  drivers/staging/unisys/include/iochannel.h |  2 +-
>  drivers/staging/unisys/include/visorbus.h  | 14 +++
>  drivers/staging/unisys/visorbus/controlvmchannel.h | 16 
>  drivers/staging/unisys/visorbus/vbuschannel.h  |  8 ++--
>  drivers/staging/unisys/visorbus/visorbus_main.c| 44 ++--
> -
>  drivers/staging/unisys/visorbus/visorbus_private.h |  6 +--
>  drivers/staging/unisys/visorbus/visorchannel.c | 46 +++--
> -
>  drivers/staging/unisys/visorbus/visorchipset.c | 33 +---
>  drivers/staging/unisys/visorhba/visorhba_main.c|  6 +--
>  drivers/staging/unisys/visorinput/visorinput.c | 38 +-
>  drivers/staging/unisys/visornic/visornic_main.c|  6 +--
>  13 files changed, 130 insertions(+), 132 deletions(-)

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


[PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount

2017-08-01 Thread Florian Fainelli
On 32-bit hosts and with CONFIG_DEBUG_LOCK_ALLOC we should be seeing a
lockdep splat indicating this seqcount is not correctly initialized, fix
that. In commit 6c80f3fc2398 ("netvsc: report per-channel stats in
ethtool statistics") netdev_alloc_pcpu_stats() was removed in favor of
open-coding the 64-bits statistics, except that u64_stats_init() was
missed.

Fixes: 6c80f3fc2398 ("netvsc: report per-channel stats in ethtool statistics")
Signed-off-by: Florian Fainelli 
---
 drivers/net/hyperv/netvsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 0a9167dd72fb..96f90c75d1b7 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1302,6 +1302,8 @@ int netvsc_device_add(struct hv_device *device,
struct netvsc_channel *nvchan = &net_device->chan_table[i];
 
nvchan->channel = device->channel;
+   u64_stats_init(&nvchan->tx_stats.syncp);
+   u64_stats_init(&nvchan->rx_stats.syncp);
}
 
/* Enable NAPI handler before init callbacks */
-- 
2.9.3

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


[PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount

2017-08-01 Thread Florian Fainelli
On 32-bit hosts and with CONFIG_DEBUG_LOCK_ALLOC we should be seeing a
lockdep splat indicating this seqcount is not correctly initialized, fix
that. In commit 6c80f3fc2398 ("netvsc: report per-channel stats in
ethtool statistics") netdev_alloc_pcpu_stats() was removed in favor of
open-coding the 64-bits statistics, except that u64_stats_init() was
missed.

Fixes: 6c80f3fc2398 ("netvsc: report per-channel stats in ethtool statistics")
Signed-off-by: Florian Fainelli 
---
 drivers/net/hyperv/netvsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 0a9167dd72fb..96f90c75d1b7 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1302,6 +1302,8 @@ int netvsc_device_add(struct hv_device *device,
struct netvsc_channel *nvchan = &net_device->chan_table[i];
 
nvchan->channel = device->channel;
+   u64_stats_init(&nvchan->tx_stats.syncp);
+   u64_stats_init(&nvchan->rx_stats.syncp);
}
 
/* Enable NAPI handler before init callbacks */
-- 
2.9.3

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


[PATCH 1/5] staging/pi433:Removed Coding style issues from pi433_if.h and other dependencies arising from it.

2017-08-01 Thread Rishabh Hardas
This is a 5 patch series which solves coding style issues
as marked by checkpatch.pl in the file pi433_if.h and
contains changes that have to be made in other files as a
consequence of the changes made in pi433_if.h

Signed-off-by: Rishabh Hardas 
---
 drivers/staging/pi433/pi433_if.h | 81 +---
 1 file changed, 43 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h
index e6ed3cd..d87434c 100644
--- a/drivers/staging/pi433/pi433_if.h
+++ b/drivers/staging/pi433/pi433_if.h
@@ -32,15 +32,11 @@
 #include 
 #include "rf69_enum.h"

-/*---*/
-
-
-/*---*/
-
 /* IOCTL structs and commands */

 /**
- * struct pi433_tx_config - describes the configuration of the radio module 
for sending
+ * struct pi433_tx_config - describes the configuration of
+ * the radio module for sending
  * @frequency:
  * @bit_rate:
  * @modulation:
@@ -57,28 +53,26 @@
  *
  * NOTE: struct layout is the same in 64bit and 32bit userspace.
  */
-#define PI433_TX_CFG_IOCTL_NR  0
-struct pi433_tx_cfg
-{
+#define PI433_TX_CFG_IOCTL_NR  0
+struct pi433_tx_cfg {
__u32   frequency;
__u16   bit_rate;
__u32   dev_frequency;
enum modulation modulation;
-   enum modShaping modShaping;
+   enum mod_shapingmod_shaping;

-   enum paRamp pa_ramp;
+   enum pa_ramppa_ramp;

-   enum txStartCondition   tx_start_condition;
+   enum tx_start_condition tx_start_condition;

__u16   repetitions;

-
/* packet format */
-   enum optionOnOffenable_preamble;
-   enum optionOnOffenable_sync;
-   enum optionOnOffenable_length_byte;
-   enum optionOnOffenable_address_byte;
-   enum optionOnOffenable_crc;
+   enum option_on_off  enable_preamble;
+   enum option_on_off  enable_sync;
+   enum option_on_off  enable_length_byte;
+   enum option_on_off  enable_address_byte;
+   enum option_on_off  enable_crc;

__u16   preamble_length;
__u8sync_length;
@@ -88,9 +82,9 @@ struct pi433_tx_cfg
__u8address_byte;
 };

-
 /**
- * struct pi433_rx_config - describes the configuration of the radio module 
for sending
+ * struct pi433_rx_config - describes the configuration of
+ * the radio module for sending
  * @frequency:
  * @bit_rate:
  * @modulation:
@@ -107,29 +101,37 @@ struct pi433_tx_cfg
  *
  * NOTE: struct layout is the same in 64bit and 32bit userspace.
  */
-#define PI433_RX_CFG_IOCTL_NR  1
+#define PI433_RX_CFG_IOCTL_NR  1
 struct pi433_rx_cfg {
__u32   frequency;
__u16   bit_rate;
__u32   dev_frequency;

-   enum modulation modulation;
+   enum modulation modulation;

-   __u8rssi_threshold;
-   enum thresholdDecrement thresholdDecrement;
-   enum antennaImpedance   antenna_impedance;
-   enum lnaGainlna_gain;
-   enum mantisse   bw_mantisse;/* normal: 0x50 */
-   __u8bw_exponent;/* during AFC: 0x8b */
-   enum dagc   dagc;
+   __u8rssi_threshold;

+   enum threshold_decrementthreshold_decrement;
+   enum antenna_impedance  antenna_impedance;

+   enum lnagainlna_gain;
+   enum mantisse   bw_mantisse;/* normal: 0x50 */
+   __u8bw_exponent;/* during AFC: 0x8b */
+   enum dagc   dagc;

/* packet format */
-   enum optionOnOffenable_sync;
-   enum optionOnOffenable_length_byte;   /* should be used in 
combination with sync, only */
-   enum addressFiltering   enable_address_filtering; /* operational with 
sync, only */
-   enum optionOnOffenable_crc;   /* only operational, 
if sync on and fixed length or length byte is used */
+   enum option_on_off  enable_sync;
+   enum option_on_off  enable_length_byte;/* should be used
+   * in combination
+   * with sync,only
+   */
+   enum address_filtering  enable_address_filtering;/* operational with
+ *sync, only
+ */
+   enum option_on_off  enable_crc;/* only operational, if sync on
+   *and fixed length or
+   *length byte is used
+   

[PATCH 2/5] staging/pi433/pi433_if.c:Removed Coding style issues from pi433_if.h and other dependencies arising from it.

2017-08-01 Thread Rishabh Hardas
Signed-off-by: Rishabh Hardas 
---
 drivers/staging/pi433/pi433_if.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index ed737f4..11c042b 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -192,7 +192,7 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct 
pi433_rx_cfg *rx_cfg)
SET_CHECKED(rf69_set_modulation (dev->spi, rx_cfg->modulation));
SET_CHECKED(rf69_set_antenna_impedance   (dev->spi, 
rx_cfg->antenna_impedance));
SET_CHECKED(rf69_set_rssi_threshold  (dev->spi, 
rx_cfg->rssi_threshold));
-   SET_CHECKED(rf69_set_ook_threshold_dec   (dev->spi, 
rx_cfg->thresholdDecrement));
+   SET_CHECKED(rf69_set_ook_threshold_dec   (dev->spi, 
rx_cfg->threshold_decrement));
SET_CHECKED(rf69_set_bandwidth   (dev->spi, 
rx_cfg->bw_mantisse, rx_cfg->bw_exponent));
SET_CHECKED(rf69_set_bandwidth_during_afc(dev->spi, 
rx_cfg->bw_mantisse, rx_cfg->bw_exponent));
SET_CHECKED(rf69_set_dagc(dev->spi, rx_cfg->dagc));
@@ -254,5 +254,5 @@ rf69_set_tx_cfg(struct pi433_device *dev, struct 
pi433_tx_cfg *tx_cfg)
SET_CHECKED(rf69_set_modulation (dev->spi, tx_cfg->modulation));
SET_CHECKED(rf69_set_deviation  (dev->spi, tx_cfg->dev_frequency));
SET_CHECKED(rf69_set_pa_ramp(dev->spi, tx_cfg->pa_ramp));
-   SET_CHECKED(rf69_set_modulation_shaping(dev->spi, tx_cfg->modShaping));
+   SET_CHECKED(rf69_set_modulation_shaping(dev->spi, tx_cfg->mod_shaping));
SET_CHECKED(rf69_set_tx_start_condition(dev->spi, 
tx_cfg->tx_start_condition));

/* packet format enable */
--
2.7.4

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


[PATCH 4/5] staging/pi433/rf69.c:Removed Coding style issues from pi433_if.h and other dependencies arising from it.

2017-08-01 Thread Rishabh Hardas
Signed-off-by: Rishabh Hardas 
---
 drivers/staging/pi433/rf69.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index f83523e..7fa63e1 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -109,2 +109,2 @@ enum modulation rf69_get_modulation(struct spi_device *spi)
}
 }

-int rf69_set_modulation_shaping(struct spi_device *spi, enum modShaping 
modShaping)
+int rf69_set_modulation_shaping(struct spi_device *spi, enum mod_shaping 
modShaping)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: mod shaping");
@@ -264,2 +264,2 @@ int rf69_set_frequency(struct spi_device *spi, u32 
frequency)
return 0;
 }

-int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff)
+int rf69_set_amplifier_0(struct spi_device *spi, enum option_on_off 
optionOnOff)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: amp #0");
@@ -277,2 +277,2 @@ int rf69_set_amplifier_0(struct spi_device *spi, enum 
optionOnOff optionOnOff)
}
 }

-int rf69_set_amplifier_1(struct spi_device *spi, enum optionOnOff optionOnOff)
+int rf69_set_amplifier_1(struct spi_device *spi, enum option_on_off 
optionOnOff)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: amp #1");
@@ -290,2 +290,2 @@ int rf69_set_amplifier_1(struct spi_device *spi, enum 
optionOnOff optionOnOff)
}
 }

-int rf69_set_amplifier_2(struct spi_device *spi, enum optionOnOff optionOnOff)
+int rf69_set_amplifier_2(struct spi_device *spi, enum option_on_off 
optionOnOff)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: amp #2");
@@ -319,2 +319,2 @@ int rf69_set_output_power_level(struct spi_device *spi, u8 
powerLevel)
return WRITE_REG(REG_PALEVEL, (READ_REG(REG_PALEVEL) & 
~MASK_PALEVEL_OUTPUT_POWER) | powerLevel);
 }

-int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp paRamp)
+int rf69_set_pa_ramp(struct spi_device *spi, enum pa_ramp paRamp)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: pa ramp");
@@ -346,2 +346,2 @@ int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp 
paRamp)
}
 }

-int rf69_set_antenna_impedance(struct spi_device *spi, enum antennaImpedance 
antennaImpedance)
+int rf69_set_antenna_impedance(struct spi_device *spi, enum antenna_impedance 
antennaImpedance)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: antenna impedance");
@@ -359,2 +359,2 @@ int rf69_set_antenna_impedance(struct spi_device *spi, enum 
antennaImpedance ant
}
 }

-int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain lnaGain)
+int rf69_set_lna_gain(struct spi_device *spi, enum lnagain lnaGain)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: lna gain");
@@ -377,2 +377,2 @@ int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain 
lnaGain)
}
 }

-enum lnaGain rf69_get_lna_gain(struct spi_device *spi)
+enum lnagain rf69_get_lna_gain(struct spi_device *spi)
 {
u8 currentValue;

@@ -516,2 +516,2 @@ int rf69_set_ook_threshold_step(struct spi_device *spi, 
enum thresholdStep thres
}
 }

-int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement 
thresholdDecrement)
+int rf69_set_ook_threshold_dec(struct spi_device *spi, enum 
threshold_decrement thresholdDecrement)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: threshold decrement");
@@ -666,2 +666,2 @@ int rf69_set_preamble_length(struct spi_device *spi, u16 
preambleLength)
return retval;
 }

-int rf69_set_sync_enable(struct spi_device *spi, enum optionOnOff optionOnOff)
+int rf69_set_sync_enable(struct spi_device *spi, enum option_on_off 
optionOnOff)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: sync enable");
@@ -753,2 +753,2 @@ int rf69_set_packet_format(struct spi_device * spi, enum 
packetFormat packetForm
}
 }

-int rf69_set_crc_enable(struct spi_device *spi, enum optionOnOff optionOnOff)
+int rf69_set_crc_enable(struct spi_device *spi, enum option_on_off optionOnOff)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: crc enable");
@@ -766,2 +766,2 @@ int rf69_set_crc_enable(struct spi_device *spi, enum 
optionOnOff optionOnOff)
}
 }

-int rf69_set_adressFiltering(struct spi_device *spi, enum addressFiltering 
addressFiltering)
+int rf69_set_adressFiltering(struct spi_device *spi, enum address_filtering 
addressFiltering)
 {
#ifdef DEBUG
dev_dbg(&spi->dev, "set: address filtering");
@@ -816,2 +816,2 @@ int rf69_set_broadcast_address(struct spi_device *spi, u8 
broadcastAddress)
return WRITE_REG(REG_BROADCASTADRS, broadcastAddress);
 }

-int rf69_set_tx_start_condition(struct spi_device *spi, enum txStartCondition 
txStartCondition)
+int rf69_set_tx_start_condition(struct spi_device *spi, enum 
tx_start_condition txStartCondition)
 {
#ifdef DEBUG
 

[PATCH 3/5] staging/pi433/rf69.h:Removed Coding style issues from pi433_if.h and other dependencies arising from it.

2017-08-01 Thread Rishabh Hardas
Signed-off-by: Rishabh Hardas 
---
 drivers/staging/pi433/rf69.h | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h
index b81e076..e98e24e 100644
--- a/drivers/staging/pi433/rf69.h
+++ b/drivers/staging/pi433/rf69.h
@@ -29,18 +29,18 @@ int rf69_set_mode(struct spi_device *spi, enum mode mode);
 int rf69_set_data_mode(struct spi_device *spi, enum dataMode dataMode);
 int rf69_set_modulation(struct spi_device *spi, enum modulation modulation);
 enum modulation rf69_get_modulation(struct spi_device *spi);
-int rf69_set_modulation_shaping(struct spi_device *spi, enum modShaping 
modShaping);
+int rf69_set_modulation_shaping(struct spi_device *spi, enum mod_shaping 
modShaping);
 int rf69_set_bit_rate(struct spi_device *spi, u16 bitRate);
 int rf69_set_deviation(struct spi_device *spi, u32 deviation);
 int rf69_set_frequency(struct spi_device *spi, u32 frequency);
-int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff);
-int rf69_set_amplifier_1(struct spi_device *spi, enum optionOnOff optionOnOff);
-int rf69_set_amplifier_2(struct spi_device *spi, enum optionOnOff optionOnOff);
+int rf69_set_amplifier_0(struct spi_device *spi, enum option_on_off 
optionOnOff);
+int rf69_set_amplifier_1(struct spi_device *spi, enum option_on_off 
optionOnOff);
+int rf69_set_amplifier_2(struct spi_device *spi, enum option_on_off 
optionOnOff);
 int rf69_set_output_power_level(struct spi_device *spi, u8 powerLevel);
-int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp paRamp);
-int rf69_set_antenna_impedance(struct spi_device *spi, enum antennaImpedance 
antennaImpedance);
-int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain lnaGain);
-enum lnaGain rf69_get_lna_gain(struct spi_device *spi);
+int rf69_set_pa_ramp(struct spi_device *spi, enum pa_ramp paRamp);
+int rf69_set_antenna_impedance(struct spi_device *spi, enum antenna_impedance 
antennaImpedance);
+int rf69_set_lna_gain(struct spi_device *spi, enum lnagain lnaGain);
+enum lnagain rf69_get_lna_gain(struct spi_device *spi);
 int rf69_set_dc_cut_off_frequency_intern(struct spi_device *spi, u8 reg, enum 
dccPercent dccPercent);
 int rf69_set_dc_cut_off_frequency(struct spi_device *spi, enum dccPercent 
dccPercent);
 int rf69_set_dc_cut_off_frequency_during_afc(struct spi_device *spi, enum 
dccPercent dccPercent);
@@ -48,7 +48,7 @@ int rf69_set_bandwidth(struct spi_device *spi, enum mantisse 
mantisse, u8 expone
 int rf69_set_bandwidth_during_afc(struct spi_device *spi, enum mantisse 
mantisse, u8 exponent);
 int rf69_set_ook_threshold_type(struct spi_device *spi, enum thresholdType 
thresholdType);
 int rf69_set_ook_threshold_step(struct spi_device *spi, enum thresholdStep 
thresholdStep);
-int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement 
thresholdDecrement);
+int rf69_set_ook_threshold_dec(struct spi_device *spi, enum 
threshold_decrement thresholdDecrement);
 int rf69_set_dio_mapping(struct spi_device *spi, u8 DIONumber, u8 value);
 bool rf69_get_flag(struct spi_device *spi, enum flag flag);
 int rf69_reset_flag(struct spi_device *spi, enum flag flag);
@@ -56,18 +56,18 @@ int rf69_set_rssi_threshold(struct spi_device *spi, u8 
threshold);
 int rf69_set_rx_start_timeout(struct spi_device *spi, u8 timeout);
 int rf69_set_rssi_timeout(struct spi_device *spi, u8 timeout);
 int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength);
-int rf69_set_sync_enable(struct spi_device *spi, enum optionOnOff optionOnOff);
+int rf69_set_sync_enable(struct spi_device *spi, enum option_on_off 
optionOnOff);
 int rf69_set_fifo_fill_condition(struct spi_device *spi, enum 
fifoFillCondition fifoFillCondition);
 int rf69_set_sync_size(struct spi_device *spi, u8 sync_size);
 int rf69_set_sync_tolerance(struct spi_device *spi, u8 syncTolerance);
 int rf69_set_sync_values(struct spi_device *spi, u8 syncValues[8]);
 int rf69_set_packet_format(struct spi_device * spi, enum packetFormat 
packetFormat);
-int rf69_set_crc_enable(struct spi_device *spi, enum optionOnOff optionOnOff);
-int rf69_set_adressFiltering(struct spi_device *spi, enum addressFiltering 
addressFiltering);
+int rf69_set_crc_enable(struct spi_device *spi, enum option_on_off 
optionOnOff);
+int rf69_set_adressFiltering(struct spi_device *spi, enum address_filtering 
addressFiltering);
 int rf69_set_payload_length(struct spi_device *spi, u8 payloadLength);
 u8  rf69_get_payload_length(struct spi_device *spi);
 int rf69_set_node_address(struct spi_device *spi, u8 nodeAddress);
 int rf69_set_broadcast_address(struct spi_device *spi, u8 broadcastAddress);
-int rf69_set_tx_start_condition(struct spi_device *spi, enum txStartCondition 
txStartCondition);
+int rf69_set_tx_start_condition(struct spi_device *spi, enum 
tx_start_condition txStartCondition);
 int rf69_set_fifo_threshold(struct spi_device *spi, u8 threshold);
 int rf69_set_dagc(struct spi_device *

[PATCH 5/5] staging/pi433/rf69_enum.h:Removed Coding style issues from pi433_if.h and other dependencies arising from it.

2017-08-01 Thread Rishabh Hardas
Signed-off-by: Rishabh Hardas 
---
 drivers/staging/pi433/rf69_enum.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/pi433/rf69_enum.h 
b/drivers/staging/pi433/rf69_enum.h
index fbfb59b..f51eec3 100644
--- a/drivers/staging/pi433/rf69_enum.h
+++ b/drivers/staging/pi433/rf69_enum.h
@@ -18,2 +18,2 @@
 #ifndef RF69_ENUM_H
 #define RF69_ENUM_H

-enum optionOnOff
+enum option_on_off
 {
 optionOff,
 optionOn
@@ -46,2 +46,2 @@ enum modulation
 FSK
 };

-enum modShaping
+enum mod_shaping
 {
 shapingOff,
 shaping1_0,
@@ -56,2 +56,2 @@ enum modShaping
 shaping2BR
 };

-enum paRamp
+enum pa_ramp
 {
 ramp3400,
 ramp2000,
@@ -76,2 +76,2 @@ enum paRamp
 ramp10
 };

-enum antennaImpedance
+enum antenna_impedance
 {
 fiftyOhm,
 twohundretOhm
 };

-enum lnaGain
+enum lnagain
 {
 automatic,
 max,
@@ -132,2 +132,2 @@ enum thresholdStep
 step_6_0db
 };

-enum thresholdDecrement
+enum threshold_decrement
 {
 dec_every8th,
 dec_every4th,
@@ -177,2 +177,2 @@ enum packetFormat
 packetLengthVar
 };

-enum txStartCondition
+enum tx_start_condition
 {
 fifoLevel,
 fifoNotEmpty
 };

-enum addressFiltering
+enum address_filtering
 {
 filteringOff,
 nodeAddress,
--
2.7.4

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


Re: [PATCH] staging: ks7010: fix styling WARNINGs

2017-08-01 Thread Dan Carpenter
The subject is too vague and you need a changelog.

On Tue, Aug 01, 2017 at 05:11:29PM +0100, Ashish Kalra wrote:
> +static int inc_txqhead(struct ks_wlan_private *priv)
> +{
> + priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE;
> + return 0;

Just make these void if no one checks the return.

regards,
dan carpenter

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


[PATCH] staging: lustre: grab the cld->cld_lock mutex unconditionally

2017-08-01 Thread Cihangir Akturk
Instead of using the locked variable as a helper to determine the state
of the mutex cld->cld_lock, expand the scope of the recover_cld variable
and assign to the cld->cld_recover variable depending on whether the
value of the recover_cld variable is valid or not.

As a bonus, code size is slightly reduced.

before:
textdata bss dec hex filename
2618822564208   326527f8c 
drivers/staging/lustre/lustre/mgc/mgc_request.o

after:
textdata bss dec hex filename
2614022564208   326047f5c 
drivers/staging/lustre/lustre/mgc/mgc_request.o

Additionally silences the following warning reported by coccinelle:

drivers/staging/lustre/lustre/mgc/mgc_request.c:359:2-12: second lock on
line 365

Signed-off-by: Cihangir Akturk 
---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index eee0b66..6718474 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -288,7 +288,7 @@ config_log_add(struct obd_device *obd, char *logname,
struct config_llog_data *cld;
struct config_llog_data *sptlrpc_cld;
struct config_llog_data *params_cld;
-   bool locked = false;
+   struct config_llog_data *recover_cld = ERR_PTR(-EINVAL);
charseclogname[32];
char*ptr;
int rc;
@@ -338,8 +338,6 @@ config_log_add(struct obd_device *obd, char *logname,
 
LASSERT(lsi->lsi_lmd);
if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)) {
-   struct config_llog_data *recover_cld;
-
ptr = strrchr(seclogname, '-');
if (ptr) {
*ptr = 0;
@@ -355,14 +353,11 @@ config_log_add(struct obd_device *obd, char *logname,
rc = PTR_ERR(recover_cld);
goto out_cld;
}
-
-   mutex_lock(&cld->cld_lock);
-   locked = true;
-   cld->cld_recover = recover_cld;
}
 
-   if (!locked)
-   mutex_lock(&cld->cld_lock);
+   mutex_lock(&cld->cld_lock);
+   if (!IS_ERR(recover_cld))
+   cld->cld_recover = recover_cld;
cld->cld_params = params_cld;
cld->cld_sptlrpc = sptlrpc_cld;
mutex_unlock(&cld->cld_lock);
-- 
2.7.4

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


Re: [PATCH net-next v2 0/3] netvsc: transparent SR-IOV VF support

2017-08-01 Thread David Miller
From: Stephen Hemminger 
Date: Mon, 31 Jul 2017 16:45:21 -0700

> This patch set changes how SR-IOV Virtual Function devices are managed
> in the Hyper-V network driver. It was part of earlier bundle, but
> is now updated.

I think you need to do a rebase.  I just merged net into net-next and
this created some conflicts.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vboxvideo: use drm_gem_object_put instead of drm_gem_object_unreference

2017-08-01 Thread Cihangir Akturk
drm_gem_object_unreference is a compatibility alias for drm_gem_object_put so 
should
not be used by new code.

This patch fixes the following warning reported by coccinelle:

drivers/staging/vboxvideo/vbox_main.c:528:1-27: WARNING: use get/put
helpers to reference and dereference obj

Signed-off-by: Cihangir Akturk 
---
 drivers/staging/vboxvideo/vbox_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vboxvideo/vbox_main.c 
b/drivers/staging/vboxvideo/vbox_main.c
index d0c6ec7..1addeac 100644
--- a/drivers/staging/vboxvideo/vbox_main.c
+++ b/drivers/staging/vboxvideo/vbox_main.c
@@ -525,7 +525,7 @@ vbox_dumb_mmap_offset(struct drm_file *file,
bo = gem_to_vbox_bo(obj);
*offset = vbox_bo_mmap_offset(bo);
 
-   drm_gem_object_unreference(obj);
+   drm_gem_object_put(obj);
ret = 0;
 
 out_unlock:
-- 
2.7.4

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


driverdev-devel@linuxdriverproject.org

2017-08-01 Thread Ashish Kalra
This Patch is to solve coding style issues, Major changes to
 add Space around &,+,-. Major pending is to fix CamelCase

Signed-off-by: Ashish Kalra 
---
 drivers/staging/rtl8188eu/core/rtw_ap.c | 65 +++--
 1 file changed, 29 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 647a922..e79f5345 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -44,7 +44,7 @@ void free_mlme_ap_info(struct adapter *padapter)
struct sta_priv *pstapriv = &padapter->stapriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
-   struct mlme_ext_info*pmlmeinfo = &(pmlmeext->mlmext_info);
+   struct mlme_ext_info*pmlmeinfo = &pmlmeext->mlmext_info;
 
pmlmepriv->update_bcn = false;
pmlmeext->bstart_bss = false;
@@ -76,7 +76,7 @@ static void update_BCNTIM(struct adapter *padapter)
 
/* update TIM IE */
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen,
-   pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
+  pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
if (p && tim_ielen > 0) {
tim_ielen += 2;
premainder_ie = p + tim_ielen;
@@ -97,7 +97,7 @@ static void update_BCNTIM(struct adapter *padapter)
   &tmp_len, (pnetwork_mlmeext->IELength -
  _BEACON_IE_OFFSET_));
if (p)
-   offset += tmp_len+2;
+   offset += tmp_len + 2;
 
/* DS Parameter Set IE, len = 3 */
offset += 3;
@@ -119,7 +119,7 @@ static void update_BCNTIM(struct adapter *padapter)
}
*dst_ie++ = _TIM_IE_;
 
-   if ((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
+   if ((pstapriv->tim_bitmap & 0xff00) && (pstapriv->tim_bitmap & 0x00fc))
tim_ielen = 5;
else
tim_ielen = 4;
@@ -129,7 +129,7 @@ static void update_BCNTIM(struct adapter *padapter)
*dst_ie++ = 0;/* DTIM count */
*dst_ie++ = 1;/* DTIM period */
 
-   if (pstapriv->tim_bitmap&BIT(0))/* for bc/mc frames */
+   if (pstapriv->tim_bitmap & BIT(0))/* for bc/mc frames */
*dst_ie++ = BIT(0);/* bitmap ctrl */
else
*dst_ie++ = 0;
@@ -314,7 +314,6 @@ voidexpire_timeout_chk(struct adapter *padapter)
spin_lock_bh(&pstapriv->auth_list_lock);
}
}
-
}
spin_unlock_bh(&pstapriv->auth_list_lock);
 
@@ -635,9 +634,7 @@ void update_sta_info_apmode(struct adapter *padapter, 
struct sta_info *psta)
else
psta->ieee8021x_blocked = false;
 
-
/* update sta's cap */
-
/* ERP */
VCS_update(padapter, psta);
/* HT related cap */
@@ -694,9 +691,9 @@ static void update_hw_ht_param(struct adapter *padapter)
 
/* handle A-MPDU parameter field */
/*
-   ampdu_params_info [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 
3:64k
-   ampdu_params_info [4:2]:Min MPDU Start Spacing
-   */
+*  ampdu_params_info [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 
3:64k
+*  ampdu_params_info [4:2]:Min MPDU Start Spacing
+*/
max_AMPDU_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x03;
 
min_MPDU_spacing = (pmlmeinfo->HT_caps.ampdu_params_info & 0x1c) >> 2;
@@ -734,7 +731,6 @@ static void start_bss_network(struct adapter *padapter, u8 
*pbuf)
cur_bwmode = HT_CHANNEL_WIDTH_20;
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
 
-
/* check if there is wps ie,
 * if there is wpsie in beacon, the hostapd will update
 * beacon twice when stating hostapd, and at first time the
@@ -884,7 +880,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true)
return _FAIL;
 
-
if (len < 0 || len > MAX_IE_SZ)
return _FAIL;
 
@@ -894,7 +889,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
 
memcpy(ie, pbuf, pbss_network->IELength);
 
-
if (pbss_network->InfrastructureMode != Ndis802_11APMode)
return _FAIL;
 
@@ -1043,14 +1037,14 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
(psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP))
pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY & (0x07 << 2));
else
-   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
+   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AM

Re: [PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount

2017-08-01 Thread Stephen Hemminger
On Tue,  1 Aug 2017 12:11:12 -0700
Florian Fainelli  wrote:

> On 32-bit hosts and with CONFIG_DEBUG_LOCK_ALLOC we should be seeing a
> lockdep splat indicating this seqcount is not correctly initialized, fix
> that. In commit 6c80f3fc2398 ("netvsc: report per-channel stats in
> ethtool statistics") netdev_alloc_pcpu_stats() was removed in favor of
> open-coding the 64-bits statistics, except that u64_stats_init() was
> missed.
> 
> Fixes: 6c80f3fc2398 ("netvsc: report per-channel stats in ethtool statistics")
> Signed-off-by: Florian Fainelli 
> ---
>  drivers/net/hyperv/netvsc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
> index 0a9167dd72fb..96f90c75d1b7 100644
> --- a/drivers/net/hyperv/netvsc.c
> +++ b/drivers/net/hyperv/netvsc.c
> @@ -1302,6 +1302,8 @@ int netvsc_device_add(struct hv_device *device,
>   struct netvsc_channel *nvchan = &net_device->chan_table[i];
>  
>   nvchan->channel = device->channel;
> + u64_stats_init(&nvchan->tx_stats.syncp);
> + u64_stats_init(&nvchan->rx_stats.syncp);
>   }
>  
>   /* Enable NAPI handler before init callbacks */


Looks good, thanks. 32 bit guests are still supported but rarely tested.

Signed-off-by: Stephen Hemminger 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH net-next v3 0/3] netvsc: transparent VF support

2017-08-01 Thread Stephen Hemminger
This patch set changes how SR-IOV Virtual Function devices are managed
in the Hyper-V network driver. This version is rebased onto current net-next.

Background

In Hyper-V SR-IOV can be enabled (and disabled) by changing guest settings
on host. When SR-IOV is enabled a matching PCI device is hot plugged and
visible on guest. The VF device is an add-on to an existing netvsc
device, and has the same MAC address.

How is this different?

The original support of VF relied on using bonding driver in active
standby mode to handle the VF device.

With the new netvsc VF logic, the Linux hyper-V network
virtual driver will directly manage the link to SR-IOV VF device.
When VF device is detected (hot plug) it is automatically made a
slave device of the netvsc device. The VF device state reflects
the state of the netvsc device; i.e. if netvsc is set down, then
VF is set down. If netvsc is set up, then VF is brought up.
 
Packet flow is independent of VF status; all packets are sent and
received as if they were associated with the netvsc device. If VF is
removed or link is down then the synthetic VMBUS path is used.
 
What was wrong with using bonding script?

A lot of work went into getting the bonding script to work on all
distributions, but it was a major struggle. Linux network devices
can be configured many, many ways and there is no one solution from
userspace to make it all work. What is really hard is when
configuration is attached to synthetic device during boot (eth0) and
then the same addresses and firewall rules needs to also work later if
doing bonding. The new code gets around all of this.
 
How does VF work during initialization?

Since all packets are sent and received through the logical netvsc
device, initialization is much easier. Just configure the regular
netvsc Ethernet device; when/if SR-IOV is enabled it just
works. Provisioning and cloud init only need to worry about setting up
netvsc device (eth0). If SR-IOV is enabled (even as a later step), the
address and rules stay the same.
 
What devices show up?

Both netvsc and PCI devices are visible in the system. The netvsc
device is active and named in usual manner (eth0). The PCI device is
visible to Linux and gets renamed by udev to a persistent name
(enP2p3s0). The PCI device name is now irrelevant now.

The logic also sets the PCI VF device SLAVE flag on the network
device so network tools can see the relationship if they are smart
enough to understand how layered devices work.
 
This is a lot like how I see Windows working.
The VF device is visible in Device Manager, but is not configured.
 
Is there any performance impact?
There is no visible change in performance. The bonding
and netvsc driver both have equivalent steps.
 
Is it compatible with old bonding script?

It turns out that if you use the old bonding script, then everything
still works but in a sub-optimum manner. What happens is that bonding
is unable to steal the VF from the netvsc device so it creates a one
legged bond.  Packet flow then is:
bond0 <--> eth0 <- -> VF (enP2p3s0).
In other words, if you get it wrong it still works, just
awkward and slower.
 
What if I add address or firewall rule onto the VF?

Same problems occur with now as already occur with bonding, bridging,
teaming on Linux if user incorrectly does configuration onto
an underlying slave device. It will sort of work, packets will come in
and out but the Linux kernel gets confused and things like ARP don’t
work right.  There is no way to block manipulation of the slave
device, and I am sure someone will find some special use case where
they want it.

Stephen Hemminger (3):
  netvsc: transparent VF management
  netvsc: add documentation
  netvsc: remove bonding setup script

 Documentation/networking/netvsc.txt |  63 ++
 MAINTAINERS |   1 +
 drivers/net/hyperv/hyperv_net.h |  12 ++
 drivers/net/hyperv/netvsc_drv.c | 419 
 tools/hv/bondvf.sh  | 255 --
 5 files changed, 406 insertions(+), 344 deletions(-)
 create mode 100644 Documentation/networking/netvsc.txt
 delete mode 100755 tools/hv/bondvf.sh

-- 
2.11.0

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


[PATCH net-next v3 2/3] netvsc: add documentation

2017-08-01 Thread Stephen Hemminger
Add some background documentation on netvsc device options
and limitations.

Signed-off-by: Stephen Hemminger 
---
 Documentation/networking/netvsc.txt | 63 +
 MAINTAINERS |  1 +
 2 files changed, 64 insertions(+)
 create mode 100644 Documentation/networking/netvsc.txt

diff --git a/Documentation/networking/netvsc.txt 
b/Documentation/networking/netvsc.txt
new file mode 100644
index ..4ddb4e4b0426
--- /dev/null
+++ b/Documentation/networking/netvsc.txt
@@ -0,0 +1,63 @@
+Hyper-V network driver
+==
+
+Compatibility
+=
+
+This driver is compatible with Windows Server 2012 R2, 2016 and
+Windows 10.
+
+Features
+
+
+  Checksum offload
+  
+  The netvsc driver supports checksum offload as long as the
+  Hyper-V host version does. Windows Server 2016 and Azure
+  support checksum offload for TCP and UDP for both IPv4 and
+  IPv6. Windows Server 2012 only supports checksum offload for TCP.
+
+  Receive Side Scaling
+  
+  Hyper-V supports receive side scaling. For TCP, packets are
+  distributed among available queues based on IP address and port
+  number. Current versions of Hyper-V host, only distribute UDP
+  packets based on the IP source and destination address.
+  The port number is not used as part of the hash value for UDP.
+  Fragmented IP packets are not distributed between queues;
+  all fragmented packets arrive on the first channel.
+
+  Generic Receive Offload, aka GRO
+  
+  The driver supports GRO and it is enabled by default. GRO coalesces
+  like packets and significantly reduces CPU usage under heavy Rx
+  load.
+
+  SR-IOV support
+  --
+  Hyper-V supports SR-IOV as a hardware acceleration option. If SR-IOV
+  is enabled in both the vSwitch and the guest configuration, then the
+  Virtual Function (VF) device is passed to the guest as a PCI
+  device. In this case, both a synthetic (netvsc) and VF device are
+  visible in the guest OS and both NIC's have the same MAC address.
+
+  The VF is enslaved by netvsc device.  The netvsc driver will transparently
+  switch the data path to the VF when it is available and up.
+  Network state (addresses, firewall, etc) should be applied only to the
+  netvsc device; the slave device should not be accessed directly in
+  most cases.  The exceptions are if some special queue discipline or
+  flow direction is desired, these should be applied directly to the
+  VF slave device.
+
+  Receive Buffer
+  --
+  Packets are received into a receive area which is created when device
+  is probed. The receive area is broken into MTU sized chunks and each may
+  contain one or more packets. The number of receive sections may be changed
+  via ethtool Rx ring parameters.
+
+  There is a similar send buffer which is used to aggregate packets for 
sending.
+  The send area is broken into chunks of 6144 bytes, each of section may
+  contain one or more packets. The send buffer is an optimization, the driver
+  will use slower method to handle very large packets or if the send buffer
+  area is exhausted.
diff --git a/MAINTAINERS b/MAINTAINERS
index 207e45310620..448f2f67802f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6258,6 +6258,7 @@ M:Haiyang Zhang 
 M: Stephen Hemminger 
 L: de...@linuxdriverproject.org
 S: Maintained
+F: Documentation/networking/netvsc.txt
 F: arch/x86/include/asm/mshyperv.h
 F: arch/x86/include/uapi/asm/hyperv.h
 F: arch/x86/kernel/cpu/mshyperv.c
-- 
2.11.0

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


[PATCH net-next v3 3/3] netvsc: remove bonding setup script

2017-08-01 Thread Stephen Hemminger
No longer needed, now all managed by transparent VF logic.

Signed-off-by: Stephen Hemminger 
---
 tools/hv/bondvf.sh | 255 -
 1 file changed, 255 deletions(-)
 delete mode 100755 tools/hv/bondvf.sh

diff --git a/tools/hv/bondvf.sh b/tools/hv/bondvf.sh
deleted file mode 100755
index 80f102860cf8..
--- a/tools/hv/bondvf.sh
+++ /dev/null
@@ -1,255 +0,0 @@
-#!/bin/bash
-
-# This example script creates bonding network devices based on synthetic NIC
-# (the virtual network adapter usually provided by Hyper-V) and the matching
-# VF NIC (SRIOV virtual function). So the synthetic NIC and VF NIC can
-# function as one network device, and fail over to the synthetic NIC if VF is
-# down.
-#
-# Usage:
-# - After configured vSwitch and vNIC with SRIOV, start Linux virtual
-#   machine (VM)
-# - Run this scripts on the VM. It will create configuration files in
-#   distro specific directory.
-# - Reboot the VM, so that the bonding config are enabled.
-#
-# The config files are DHCP by default. You may edit them if you need to change
-# to Static IP or change other settings.
-#
-
-sysdir=/sys/class/net
-netvsc_cls={f8615163-df3e-46c5-913f-f2d2f965ed0e}
-bondcnt=0
-
-# Detect Distro
-if [ -f /etc/redhat-release ];
-then
-   cfgdir=/etc/sysconfig/network-scripts
-   distro=redhat
-elif grep -q 'Ubuntu' /etc/issue
-then
-   cfgdir=/etc/network
-   distro=ubuntu
-elif grep -q 'SUSE' /etc/issue
-then
-   cfgdir=/etc/sysconfig/network
-   distro=suse
-else
-   echo "Unsupported Distro"
-   exit 1
-fi
-
-echo Detected Distro: $distro, or compatible
-
-# Get a list of ethernet names
-list_eth=(`cd $sysdir && ls -d */ | cut -d/ -f1 | grep -v bond`)
-eth_cnt=${#list_eth[@]}
-
-echo List of net devices:
-
-# Get the MAC addresses
-for (( i=0; i < $eth_cnt; i++ ))
-do
-   list_mac[$i]=`cat $sysdir/${list_eth[$i]}/address`
-   echo ${list_eth[$i]}, ${list_mac[$i]}
-done
-
-# Find NIC with matching MAC
-for (( i=0; i < $eth_cnt-1; i++ ))
-do
-   for (( j=i+1; j < $eth_cnt; j++ ))
-   do
-   if [ "${list_mac[$i]}" = "${list_mac[$j]}" ]
-   then
-   list_match[$i]=${list_eth[$j]}
-   break
-   fi
-   done
-done
-
-function create_eth_cfg_redhat {
-   local fn=$cfgdir/ifcfg-$1
-
-   rm -f $fn
-   echo DEVICE=$1 >>$fn
-   echo TYPE=Ethernet >>$fn
-   echo BOOTPROTO=none >>$fn
-   echo UUID=`uuidgen` >>$fn
-   echo ONBOOT=yes >>$fn
-   echo PEERDNS=yes >>$fn
-   echo IPV6INIT=yes >>$fn
-   echo MASTER=$2 >>$fn
-   echo SLAVE=yes >>$fn
-}
-
-function create_eth_cfg_pri_redhat {
-   create_eth_cfg_redhat $1 $2
-}
-
-function create_bond_cfg_redhat {
-   local fn=$cfgdir/ifcfg-$1
-
-   rm -f $fn
-   echo DEVICE=$1 >>$fn
-   echo TYPE=Bond >>$fn
-   echo BOOTPROTO=dhcp >>$fn
-   echo UUID=`uuidgen` >>$fn
-   echo ONBOOT=yes >>$fn
-   echo PEERDNS=yes >>$fn
-   echo IPV6INIT=yes >>$fn
-   echo BONDING_MASTER=yes >>$fn
-   echo BONDING_OPTS=\"mode=active-backup miimon=100 primary=$2\" >>$fn
-}
-
-function del_eth_cfg_ubuntu {
-   local mainfn=$cfgdir/interfaces
-   local fnlist=( $mainfn )
-
-   local dirlist=(`awk '/^[ \t]*source/{print $2}' $mainfn`)
-
-   local i
-   for i in "${dirlist[@]}"
-   do
-   fnlist+=(`ls $i 2>/dev/null`)
-   done
-
-   local tmpfl=$(mktemp)
-
-   local nic_start='^[ \t]*(auto|iface|mapping|allow-.*)[ \t]+'$1
-   local nic_end='^[ \t]*(auto|iface|mapping|allow-.*|source)'
-
-   local fn
-   for fn in "${fnlist[@]}"
-   do
-   awk "/$nic_end/{x=0} x{next} /$nic_start/{x=1;next} 1" \
-   $fn >$tmpfl
-
-   cp $tmpfl $fn
-   done
-
-   rm $tmpfl
-}
-
-function create_eth_cfg_ubuntu {
-   local fn=$cfgdir/interfaces
-
-   del_eth_cfg_ubuntu $1
-   echo $'\n'auto $1 >>$fn
-   echo iface $1 inet manual >>$fn
-   echo bond-master $2 >>$fn
-}
-
-function create_eth_cfg_pri_ubuntu {
-   local fn=$cfgdir/interfaces
-
-   del_eth_cfg_ubuntu $1
-   echo $'\n'allow-hotplug $1 >>$fn
-   echo iface $1 inet manual >>$fn
-   echo bond-master $2 >>$fn
-   echo bond-primary $1 >>$fn
-}
-
-function create_bond_cfg_ubuntu {
-   local fn=$cfgdir/interfaces
-
-   del_eth_cfg_ubuntu $1
-
-   echo $'\n'auto $1 >>$fn
-   echo iface $1 inet dhcp >>$fn
-   echo bond-mode active-backup >>$fn
-   echo bond-miimon 100 >>$fn
-   echo bond-slaves none >>$fn
-}
-
-function create_eth_cfg_suse {
-local fn=$cfgdir/ifcfg-$1
-
-rm -f $fn
-   echo BOOTPROTO=none >>$fn
-   echo STARTMODE=auto >>$fn
-}
-
-function create_eth_cfg_pri_suse {
-   local fn=$cfgdir/ifcfg-$1
-
-   rm -f $fn
-   echo BOOTPROTO=none >>$fn
-   echo STARTMODE=hotplug >>$fn
-}
-
-f

[PATCH net-next v3 1/3] netvsc: transparent VF management

2017-08-01 Thread Stephen Hemminger
This patch implements transparent fail over from synthetic NIC to
SR-IOV virtual function NIC in Hyper-V environment. It is a better
alternative to using bonding as is done now. Instead, the receive and
transmit fail over is done internally inside the driver.

Using bonding driver has lots of issues because it depends on the
script being run early enough in the boot process and with sufficient
information to make the association. This patch moves all that
functionality into the kernel.

Signed-off-by: Stephen Hemminger 
---
v3 - fix merge conflict (due to comment change) 

 drivers/net/hyperv/hyperv_net.h |  12 ++
 drivers/net/hyperv/netvsc_drv.c | 419 +++-
 2 files changed, 342 insertions(+), 89 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index f2cef5aaed1f..c701b059c5ac 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -680,6 +680,15 @@ struct netvsc_ethtool_stats {
unsigned long tx_busy;
 };
 
+struct netvsc_vf_pcpu_stats {
+   u64 rx_packets;
+   u64 rx_bytes;
+   u64 tx_packets;
+   u64 tx_bytes;
+   struct u64_stats_sync   syncp;
+   u32 tx_dropped;
+};
+
 struct netvsc_reconfig {
struct list_head list;
u32 event;
@@ -713,6 +722,9 @@ struct net_device_context {
 
/* State to manage the associated VF interface. */
struct net_device __rcu *vf_netdev;
+   struct netvsc_vf_pcpu_stats __percpu *vf_stats;
+   struct work_struct vf_takeover;
+   struct work_struct vf_notify;
 
/* 1: allocated, serial number is valid. 0: not allocated */
u32 vf_alloc;
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 9453eef6d09f..c71728d82049 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -71,6 +72,7 @@ static void netvsc_set_multicast_list(struct net_device *net)
 static int netvsc_open(struct net_device *net)
 {
struct net_device_context *ndev_ctx = netdev_priv(net);
+   struct net_device *vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);
struct netvsc_device *nvdev = rtnl_dereference(ndev_ctx->nvdev);
struct rndis_device *rdev;
int ret = 0;
@@ -87,15 +89,29 @@ static int netvsc_open(struct net_device *net)
netif_tx_wake_all_queues(net);
 
rdev = nvdev->extension;
-   if (!rdev->link_state && !ndev_ctx->datapath)
+
+   if (!rdev->link_state)
netif_carrier_on(net);
 
-   return ret;
+   if (vf_netdev) {
+   /* Setting synthetic device up transparently sets
+* slave as up. If open fails, then slave will be
+* still be offline (and not used).
+*/
+   ret = dev_open(vf_netdev);
+   if (ret)
+   netdev_warn(net,
+   "unable to open slave: %s: %d\n",
+   vf_netdev->name, ret);
+   }
+   return 0;
 }
 
 static int netvsc_close(struct net_device *net)
 {
struct net_device_context *net_device_ctx = netdev_priv(net);
+   struct net_device *vf_netdev
+   = rtnl_dereference(net_device_ctx->vf_netdev);
struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);
int ret;
u32 aread, i, msec = 10, retry = 0, retry_max = 20;
@@ -141,6 +157,9 @@ static int netvsc_close(struct net_device *net)
ret = -ETIMEDOUT;
}
 
+   if (vf_netdev)
+   dev_close(vf_netdev);
+
return ret;
 }
 
@@ -224,13 +243,11 @@ static inline int netvsc_get_tx_queue(struct net_device 
*ndev,
  *
  * TODO support XPS - but get_xps_queue not exported
  */
-static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
-   void *accel_priv, select_queue_fallback_t fallback)
+static u16 netvsc_pick_tx(struct net_device *ndev, struct sk_buff *skb)
 {
-   unsigned int num_tx_queues = ndev->real_num_tx_queues;
int q_idx = sk_tx_queue_get(skb->sk);
 
-   if (q_idx < 0 || skb->ooo_okay) {
+   if (q_idx < 0 || skb->ooo_okay || q_idx >= ndev->real_num_tx_queues) {
/* If forwarding a packet, we use the recorded queue when
 * available for better cache locality.
 */
@@ -240,12 +257,33 @@ static u16 netvsc_select_queue(struct net_device *ndev, 
struct sk_buff *skb,
q_idx = netvsc_get_tx_queue(ndev, skb, q_idx);
}
 
-   while (unlikely(q_idx >= num_tx_queues))
-   q_idx -= num_tx_queues;
-
return q_idx;
 }
 
+static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
+  void *accel_priv,
+  select_queue_fallbac

[PATCH] staging: lustre: declare fiemap_for_stripe static

2017-08-01 Thread David Wittman
Declare fiemap_for_stripe as static to fix sparse warnings:

> warning: symbol 'fiemap_for_stripe' was not declared. Should it be
> static?

Signed-off-by: David Wittman 
---
 drivers/staging/lustre/lustre/lov/lov_object.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c 
b/drivers/staging/lustre/lustre/lov/lov_object.c
index 8fc0bcc..334ecb1 100644
--- a/drivers/staging/lustre/lustre/lov/lov_object.c
+++ b/drivers/staging/lustre/lustre/lov/lov_object.c
@@ -1141,11 +1141,11 @@ struct fiemap_state {
boolfs_enough;
 };
 
-int fiemap_for_stripe(const struct lu_env *env, struct cl_object *obj,
- struct lov_stripe_md *lsm,
- struct fiemap *fiemap, size_t *buflen,
- struct ll_fiemap_info_key *fmkey, int stripeno,
- struct fiemap_state *fs)
+static int fiemap_for_stripe(const struct lu_env *env, struct cl_object *obj,
+struct lov_stripe_md *lsm,
+struct fiemap *fiemap, size_t *buflen,
+struct ll_fiemap_info_key *fmkey, int stripeno,
+struct fiemap_state *fs)
 {
struct cl_object *subobj;
struct lov_obd *lov = lu2lov_dev(obj->co_lu.lo_dev)->ld_lov;
-- 
2.7.4

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