Re: [staging:staging-testing 754/791] drivers/staging/lustre/lustre/ptlrpc/errno.c:49:3: error: 'ENXIO' undeclared here (not in a function)

2018-05-26 Thread Greg Kroah-Hartman
On Fri, May 25, 2018 at 09:40:09PM +0200, Greg Kroah-Hartman wrote:
> On Sat, May 26, 2018 at 02:04:59AM +0800, kbuild test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
> > staging-testing
> > head:   0badacd779df08fbbc895cf6c488e100b86c1f39
> > commit: 0922c0084b91799193059a47bfbd215ffd3a4b50 [754/791] staging: lustre: 
> > remove libcfs_all from ptlrpc
> > config: ia64-allmodconfig (attached as .config)
> > compiler: ia64-linux-gcc (GCC) 8.1.0
> > reproduce:
> > wget 
> > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> > ~/bin/make.cross
> > chmod +x ~/bin/make.cross
> > git checkout 0922c0084b91799193059a47bfbd215ffd3a4b50
> > # save the attached .config to linux build tree
> > make.cross ARCH=ia64 
> > 
> > All error/warnings (new ones prefixed by >>):
> > 
> >drivers/staging/lustre/lustre/ptlrpc/errno.c:44:3: error: 'EPERM' 
> > undeclared here (not in a function)
> >  [EPERM]   = LUSTRE_EPERM,
> >   ^
> 
> 
> 
> Neil, looks like some .h files still need to be included.  Care to fix
> these up?

I've now done this, let's see if it catches all of the odd arch
issues...

thanks,

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


[PATCH v4 3/5] staging: rtl8192e: Correct indentation of switch statements - coding style

2018-05-26 Thread John Whitmore
Two switch statements had wrong indentation of 'case' options

Signed-off-by: John Whitmore 
---
 .../staging/rtl8192u/ieee80211/rtl819x_HTProc.c| 48 +++---
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 2cf67b50a995..1b61a8de1edf 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -177,35 +177,35 @@ void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tPrimary channel = %d\n", 
pHTInfoEle->ControlChl);
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSecondary channel =");
switch (pHTInfoEle->ExtChlOffset) {
-   case 0:
-   IEEE80211_DEBUG(IEEE80211_DL_HT, "Not Present\n");
-   break;
-   case 1:
-   IEEE80211_DEBUG(IEEE80211_DL_HT, "Upper channel\n");
-   break;
-   case 2:
-   IEEE80211_DEBUG(IEEE80211_DL_HT, "Reserved. 
Eooro!!!\n");
-   break;
-   case 3:
-   IEEE80211_DEBUG(IEEE80211_DL_HT, "Lower Channel\n");
-   break;
+   case 0:
+   IEEE80211_DEBUG(IEEE80211_DL_HT, "Not Present\n");
+   break;
+   case 1:
+   IEEE80211_DEBUG(IEEE80211_DL_HT, "Upper channel\n");
+   break;
+   case 2:
+   IEEE80211_DEBUG(IEEE80211_DL_HT, "Reserved. Eooro!!!\n");
+   break;
+   case 3:
+   IEEE80211_DEBUG(IEEE80211_DL_HT, "Lower Channel\n");
+   break;
}
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tRecommended channel width = %s\n", 
(pHTInfoEle->RecommemdedTxWidth) ? "20Mhz" : "40Mhz");
 
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tOperation mode for protection = ");
switch (pHTInfoEle->OptMode) {
-   case 0:
-   IEEE80211_DEBUG(IEEE80211_DL_HT, "No Protection\n");
-   break;
-   case 1:
-   IEEE80211_DEBUG(IEEE80211_DL_HT, "HT non-member 
protection mode\n");
-   break;
-   case 2:
-   IEEE80211_DEBUG(IEEE80211_DL_HT, "Suggest to open 
protection\n");
-   break;
-   case 3:
-   IEEE80211_DEBUG(IEEE80211_DL_HT, "HT mixed mode\n");
-   break;
+   case 0:
+   IEEE80211_DEBUG(IEEE80211_DL_HT, "No Protection\n");
+   break;
+   case 1:
+   IEEE80211_DEBUG(IEEE80211_DL_HT, "HT non-member protection 
mode\n");
+   break;
+   case 2:
+   IEEE80211_DEBUG(IEEE80211_DL_HT, "Suggest to open 
protection\n");
+   break;
+   case 3:
+   IEEE80211_DEBUG(IEEE80211_DL_HT, "HT mixed mode\n");
+   break;
}
 
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tBasic MCS Rate Set = 
[%x][%x][%x][%x][%x]\n", pHTInfoEle->BasicMSC[0],\
-- 
2.16.3

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


[PATCH v4 4/5] staging: rtl8192e: Add and remove blank lines - Coding style

2018-05-26 Thread John Whitmore
Coding style requires blank line after definitions and function definition,
blank lines removed. Correction of some indentation.

Signed-off-by: John Whitmore 
---
 .../staging/rtl8192u/ieee80211/rtl819x_HTProc.c| 96 --
 1 file changed, 34 insertions(+), 62 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 1b61a8de1edf..8021b96771dc 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -111,9 +111,8 @@ void HTUpdateDefaultSetting(struct ieee80211_device *ieee)
pHTInfo->UsbRxFwAggrPacketNum = 8;
pHTInfo->UsbRxFwAggrTimeout = 16; usb rx FW aggregation timeout 
threshold.It's in units of 64us
 #endif
-
-
 }
+
 
/
  *function:  This function print out each field on HT capability IE mainly 
from (Beacon/ProbeRsp/AssocReq)
  *   input:  u8*   CapIE   //Capability IE to be printed out
@@ -124,7 +123,6 @@ void HTUpdateDefaultSetting(struct ieee80211_device *ieee)
  * 
*/
 void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
 {
-
static u8   EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33};   // For 
11n EWC definition, 2007.07.17, by Emily
PHT_CAPABILITY_ELE  pCapELE;
 
@@ -150,6 +148,7 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
return;
 
 }
+
 
/
  *function:  This function print out each field on HT Information IE mainly 
from (Beacon/ProbeRsp)
  *   input:  u8*   InfoIE   //Capability IE to be printed out
@@ -271,7 +270,6 @@ u16 HTHalfMcsToDataRate(struct ieee80211_device *ieee,  
u8  nMcsRate)
return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate&0x7f)];
 }
 
