Re: [PATCH] staging: rtl8192u: ieee80211: rtl819x_TSProc: Fixed coding style issue

2017-05-03 Thread Joe Perches
On Tue, 2017-05-02 at 20:24 -0400, Fabrizio Perria wrote:
> Fixed checkpatch.pl issue
> ERROR: that open brace { should be on the previous line
[]
> diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c 
> b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
[]
> @@ -338,8 +338,7 @@ bool GetTs(
>   else
>   {
>   // In WMM case: we use 4 TID only
> - if (!IsACValid(TID))
> - {
> + if (!IsACValid(TID)) {
>   IEEE80211_DEBUG(IEEE80211_DL_ERR, " in %s(), TID(%d) is 
> not valid\n", __func__, TID);
>   return false;
>   }

Why fix only one of these?

$ ./scripts/checkpatch.pl --show-types --strict 
--types=else_after_brace,open_brace,braces --terse \
  -f drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c

drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:39: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:42: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:48: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:62: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:62: ERROR:ELSE_AFTER_BRACE: 
else should follow close brace '}'
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:70: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:84: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:150: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:175: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:194: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:203: CHECK:BRACES: Blank 
lines aren't necessary before a close brace '}'
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:226: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:228: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:233: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:233: 
ERROR:ELSE_AFTER_BRACE: else should follow close brace '}'
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:239: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:239: 
ERROR:ELSE_AFTER_BRACE: else should follow close brace '}'
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:246: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:246: 
ERROR:ELSE_AFTER_BRACE: else should follow close brace '}'
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:248: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:254: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:254: 
ERROR:ELSE_AFTER_BRACE: else should follow close brace '}'
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:268: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:276: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:282: CHECK:BRACES: Blank 
lines aren't necessary before a close brace '}'
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:287: WARNING:BRACES: braces 
{} are not necessary for any arm of this statement
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:290: 
ERROR:ELSE_AFTER_BRACE: else should follow close brace '}'
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:330: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:338: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:341: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:347: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:376: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:380: ERROR:OPEN_BRACE: that 
open brace { should be on the previous line
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c:380: 
ERROR:ELSE_AFTER_BRACE: else 

Re: [PATCH] staging : rtl8188eu : remove void function return

2017-05-03 Thread Dan Carpenter
On Wed, May 03, 2017 at 11:29:00AM +0530, Surender Polsani wrote:
> kernel coding style doesn't allow the return statement
> in void function.
> 
> Signed-off-by: Surender Polsani 
> ---
> Changes for v2:
> corrected subject line as suggested
> Changes for v3:
> modified from line as suggested by Greg KH
> placed a semicolon in label for fixing build error
> ---
>  drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c 
> b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> index d04b7fb..428996e 100644
> --- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> @@ -165,7 +165,7 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
>  skip_dm:
>   /*  Check GPIO to determine current RF on/off and Pbc status. */
>   /*  Check Hardware Radio ON/OFF or not */
> - return;
> + ;

Just get rid of the label.

regards,
dan carpenter

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


[PATCH] staging : rtl8188eu : remove void function return

2017-05-03 Thread Surender Polsani
kernel coding style doesn't allow the return statement
in void function.

Signed-off-by: Surender Polsani 
---
Changes for v2:
corrected subject line as suggested
Changes for v3:
modified from line as suggested by Greg KH
placed a semicolon in label for fixing build error
Changes for v4:
removed label as suggested by Dan Carpenter
---
 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
index d04b7fb..f3871a5 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
@@ -144,8 +144,8 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
 
hw_init_completed = Adapter->hw_init_completed;
 
-   if (!hw_init_completed)
-   goto skip_dm;
+   if (hw_init_completed)
+   {
 
/* ODM */
pmlmepriv = &Adapter->mlmepriv;
@@ -162,10 +162,9 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
 
Adapter->HalData->odmpriv.bLinked = bLinked;
ODM_DMWatchdog(&Adapter->HalData->odmpriv);
-skip_dm:
+   }
/*  Check GPIO to determine current RF on/off and Pbc status. */
/*  Check Hardware Radio ON/OFF or not */
-   return;
 }
 
 void rtw_hal_dm_init(struct adapter *Adapter)
-- 
1.9.1

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


Re: [PATCH] staging : rtl8188eu : remove void function return

2017-05-03 Thread Dan Carpenter
Nope.

regards,
dan carpenter

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


[PATCH] staging: rtl8192u: ieee80211: rtl819x_TSProc: Fixed brace placement issues

2017-05-03 Thread Fabrizio Perria
Fixed multiple checkpatch.pl issues regarding open brace placement,
else (after a brace) placement, unnecessary braces (single statement branches)
and space before closing brace.

To get the list of errors, the following command has been executed:
./scripts/checkpatch.pl --show-types --strict \
--types=else_after_brace,open_brace,braces --terse \
-f drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c

Signed-off-by: Fabrizio Perria 
---
 .../staging/rtl8192u/ieee80211/rtl819x_TSProc.c| 171 +++--
 1 file changed, 55 insertions(+), 116 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index b4c13ff..f98bb03 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -36,18 +36,15 @@ static void RxPktPendingTimeout(unsigned long data)
 
spin_lock_irqsave(&(ieee->reorder_spinlock), flags);

IEEE80211_DEBUG(IEEE80211_DL_REORDER,"==>%s()\n",__func__);
-   if(pRxTs->RxTimeoutIndicateSeq != 0x)
-   {
+   if(pRxTs->RxTimeoutIndicateSeq != 0x) {
// Indicate the pending packets sequentially according to 
SeqNum until meet the gap.
-   while(!list_empty(&pRxTs->RxPendingPktList))
-   {
+   while(!list_empty(&pRxTs->RxPendingPktList)) {
pReorderEntry = 
(PRX_REORDER_ENTRY)list_entry(pRxTs->RxPendingPktList.prev,RX_REORDER_ENTRY,List);
if(index == 0)
pRxTs->RxIndicateSeq = pReorderEntry->SeqNum;
 
if( SN_LESS(pReorderEntry->SeqNum, 
pRxTs->RxIndicateSeq) ||
-   SN_EQUAL(pReorderEntry->SeqNum, 
pRxTs->RxIndicateSeq)   )
-   {
+   SN_EQUAL(pReorderEntry->SeqNum, 
pRxTs->RxIndicateSeq)   ) {
list_del_init(&pReorderEntry->List);
 
if(SN_EQUAL(pReorderEntry->SeqNum, 
pRxTs->RxIndicateSeq))
@@ -58,22 +55,19 @@ static void RxPktPendingTimeout(unsigned long data)
index++;
 
list_add_tail(&pReorderEntry->List, 
&ieee->RxReorder_Unused_List);
-   }
-   else
-   {
+   } else {
bPktInBuf = true;
break;
}
}
}
 
-   if(index>0)
-   {
+   if(index>0) {
// Set RxTimeoutIndicateSeq to 0x to indicate no pending 
packets in buffer now.
pRxTs->RxTimeoutIndicateSeq = 0x;
 
// Indicate packets
-   if(index > REORDER_WIN_SIZE){
+   if(index > REORDER_WIN_SIZE) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, 
"RxReorderIndicatePacket(): Rx Reorder buffer full!! \n");
spin_unlock_irqrestore(&(ieee->reorder_spinlock), 
flags);
return;
@@ -81,8 +75,7 @@ static void RxPktPendingTimeout(unsigned long data)
ieee80211_indicate_packets(ieee, ieee->stats_IndicateArray, 
index);
}
 
-   if(bPktInBuf && (pRxTs->RxTimeoutIndicateSeq==0x))
-   {
+   if(bPktInBuf && (pRxTs->RxTimeoutIndicateSeq==0x)) {
pRxTs->RxTimeoutIndicateSeq = pRxTs->RxIndicateSeq;
mod_timer(&pRxTs->RxPktPendingTimer,
  jiffies + 
msecs_to_jiffies(ieee->pHTInfo->RxReorderPendingTime));
@@ -147,8 +140,7 @@ void TSInitialize(struct ieee80211_device *ieee)
INIT_LIST_HEAD(&ieee->Tx_TS_Pending_List);
INIT_LIST_HEAD(&ieee->Tx_TS_Unused_List);
 
-   for(count = 0; count < TOTAL_TS_NUM; count++)
-   {
+   for(count = 0; count < TOTAL_TS_NUM; count++) {
//
pTxTS->num = count;
// The timers for the operation of Traffic Stream and Block Ack.
@@ -172,8 +164,7 @@ void TSInitialize(struct ieee80211_device *ieee)
INIT_LIST_HEAD(&ieee->Rx_TS_Admit_List);
INIT_LIST_HEAD(&ieee->Rx_TS_Pending_List);
INIT_LIST_HEAD(&ieee->Rx_TS_Unused_List);
-   for(count = 0; count < TOTAL_TS_NUM; count++)
-   {
+   for(count = 0; count < TOTAL_TS_NUM; count++) {
pRxTS->num = count;
INIT_LIST_HEAD(&pRxTS->RxPendingPktList);
setup_timer(&pRxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut,
@@ -191,15 +182,13 @@ void TSInitialize(struct ieee80211_device *ieee)
// Initialize unused Rx Reorder List.
INIT_LIST_HEAD(&ieee->RxReorder_Unused_List);
 //#ifdef TO_DO_LIST
-   for(count = 0; count < REORDER_ENTRY_NUM; count++)
-   {
+   for(count = 0; count < REORDER_ENTRY_NUM; count++) {
list_add_tail( 
&pRxReorder

[PATCH] staging: vt6656: rtxt.c Fix CODE_INDENT type errors

2017-05-03 Thread Salvatore Benedetto
Fix all CODE_INDENT type errors reported by checkpatch
in rtxt.c

Signed-off-by: Salvatore Benedetto 
---
 drivers/staging/vt6656/rxtx.c | 49 ++-
 1 file changed, 25 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 1835cd1..2516c49 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -114,7 +114,7 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, 
u16 rate)
 }
 
 static u32 vnt_get_rsvtime(struct vnt_private *priv, u8 pkt_type,
-   u32 frame_length, u16 rate, int need_ack)
+  u32 frame_length, u16 rate, int need_ack)
 {
u32 data_time, ack_time;
 
@@ -135,14 +135,15 @@ static u32 vnt_get_rsvtime(struct vnt_private *priv, u8 
pkt_type,
 }
 
 static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
-u32 frame_length, u16 rate, int need_ack)
+   u32 frame_length, u16 rate, int need_ack)
 {
return cpu_to_le16((u16)vnt_get_rsvtime(priv, pkt_type,
frame_length, rate, need_ack));
 }
 
-static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv,
-u8 rsv_type, u8 pkt_type, u32 
frame_length, u16 current_rate)
+static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv, u8 rsv_type,
+   u8 pkt_type, u32 frame_length,
+   u16 current_rate)
 {
u32 rrv_time, rts_time, cts_time, ack_time, data_time;
 
@@ -159,20 +160,20 @@ static __le16 vnt_get_rtscts_rsvtime_le(struct 
vnt_private *priv,
} else if (rsv_type == 1) {
rts_time = vnt_get_frame_time(priv->preamble_type,
pkt_type, 20, priv->top_cck_basic_rate);
-   cts_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 14, priv->top_cck_basic_rate);
-   ack_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 14, priv->top_ofdm_basic_rate);
+   cts_time = vnt_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->top_cck_basic_rate);
+   ack_time = vnt_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->top_ofdm_basic_rate);
} else if (rsv_type == 2) {
-   rts_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 20, priv->top_ofdm_basic_rate);
+   rts_time = vnt_get_frame_time(priv->preamble_type, pkt_type, 20,
+ priv->top_ofdm_basic_rate);
cts_time = ack_time = vnt_get_frame_time(priv->preamble_type,
pkt_type, 14, priv->top_ofdm_basic_rate);
} else if (rsv_type == 3) {
-   cts_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 14, priv->top_cck_basic_rate);
-   ack_time = vnt_get_frame_time(priv->preamble_type, pkt_type,
- 14, priv->top_ofdm_basic_rate);
+   cts_time = vnt_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->top_cck_basic_rate);
+   ack_time = vnt_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->top_ofdm_basic_rate);
 
rrv_time = cts_time + ack_time + data_time + 2 * priv->sifs;
 
@@ -226,8 +227,8 @@ static __le16 vnt_get_rtscts_duration_le(struct 
vnt_usb_send_context *context,
case RTSDUR_AA:
case RTSDUR_AA_F0:
case RTSDUR_AA_F1:
-   cts_time = vnt_get_frame_time(priv->preamble_type,
- pkt_type, 14, 
priv->top_ofdm_basic_rate);
+   cts_time = vnt_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->top_ofdm_basic_rate);
dur_time = cts_time + 2 * priv->sifs +
vnt_get_rsvtime(priv, pkt_type,
frame_length, rate, need_ack);
@@ -410,7 +411,7 @@ static u16 vnt_rxtx_rts_g_head(struct vnt_usb_send_context 
*tx_context,
u16 current_rate = tx_context->tx_rate;
 
vnt_get_phy_field(priv, rts_frame_len, priv->top_cck_basic_rate,
- PK_TYPE_11B, &buf->b);
+ PK_TYPE_11B, &buf->b);
vnt_get_phy_field(priv, rts_frame_len, priv->top_ofdm_basic_rate,
  tx_context->pkt_type, &buf->a);
 
@@ -437,7 +438,7 @@ static u16 vnt_rxtx_rts_g_fb_head(struct 
vnt_usb_send_context *tx_context,
u16 rts_frame_len = 20;
 
 

[PATCH] staging: android: ion: Align with open parenthesis

2017-05-03 Thread Richard Porter
Fix checkpatch.pl warning:

CHECK: Alignment should match open parenthesis
+   fd = ion_alloc(data.allocation.len,
+   data.allocation.heap_id_mask,

Signed-off-by: Richard Porter 
---
 drivers/staging/android/ion/ion-ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/ion/ion-ioctl.c 
b/drivers/staging/android/ion/ion-ioctl.c
index 76427e4..d9f8b14 100644
--- a/drivers/staging/android/ion/ion-ioctl.c
+++ b/drivers/staging/android/ion/ion-ioctl.c
@@ -83,8 +83,8 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned 
long arg)
int fd;
 
fd = ion_alloc(data.allocation.len,
-   data.allocation.heap_id_mask,
-   data.allocation.flags);
+  data.allocation.heap_id_mask,
+  data.allocation.flags);
if (fd < 0)
return fd;
 
-- 
2.7.4

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


RE: [PATCH] staging: unisys: Solve sparse warning

2017-05-03 Thread Kershner, David A
> -Original Message-
> From: Marcos Paulo de Souza [mailto:marcos.souza@gmail.com]
> Sent: Tuesday, May 2, 2017 11:28 PM
> Cc: Marcos Paulo de Souza ; Kershner, David
> A ; Greg Kroah-Hartman
> ; Sell, Timothy C ;
> Binder, David Anthony ; Erik Arfvidson
> ; Wadgaonkar, Sameer Laxmikant
> ; Curtin, Alexander Paul
> ; *S-Par-Maintainer
> ; de...@driverdev.osuosl.org; linux-
> ker...@vger.kernel.org
> Subject: [PATCH] staging: unisys: Solve sparse warning
> 
> The following commit fixes the following sparse report:
> 
> drivers/staging//unisys/visorhba/visorhba_main.c:660:29: warning: cast to
> restricted __le64
> 
> by casting readq (which is unsigned long on x86) to u64, as expected by the
> seq_printf call.
> 
> Signed-off-by: Marcos Paulo de Souza 
> ---
>  Just compiled tested on x86_64.
> 
>  drivers/staging/unisys/visorhba/visorhba_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c
> b/drivers/staging/unisys/visorhba/visorhba_main.c
> index 6997b16..46d33e6 100644
> --- a/drivers/staging/unisys/visorhba/visorhba_main.c
> +++ b/drivers/staging/unisys/visorhba/visorhba_main.c
> @@ -657,7 +657,7 @@ static int info_debugfs_show(struct seq_file *seq,
> void *v)
>   seq_printf(seq, "phys_flags_addr = 0x%016llx\n",
>  phys_flags_addr);
>   seq_printf(seq, "FeatureFlags = %llu\n",
> -(__le64)readq(devdata->flags_addr));
> +(u64)readq(devdata->flags_addr));

Acked-by: David Kershner 

>   }
>   seq_printf(seq, "acquire_failed_cnt = %llu\n",
>  devdata->acquire_failed_cnt);
> --
> 2.9.3

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


Re: [PATCH] staging: ccree: Fix trailing whitespace checkpatch warnings

2017-05-03 Thread Greg KH
On Wed, May 03, 2017 at 06:47:07PM +0200, Timothée Isnard wrote:
> Signed-off-by: Timothée Isnard 

I can't take patches without any changelog text at all :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v1] vmbus: Reuse uuid_le_to_bin() helper

2017-05-03 Thread Andy Shevchenko
Instead of open coded variant use generic helper to convert UUID strings
to binary format.

Signed-off-by: Andy Shevchenko 
---
 drivers/hv/vmbus_drv.c | 51 ++
 1 file changed, 10 insertions(+), 41 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index b41a2be778f6..fa2a6fa59480 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -608,40 +608,6 @@ static void vmbus_free_dynids(struct hv_driver *drv)
spin_unlock(&drv->dynids.lock);
 }
 
-/* Parse string of form: 1b4e28ba-2fa1-11d2-883f-b9a761bde3f */
-static int get_uuid_le(const char *str, uuid_le *uu)
-{
-   unsigned int b[16];
-   int i;
-
-   if (strlen(str) < 37)
-   return -1;
-
-   for (i = 0; i < 36; i++) {
-   switch (i) {
-   case 8: case 13: case 18: case 23:
-   if (str[i] != '-')
-   return -1;
-   break;
-   default:
-   if (!isxdigit(str[i]))
-   return -1;
-   }
-   }
-
-   /* unparse little endian output byte order */
-   if (sscanf(str,
-  "%2x%2x%2x%2x-%2x%2x-%2x%2x-%2x%2x-%2x%2x%2x%2x%2x%2x",
-  &b[3], &b[2], &b[1], &b[0],
-  &b[5], &b[4], &b[7], &b[6], &b[8], &b[9],
-  &b[10], &b[11], &b[12], &b[13], &b[14], &b[15]) != 16)
-   return -1;
-
-   for (i = 0; i < 16; i++)
-   uu->b[i] = b[i];
-   return 0;
-}
-
 /*
  * store_new_id - sysfs frontend to vmbus_add_dynid()
  *
@@ -651,11 +617,12 @@ static ssize_t new_id_store(struct device_driver *driver, 
const char *buf,
size_t count)
 {
struct hv_driver *drv = drv_to_hv_drv(driver);
-   uuid_le guid = NULL_UUID_LE;
+   uuid_le guid;
ssize_t retval;
 
-   if (get_uuid_le(buf, &guid) != 0)
-   return -EINVAL;
+   retval = uuid_le_to_bin(buf, &guid);
+   if (retval)
+  return retval;
 
if (hv_vmbus_get_id(drv, &guid))
return -EEXIST;
@@ -677,12 +644,14 @@ static ssize_t remove_id_store(struct device_driver 
*driver, const char *buf,
 {
struct hv_driver *drv = drv_to_hv_drv(driver);
struct vmbus_dynid *dynid, *n;
-   uuid_le guid = NULL_UUID_LE;
-   size_t retval = -ENODEV;
+   uuid_le guid;
+   ssize_t retval;
 
-   if (get_uuid_le(buf, &guid))
-   return -EINVAL;
+   retval = uuid_le_to_bin(buf, &guid);
+   if (retval)
+  return retval;
 
+   retval = -ENODEV;
spin_lock(&drv->dynids.lock);
list_for_each_entry_safe(dynid, n, &drv->dynids.list, node) {
struct hv_vmbus_device_id *id = &dynid->id;
-- 
2.11.0

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


Re: [PATCH v1] vmbus: Reuse uuid_le_to_bin() helper

2017-05-03 Thread Andy Shevchenko
On Wed, 2017-05-03 at 20:07 +0300, Andy Shevchenko wrote:
> Instead of open coded variant use generic helper to convert UUID
> strings
> to binary format.

> @@ -677,12 +644,14 @@ static ssize_t remove_id_store(struct
> device_driver *driver, const char *buf,
>  {
>   struct hv_driver *drv = drv_to_hv_drv(driver);
>   struct vmbus_dynid *dynid, *n;
> 

> - size_t retval = -ENODEV;
> 
> + ssize_t retval;

Just noticed, I'm fixing a bug here as well.

-- 
Andy Shevchenko 
Intel Finland Oy
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: ccree: Fix trailing whitespace checkpatch warnings

2017-05-03 Thread Gilad Ben-Yossef
Hi Timothée,

On Wed, May 3, 2017 at 8:01 PM, Greg KH  wrote:
> On Wed, May 03, 2017 at 06:47:07PM +0200, Timothée Isnard wrote:
>> Signed-off-by: Timothée Isnard 
>

Was this sent to the list?

My email client disavow any knowledge of the email this seems to be in
reply to...

> I can't take patches without any changelog text at all :(
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


It would be great to be CCed on patches to ccree driver. Would make it
easier to make sure I don't miss anything.

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


Re: [PATCH] staging: ccree: Fix trailing whitespace checkpatch warnings

2017-05-03 Thread Greg KH
On Wed, May 03, 2017 at 09:08:10PM +0300, Gilad Ben-Yossef wrote:
> Hi Timothée,
> 
> On Wed, May 3, 2017 at 8:01 PM, Greg KH  wrote:
> > On Wed, May 03, 2017 at 06:47:07PM +0200, Timothée Isnard wrote:
> >> Signed-off-by: Timothée Isnard 
> >
> 
> Was this sent to the list?
> 
> My email client disavow any knowledge of the email this seems to be in
> reply to...
> 
> > I can't take patches without any changelog text at all :(
> > ___
> > devel mailing list
> > de...@linuxdriverproject.org
> > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
> 
> 
> It would be great to be CCed on patches to ccree driver. Would make it
> easier to make sure I don't miss anything.

If the developer uses scripts/get_maintainer.pl, you should.  That
didn't happen here and would be what I complain about next time if this
gets resent without that fixed :)

thanks,

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


Re: [PATCH] staging: ccree: Fix trailing whitespace checkpatch warnings

2017-05-03 Thread Timothée Isnard
On Wed, May 03, 2017 at 09:08:10PM +0300, Gilad Ben-Yossef wrote:
> Hi Timothée,
> 
> On Wed, May 3, 2017 at 8:01 PM, Greg KH  wrote:
> > On Wed, May 03, 2017 at 06:47:07PM +0200, Timothée Isnard wrote:
> >> Signed-off-by: Timothée Isnard 
> >
> 
> Was this sent to the list?
It seems to have bounced due to some mail config issues on my end,
this should be fixed now (hopefully?)

> 
> My email client disavow any knowledge of the email this seems to be in
> reply to...
> 
> > I can't take patches without any changelog text at all :(
> > ___
> > devel mailing list
> > de...@linuxdriverproject.org
> > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
> 
> 
> It would be great to be CCed on patches to ccree driver. Would make it
> easier to make sure I don't miss anything.
My bad, I meant not to spam too many people with trivial patches
but I'll make sure to include you next time!
Thank you for the heads up.

> 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


[bug report] staging: typec: Fairchild FUSB302 Type-c chip driver

2017-05-03 Thread Dan Carpenter
Hello Yueyao Zhu,

The patch c034a43e72dd: "staging: typec: Fairchild FUSB302 Type-c
chip driver" from Apr 27, 2017, leads to the following static checker
warning:

drivers/staging/typec/fusb302/fusb302.c:492 tcpm_init()
warn: odd binop '0x40 & 0x80'

drivers/staging/typec/fusb302/fusb302.c
   484  if (ret < 0)
   485  return ret;
   486  ret = fusb302_set_power_mode(chip, FUSB_REG_POWER_PWR_ALL);
   487  if (ret < 0)
   488  return ret;
   489  ret = fusb302_i2c_read(chip, FUSB_REG_STATUS0, &data);
   490  if (ret < 0)
   491  return ret;
   492  chip->vbus_present = !!(FUSB_REG_STATUS0 & 
FUSB_REG_STATUS0_VBUSOK);

^^
0x40 & 0x80 is always zero.  Very odd, indeed.

   493  ret = fusb302_i2c_read(chip, FUSB_REG_DEVICE_ID, &data);
   494  if (ret < 0)
   495  return ret;
   496  fusb302_log(chip, "fusb302 device ID: 0x%02x", data);
   497  
   498  return ret;
   499  }

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


[PATCH] staging: typec: fusb302: Fix module autoload

2017-05-03 Thread Javier Martinez Canillas
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the OF and I2C device ID table entries as module aliases, using the
MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/typec/fusb302/fusb302.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/typec/fusb302/fusb302.ko | grep alias
alias:  of:N*T*Cfcs,fusb302C*
alias:  of:N*T*Cfcs,fusb302
alias:  i2c:typec_fusb302

Signed-off-by: Javier Martinez Canillas 
---

 drivers/staging/typec/fusb302/fusb302.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/typec/fusb302/fusb302.c 
b/drivers/staging/typec/fusb302/fusb302.c
index 2cee9a952c9b..aa460f93a293 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -1787,11 +1787,13 @@ static const struct of_device_id fusb302_dt_match[] = {
{.compatible = "fcs,fusb302"},
{},
 };
+MODULE_DEVICE_TABLE(of, fusb302_dt_match);
 
 static const struct i2c_device_id fusb302_i2c_device_id[] = {
{"typec_fusb302", 0},
{},
 };
+MODULE_DEVICE_TABLE(i2c, fusb302_i2c_device_id);
 
 static const struct dev_pm_ops fusb302_pm_ops = {
.suspend = fusb302_pm_suspend,
-- 
2.9.3

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