-
 u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate)
 {
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
@@ -326,12 +324,11 @@ u16  TxCountToDataRate(struct ieee80211_device *ieee, u8 
nDataRate)
}
 }
 
-
-
 bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee)
 {
boolretValue = false;
struct ieee80211_network *net = &ieee->current_network;
+
if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
(memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
(memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
@@ -364,6 +361,7 @@ static void HTIOTPeerDetermine(struct ieee80211_device 
*ieee)
 {
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
struct ieee80211_network *net = &ieee->current_network;
+
if (net->bssht.bdRT2RTAggregation)
pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK;
else if (net->broadcom_cap_exist)
@@ -389,6 +387,7 @@ static void HTIOTPeerDetermine(struct ieee80211_device 
*ieee)
 
IEEE80211_DEBUG(IEEE80211_DL_IOT, "Joseph debug!! IOTPEER: %x\n", 
pHTInfo->IOTPeer);
 }
+
 
/
  *function:  Check whether driver should declare received rate up to MCS13 
only since some chipset is not good
  *  at receiving MCS14~15 frame from some AP.
@@ -400,8 +399,7 @@ static void HTIOTPeerDetermine(struct ieee80211_device 
*ieee)
 static u8 HTIOTActIsDisableMCS14(struct ieee80211_device *ieee, u8 
*PeerMacAddr)
 {
return 0;
- }
-
+}
 
 /**
 * Function:HTIOTActIsDisableMCS15
@@ -496,6 +494,7 @@ static u8 HTIOTActIsMgntUseCCK6M(struct ieee80211_network 
*network)
 static u8 HTIOTActIsCCDFsync(u8 *PeerMacAddr)
 {
u8  retValue = 0;
+
if ((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3) == 0) ||
(memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) == 0) 
||
(memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) == 0))
@@ -504,15 +503,12 @@ static u8 HTIOTActIsCCDFsync(u8 *PeerMacAddr)
return retValue;
 }
 
-void HTResetIOTSetting(
-   PRT_HIGH_THROUGHPUT pHTInfo
-)
+void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo)
 {
pHTInfo->IOTAction = 0;
pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN;
 }
 
-
 
/
  *function:  Construct Capablility Element in Beacon... if HTEnable is turned 
on
  *   input:  struct ieee80211_device*  ieee
@@ -536,13 +532,13 @@ void HTConstructCapabilityElement(struct ieee80211_device 
*ieee, u8 *posHTCap, u
memset(posHTCap, 0, *len);
if (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC) {
u8  EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33};  

[PATCH v4 5/5] staging: rtl8192e: Remove unrequired blank lines - Coding Style

2018-05-26 Thread John Whitmore
Missed these in the last pass. Coding style does not require blank line after
opening brace of a function.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 8021b96771dc..87d0e46b7bf5 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -146,7 +146,6 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMCS Rate Set = 
[%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],\
pCapELE->MCS[1], pCapELE->MCS[2], 
pCapELE->MCS[3], pCapELE->MCS[4]);
return;
-
 }
 
 
/
@@ -159,7 +158,6 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
  * 
*/
 void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString)
 {
-
static u8   EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34};  // For 
11n EWC definition, 2007.07.17, by Emily
PHT_INFORMATION_ELE pHTInfoEle;
 
@@ -260,7 +258,6 @@ static bool IsHTHalfNmodeSGI(struct ieee80211_device *ieee, 
bool is40MHz)
 
 u16 HTHalfMcsToDataRate(struct ieee80211_device *ieee, u8  nMcsRate)
 {
-
u8  is40MHz;
u8  isShortGI;
 
@@ -613,7 +610,6 @@ void HTConstructCapabilityElement(struct ieee80211_device 
*ieee, u8 *posHTCap, u
//Print each field in detail. Driver should not print out this message 
by default
 // HTDebugHTCapability(posHTCap, (u8*)"HTConstructCapability()");
return;
-
 }
 
 
/
@@ -1117,7 +1113,6 @@ void HTInitializeHTInfo(struct ieee80211_device *ieee)
 
/
 void HTInitializeBssDesc(PBSS_HT pBssHT)
 {
-
pBssHT->bdSupportHT = false;
memset(pBssHT->bdHTCapBuf, 0, sizeof(pBssHT->bdHTCapBuf));
pBssHT->bdHTCapLen = 0;
-- 
2.16.3

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


[PATCH v4 1/5] staging: rtl8192e: Add spaces where required by coding standard

2018-05-26 Thread John Whitmore
There were numerous coding syle errors in this file where spaces were required
around operators.

Signed-off-by: John Whitmore 
---
 .../staging/rtl8192u/ieee80211/rtl819x_HTProc.c| 126 ++---
 1 file changed, 63 insertions(+), 63 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 6952dab6ec80..0a8be54fea4a 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -60,8 +60,8 @@ void HTUpdateDefaultSetting(struct ieee80211_device *ieee)
//printk("pHTinfo:%p, &pHTinfo:%p, mptr:%p,  offsetof:%x\n", pHTInfo, 
&pHTInfo, __mptr, offsetof(struct ieee80211_device, pHTInfo));
//printk("===>ieee:%p,\n", ieee);
// ShortGI support
-   pHTInfo->bRegShortGI20MHz= 1;
-   pHTInfo->bRegShortGI40MHz= 1;
+   pHTInfo->bRegShortGI20MHz = 1;
+   pHTInfo->bRegShortGI40MHz = 1;
 
// 40MHz channel support
pHTInfo->bRegBW40MHz = 1;
@@ -138,12 +138,12 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString )
 
IEEE80211_DEBUG(IEEE80211_DL_HT, ". Called by %s\n", 
TitleString );
 
-   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupported Channel Width = %s\n", 
(pCapELE->ChlWidth)?"20MHz": "20/40MHz");
-   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupport Short GI for 20M = %s\n", 
(pCapELE->ShortGI20Mhz)?"YES": "NO");
-   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupport Short GI for 40M = %s\n", 
(pCapELE->ShortGI40Mhz)?"YES": "NO");
-   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupport TX STBC = %s\n", 
(pCapELE->TxSTBC)?"YES": "NO");
-   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMax AMSDU Size = %s\n", 
(pCapELE->MaxAMSDUSize)?"3839": "7935");
-   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupport CCK in 20/40 mode = %s\n", 
(pCapELE->DssCCk)?"YES": "NO");
+   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupported Channel Width = %s\n", 
(pCapELE->ChlWidth) ? "20MHz" : "20/40MHz");
+   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupport Short GI for 20M = %s\n", 
(pCapELE->ShortGI20Mhz) ? "YES" : "NO");
+   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupport Short GI for 40M = %s\n", 
(pCapELE->ShortGI40Mhz) ? "YES" : "NO");
+   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupport TX STBC = %s\n", 
(pCapELE->TxSTBC) ? "YES" : "NO");
+   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMax AMSDU Size = %s\n", 
(pCapELE->MaxAMSDUSize) ? "3839" : "7935");
+   IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupport CCK in 20/40 mode = %s\n", 
(pCapELE->DssCCk) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMax AMPDU Factor = %d\n", 
pCapELE->MaxRxAMPDUFactor);
IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMPDU Density = %d\n", 
pCapELE->MPDUDensity);
IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMCS Rate Set = 
[%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],\
@@ -193,7 +193,7 @@ void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT, "Lower Channel\n");
break;
}
-   IEEE80211_DEBUG(IEEE80211_DL_HT, "\tRecommended channel width = %s\n", 
(pHTInfoEle->RecommemdedTxWidth)?"20Mhz": "40Mhz");
+   IEEE80211_DEBUG(IEEE80211_DL_HT, "\tRecommended channel width = %s\n", 
(pHTInfoEle->RecommemdedTxWidth) ? "20Mhz" : "40Mhz");
 
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tOperation mode for protection = ");
switch (pHTInfoEle->OptMode)
@@ -272,8 +272,8 @@ u16 HTHalfMcsToDataRate(struct ieee80211_device *ieee,  
u8  nMcsRate)
u8  is40MHz;
u8  isShortGI;
 
-   is40MHz  =  (IsHTHalfNmode40Bandwidth(ieee))?1:0;
-   isShortGI = (IsHTHalfNmodeSGI(ieee, is40MHz))? 1:0;
+   is40MHz = (IsHTHalfNmode40Bandwidth(ieee)) ? 1 : 0;
+   isShortGI = (IsHTHalfNmodeSGI(ieee, is40MHz)) ? 1 : 0;
 
return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate&0x7f)];
 }
@@ -283,10 +283,10 @@ u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 
nMcsRate)
 {
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
 
-   u8  is40MHz = (pHTInfo->bCurBW40MHz)?1:0;
-   u8  isShortGI = (pHTInfo->bCurBW40MHz)?
-   
((pHTInfo->bCurShortGI40MHz)?1:0):
-   
((pHTInfo->bCurShortGI20MHz)?1:0);
+   u8  is40MHz = (pHTInfo->bCurBW40MHz) ? 1 : 0;
+   u8  isShortGI = (pHTInfo->bCurBW40MHz) ?
+   ((pHTInfo->bCurShortGI40MHz) ? 
1 : 0) :
+   ((pHTInfo->bCurShortGI20MHz) ? 
1 : 0);
return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate&0x7f)];
 }
 
@@ -318,7 +318,7 @@ u16  TxCountToDataRate(struct ieee80211_device *ieee, u8 
nDataRate)
 
  // nDataRate = nDataRate - 12;
}
-   else if (nDataRate >=0x20  && nDataRate <= 0x2f ) //(27, 44)
+   else if (nDataRate >= 0x20  && nDa

[PATCH v4] staging: rtl8192e: Coding style changes

2018-05-26 Thread John Whitmore
five patches with simple coding style changes to the file
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c

The last two patches should probably have been combined as both dealt with the
addition or removal of blank lines, but I missed one style issue on the first
pass. In that situation I guess I should possibly roll back the previous
commit and re-edit?

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


[PATCH v4 2/5] staging: rtl8192e: correct position of '{', '}', '(' and ')' - coding style

2018-05-26 Thread John Whitmore
Correct the coding style of parenthesis and braces in various code blocks

Signed-off-by: John Whitmore 
---
 .../staging/rtl8192u/ieee80211/rtl819x_HTProc.c| 217 -
 1 file changed, 79 insertions(+), 138 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 0a8be54fea4a..2cf67b50a995 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -7,28 +7,28 @@ u8 MCS_FILTER_ALL[16] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0
 
 u8 MCS_FILTER_1SS[16] = {0xff, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
-u16 MCS_DATA_RATE[2][2][77] =
-   {   {   {13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78, 104, 
156, 208, 234, 260,
-   39, 78, 117, 234, 312, 351, 390, 52, 104, 156, 208, 
312, 416, 468, 520,
-   0, 78, 104, 130, 117, 156, 195, 104, 130, 130, 156, 
182, 182, 208, 156, 195,
-   195, 234, 273, 273, 312, 130, 156, 181, 156, 181, 208, 
234, 208, 234, 260, 260,
-   286, 195, 234, 273, 234, 273, 312, 351, 312, 351, 390, 
390, 429},   // Long GI, 20MHz
-   {14, 29, 43, 58, 87, 116, 130, 144, 29, 58, 87, 116, 
173, 231, 260, 289,
-   43, 87, 130, 173, 260, 347, 390, 433, 58, 116, 173, 
231, 347, 462, 520, 578,
-   0, 87, 116, 144, 130, 173, 217, 116, 144, 144, 173, 
202, 202, 231, 173, 217,
-   217, 260, 303, 303, 347, 144, 173, 202, 173, 202, 231, 
260, 231, 260, 289, 289,
-   318, 217, 260, 303, 260, 303, 347, 390, 347, 390, 433, 
433, 477}},  // Short GI, 20MHz
-   {   {27, 54, 81, 108, 162, 216, 243, 270, 54, 108, 162, 
216, 324, 432, 486, 540,
-   81, 162, 243, 324, 486, 648, 729, 810, 108, 216, 324, 
432, 648, 864, 972, 1080,
-   12, 162, 216, 270, 243, 324, 405, 216, 270, 270, 324, 
378, 378, 432, 324, 405,
-   405, 486, 567, 567, 648, 270, 324, 378, 324, 378, 432, 
486, 432, 486, 540, 540,
-   594, 405, 486, 567, 486, 567, 648, 729, 648, 729, 810, 
810, 891},   // Long GI, 40MHz
-   {30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 
240, 360, 480, 540, 600,
-   90, 180, 270, 360, 540, 720, 810, 900, 120, 240, 360, 
480, 720, 960, 1080, 1200,
-   13, 180, 240, 300, 270, 360, 450, 240, 300, 300, 360, 
420, 420, 480, 360, 450,
-   450, 540, 630, 630, 720, 300, 360, 420, 360, 420, 480, 
540, 480, 540, 600, 600,
-   660, 450, 540, 630, 540, 630, 720, 810, 720, 810, 900, 
900, 990}}   // Short GI, 40MHz
-   };
+u16 MCS_DATA_RATE[2][2][77] = {
+   {   {13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78, 104, 156, 208, 
234, 260,
+39, 78, 117, 234, 312, 351, 390, 52, 104, 156, 208, 312, 416, 
468, 520,
+0, 78, 104, 130, 117, 156, 195, 104, 130, 130, 156, 182, 182, 
208, 156, 195,
+195, 234, 273, 273, 312, 130, 156, 181, 156, 181, 208, 234, 
208, 234, 260, 260,
+286, 195, 234, 273, 234, 273, 312, 351, 312, 351, 390, 390, 
429},  // Long GI, 20MHz
+   {14, 29, 43, 58, 87, 116, 130, 144, 29, 58, 87, 116, 173, 231, 
260, 289,
+43, 87, 130, 173, 260, 347, 390, 433, 58, 116, 173, 231, 347, 
462, 520, 578,
+0, 87, 116, 144, 130, 173, 217, 116, 144, 144, 173, 202, 202, 
231, 173, 217,
+217, 260, 303, 303, 347, 144, 173, 202, 173, 202, 231, 260, 
231, 260, 289, 289,
+318, 217, 260, 303, 260, 303, 347, 390, 347, 390, 433, 433, 
477}   },  // Short GI, 20MHz
+   {   {27, 54, 81, 108, 162, 216, 243, 270, 54, 108, 162, 216, 324, 
432, 486, 540,
+81, 162, 243, 324, 486, 648, 729, 810, 108, 216, 324, 432, 
648, 864, 972, 1080,
+12, 162, 216, 270, 243, 324, 405, 216, 270, 270, 324, 378, 
378, 432, 324, 405,
+405, 486, 567, 567, 648, 270, 324, 378, 324, 378, 432, 486, 
432, 486, 540, 540,
+594, 405, 486, 567, 486, 567, 648, 729, 648, 729, 810, 810, 
891},  // Long GI, 40MHz
+   {30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 240, 360, 
480, 540, 600,
+90, 180, 270, 360, 540, 720, 810, 900, 120, 240, 360, 480, 
720, 960, 1080, 1200,
+13, 180, 240, 300, 270, 360, 450, 240, 300, 300, 360, 420, 
420, 480, 360, 450,
+450, 540, 630, 630, 720, 300, 360, 420, 360, 420, 480, 540, 
480, 540, 600, 600,
+660, 450, 540, 630, 540, 630, 720, 810, 720, 810, 900, 900, 
990}   }   // Short GI, 40MHz
+};
 
 static u8 UNKNOWN_BORADCOM[3] =

Re: [PATCH v1] media: staging: tegra-vde: Reset memory client

2018-05-26 Thread Dmitry Osipenko
On 20.05.2018 16:48, Dmitry Osipenko wrote:
> DMA requests must be blocked before resetting VDE HW, otherwise it is
> possible to get a memory corruption or a machine hang. Use the reset
> control provided by the Memory Controller to block DMA before resetting
> the VDE HW.
> 
> Signed-off-by: Dmitry Osipenko 
> ---
>  drivers/staging/media/tegra-vde/tegra-vde.c | 42 +++--
>  1 file changed, 38 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/tegra-vde/tegra-vde.c 
> b/drivers/staging/media/tegra-vde/tegra-vde.c
> index 90177a59b97c..6dd3bf4481be 100644
> --- a/drivers/staging/media/tegra-vde/tegra-vde.c
> +++ b/drivers/staging/media/tegra-vde/tegra-vde.c
> @@ -73,6 +73,7 @@ struct tegra_vde {
>   struct mutex lock;
>   struct miscdevice miscdev;
>   struct reset_control *rst;
> + struct reset_control *rst_mc;
>   struct gen_pool *iram_pool;
>   struct completion decode_completion;
>   struct clk *clk;
> @@ -850,9 +851,23 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde 
> *vde,
>* We rely on the VDE registers reset value, otherwise VDE
>* causes bus lockup.
>*/
> + ret = reset_control_assert(vde->rst_mc);
> + if (ret) {
> + dev_err(dev, "DEC start: Failed to assert MC reset: %d\n",
> + ret);
> + goto put_runtime_pm;
> + }
> +
>   ret = reset_control_reset(vde->rst);
>   if (ret) {
> - dev_err(dev, "Failed to reset HW: %d\n", ret);
> + dev_err(dev, "DEC start: Failed to reset HW: %d\n", ret);
> + goto put_runtime_pm;
> + }
> +
> + ret = reset_control_deassert(vde->rst_mc);
> + if (ret) {
> + dev_err(dev, "DEC start: Failed to deassert MC reset: %d\n",
> + ret);
>   goto put_runtime_pm;
>   }
>  
> @@ -880,9 +895,21 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde 
> *vde,
>   ret = timeout;
>   }
>  
> - err = reset_control_assert(vde->rst);
> - if (err)
> - dev_err(dev, "Failed to assert HW reset: %d\n", err);
> + /*
> +  * At first reset memory client to avoid resetting VDE HW in the
> +  * middle of DMA which could result into memory corruption or hang
> +  * the whole system.
> +  */
> + err = reset_control_assert(vde->rst_mc);
> + if (!err) {

It occurred to me that there is no need to skip the HW reset if MC resetting
fails. I'll make V2 to change that.

> + err = reset_control_assert(vde->rst);
> + if (err)
> + dev_err(dev,
> + "DEC end: Failed to assert HW reset: %d\n",
> + err);
> + } else {
> + dev_err(dev, "DEC end: Failed to assert MC reset: %d\n", err);
> + }
>  
>  put_runtime_pm:
>   pm_runtime_mark_last_busy(dev);
> @@ -1074,6 +1101,13 @@ static int tegra_vde_probe(struct platform_device 
> *pdev)
>   return err;
>   }
>  
> + vde->rst_mc = devm_reset_control_get_optional(dev, "mc");
> + if (IS_ERR(vde->rst_mc)) {
> + err = PTR_ERR(vde->rst_mc);
> + dev_err(dev, "Could not get MC reset %d\n", err);
> + return err;
> + }
> +
>   irq = platform_get_irq_byname(pdev, "sync-token");
>   if (irq < 0)
>   return irq;
> 

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


Prize Notice!

2018-05-26 Thread Miriam Inaki
Microsoft Iberica S.L Lottery Intl. Program
FOREIGN SERVICE SECTION BARCELONA.
REFERENCE NUMBER:BYQCX7ZPO63
BATCH NUMBER: 2018/HZK/3NW/127

OFFICIAL WINNING NOTIFICATION.

We are pleased to inform you of the released results of the Microsoft Iberica 
S.L
Sweepstakes Promotion in conjunction with foundations for the promotion of 
software
products organized for Software users.

This Program was held in Barcelona- Spain; Wherein your email address
emerged as one of the online Winning emails in the 1st category and
therefore attracted a cash award of EUR344,000.00 and a Mac Laptop/iPhone X.
Your laptop, certificate of winnings and your cheque of (EUR344,000.00)
will be sent to your contact address in your location.

To file for claims of the release of your winnings,
Contact the Customer Service Officer with the information below:

1.FULL NAMES:
2.ADDRESS:
3.SEX:
4.AGE:
5.MARITAL STATUS:
6.OCCUPATION:
7.TELEPHONE NUMBER:
8.COUNTRY:
9. BATCH NUMBER:
10. REFERENCE NUMBER:

Email: cuservd...@excite.co.jp
Contact Person: Manuel Vizner [CSO]

Congratulations!!

Sincerely,
Mrs. Miriam Inaki
Online Coordinator
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] media: staging: tegra-vde: Reset memory client

2018-05-26 Thread Dmitry Osipenko
DMA requests must be blocked before resetting VDE HW, otherwise it is
possible to get a memory corruption or a machine hang. Use the reset
control provided by the Memory Controller to block DMA before resetting
the VDE HW.

Signed-off-by: Dmitry Osipenko 
---

Changelog:

v2:
- Reset HW even if Memory Client resetting fails.

 drivers/staging/media/tegra-vde/tegra-vde.c | 35 +++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/tegra-vde/tegra-vde.c 
b/drivers/staging/media/tegra-vde/tegra-vde.c
index 90177a59b97c..6f06061a40d9 100644
--- a/drivers/staging/media/tegra-vde/tegra-vde.c
+++ b/drivers/staging/media/tegra-vde/tegra-vde.c
@@ -73,6 +73,7 @@ struct tegra_vde {
struct mutex lock;
struct miscdevice miscdev;
struct reset_control *rst;
+   struct reset_control *rst_mc;
struct gen_pool *iram_pool;
struct completion decode_completion;
struct clk *clk;
@@ -850,9 +851,23 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde 
*vde,
 * We rely on the VDE registers reset value, otherwise VDE
 * causes bus lockup.
 */
+   ret = reset_control_assert(vde->rst_mc);
+   if (ret) {
+   dev_err(dev, "DEC start: Failed to assert MC reset: %d\n",
+   ret);
+   goto put_runtime_pm;
+   }
+
ret = reset_control_reset(vde->rst);
if (ret) {
-   dev_err(dev, "Failed to reset HW: %d\n", ret);
+   dev_err(dev, "DEC start: Failed to reset HW: %d\n", ret);
+   goto put_runtime_pm;
+   }
+
+   ret = reset_control_deassert(vde->rst_mc);
+   if (ret) {
+   dev_err(dev, "DEC start: Failed to deassert MC reset: %d\n",
+   ret);
goto put_runtime_pm;
}
 
@@ -880,9 +895,18 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde 
*vde,
ret = timeout;
}
 
+   /*
+* At first reset memory client to avoid resetting VDE HW in the
+* middle of DMA which could result into memory corruption or hang
+* the whole system.
+*/
+   err = reset_control_assert(vde->rst_mc);
+   if (err)
+   dev_err(dev, "DEC end: Failed to assert MC reset: %d\n", err);
+
err = reset_control_assert(vde->rst);
if (err)
-   dev_err(dev, "Failed to assert HW reset: %d\n", err);
+   dev_err(dev, "DEC end: Failed to assert HW reset: %d\n", err);
 
 put_runtime_pm:
pm_runtime_mark_last_busy(dev);
@@ -1074,6 +1098,13 @@ static int tegra_vde_probe(struct platform_device *pdev)
return err;
}
 
+   vde->rst_mc = devm_reset_control_get_optional(dev, "mc");
+   if (IS_ERR(vde->rst_mc)) {
+   err = PTR_ERR(vde->rst_mc);
+   dev_err(dev, "Could not get MC reset %d\n", err);
+   return err;
+   }
+
irq = platform_get_irq_byname(pdev, "sync-token");
if (irq < 0)
return irq;
-- 
2.17.0

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


Re: [PATCH net-next 6/7] net: bridge: Notify about bridge VLANs

2018-05-26 Thread Vivien Didelot
Hi Petr,

Petr Machata  writes:

> Vivien Didelot  writes:
>
>>> +   } else {
>>> +   err = br_switchdev_port_obj_add(dev, v->vid, flags);
>>> +   if (err && err != -EOPNOTSUPP)
>>> +   goto out;
>>> }
>>
>> Except that br_switchdev_port_obj_add taking vid and flags arguments
>> seems confusing to me, the change looks good:
>
> I'm not sure what you're aiming at. Both VID and flags are sent with the
> notification, so they need to be passed on to the function somehow. Do
> you have a counterproposal for the API?

I'm only questioning the code organization here, not the functional
aspect which I do agree with. What I'm saying is that you name a new
switchdev helper br_switchdev_port_OBJ_add, which takes VLAN arguments
(vid and flags.) How would you call another eventual helper taking MDB
arguments, br_switchdev_port_OBJ_add again? So something like
br_switchdev_port_VLAN_add would be more intuitive.

At the same time there's an effort to centralize all switchdev helpers
of the bridge layer (i.e. the software -> hardware bridge calls) into
net/bridge/br_switchdev.c, so that file would be more adequate.

You may discard my comments but I think it'd be beneficial to us all to
finally keep a bit of consistency in that bridge layer code.


Thanks,

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


[PATCH] staging: rtlwifi: use single_open and single_release properly

2018-05-26 Thread Tiezhu Yang
single_open() returns -ENOMEM when malloc failed, so the caller function
rtl_debugfs_open_rw() should not always return 0. In addition, when using
single_open(), we should use single_release() instead of seq_release() in
the file_operations structure to avoid a memory leak.

Signed-off-by: Tiezhu Yang 
---
 drivers/staging/rtlwifi/debug.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtlwifi/debug.c b/drivers/staging/rtlwifi/debug.c
index c041bc3..bf360f8 100644
--- a/drivers/staging/rtlwifi/debug.c
+++ b/drivers/staging/rtlwifi/debug.c
@@ -95,7 +95,7 @@ static int dl_debug_open_common(struct inode *inode, struct 
file *file)
.open = dl_debug_open_common,
.read = seq_read,
.llseek = seq_lseek,
-   .release = seq_release,
+   .release = single_release,
 };
 
 static int rtl_debug_get_mac_page(struct seq_file *m, void *v)
@@ -485,18 +485,20 @@ static int rtl_debug_get_phydm_cmd(struct seq_file *m, 
void *v)
 
 static int rtl_debugfs_open_rw(struct inode *inode, struct file *filp)
 {
+   int ret = 0;
+
if (filp->f_mode & FMODE_READ)
-   single_open(filp, rtl_debug_get_common, inode->i_private);
+   ret = single_open(filp, rtl_debug_get_common, inode->i_private);
else
filp->private_data = inode->i_private;
 
-   return 0;
+   return ret;
 }
 
 static int rtl_debugfs_close_rw(struct inode *inode, struct file *filp)
 {
if (filp->f_mode == FMODE_READ)
-   seq_release(inode, filp);
+   single_release(inode, filp);
 
return 0;
 }
-- 
1.8.3.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: speakup: remove simple_strtoul()

2018-05-26 Thread Gabriel Fedel
Replace simple_strtoul() with kstrtoul(), because simple_strtoul() is
obsolete. 

kstrtoul and simple_strtoul are not equal, so some new code was
inserted:

It was necessary to pass to kstrtoul just number part (new variable num).

temp variable was setted manually (to position after cp number part).

Signed-off-by: Gabriel Fedel 
---
Changes since first patch:

Fix C error
Change the way to use kstrtoul (on first patch just substitue simple_strtoul by
kstrtoul)

---
 drivers/staging/speakup/kobjects.c | 27 +--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index f1f9022..50dc456 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -117,6 +117,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
char *outptr = NULL;/* Will hold keyword or desc. */
char *temp = NULL;
char *desc = NULL;
+   char *num = NULL; /* The number part of cp */
ssize_t retval = count;
unsigned long flags;
unsigned long index = 0;
@@ -154,7 +155,17 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
continue;
}
 
-   index = simple_strtoul(cp, &temp, 10);
+   i = 0;
+   while (isdigit(*(cp + i)))
+   i = i + 1;
+   temp = cp + i;
+
+   num = kmalloc(i + 2, GFP_ATOMIC);
+   strscpy(num, cp, i + 1);
+
+   if (kstrtoul(num, 10, &index) != 0)
+   pr_warn("overflow or parsing error has occurred");
+
if (index > 255) {
rejected++;
cp = linefeed + 1;
@@ -751,6 +762,7 @@ static ssize_t message_store_helper(const char *buf, size_t 
count,
char *end = cp + count;
char *linefeed = NULL;
char *temp = NULL;
+   char *num = NULL;
ssize_t msg_stored = 0;
ssize_t retval = count;
size_t desc_length = 0;
@@ -759,6 +771,7 @@ static ssize_t message_store_helper(const char *buf, size_t 
count,
int used = 0;
int rejected = 0;
int reset = 0;
+   int i;
enum msg_index_t firstmessage = group->start;
enum msg_index_t lastmessage = group->end;
enum msg_index_t curmessage;
@@ -787,7 +800,17 @@ static ssize_t message_store_helper(const char *buf, 
size_t count,
continue;
}
 
-   index = simple_strtoul(cp, &temp, 10);
+   i = 0;
+   while (isdigit(*(cp + i)))
+   i = i + 1;
+
+   temp = cp + i;
+
+   num = kmalloc(i + 2, GFP_ATOMIC);
+   strscpy(num, cp, i + 1);
+
+   if  (kstrtoul(num, 10, &index) != 0)
+   pr_warn("overflow or parsing error has occurred");
 
while ((temp < linefeed) && (*temp == ' ' || *temp == '\t'))
temp++;
-- 
2.1.4

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


Re: [PATCH v2] staging: speakup: remove simple_strtoul()

2018-05-26 Thread Samuel Thibault
Hello,

Gabriel Fedel, le sam. 26 mai 2018 16:03:35 -0300, a ecrit:
> Replace simple_strtoul() with kstrtoul(), because simple_strtoul() is
> obsolete. 

Well, rather than putting again a dozen lines of code, if simple_strtoul
is really considered to be obsolete, a replacement should be defined so
we can use it instead (and not duplicate the dozen lines of code in each
please where kstrtoul is not enough).

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