[PATCH] staging: qlge: qlge_dbg.c: Remove trailing semicolon from macro

2020-04-23 Thread Rylan Dmello
Fix checkpatch.pl warning: macros should not use a trailing semicolon

Signed-off-by: Rylan Dmello 
---
 drivers/staging/qlge/qlge_dbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 1795533cbd3a..216b13d8c131 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -1564,7 +1564,7 @@ void ql_dump_stat(struct ql_adapter *qdev)
pr_err("qdev->%-24s = %llx\n", #field, (unsigned long long)qdev->field)
 #define DUMP_QDEV_ARRAY(qdev, type, array, index, field) \
pr_err("%s[%d].%s = " type "\n", \
-  #array, index, #field, (qdev)->array[index].field);
+  #array, index, #field, (qdev)->array[index].field)
 void ql_dump_qdev(struct ql_adapter *qdev)
 {
int i;
-- 
2.26.2

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


[PATCH 2/2] staging: vt6656: Remove preamble_type setting from vnt_tx_packet.

2020-04-23 Thread Malcolm Priestley
preamble_type is set in vnt_bss_info_changed no need to set it
here.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6656/rxtx.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 7e15534e52ff..f56a2b02fe36 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -729,11 +729,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff 
*skb)
if (ieee80211_has_retry(hdr->frame_control))
tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LRETRY);
 
-   if (tx_rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
-   priv->preamble_type = PREAMBLE_SHORT;
-   else
-   priv->preamble_type = PREAMBLE_LONG;
-
if (tx_rate->flags & IEEE80211_TX_RC_USE_RTS_CTS) {
need_rts = true;
tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_RTS);
-- 
2.25.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: vt6656: Remove set short time in vnt_init_registers.

2020-04-23 Thread Malcolm Priestley
The short time is set in vnt_bss_info_changed no need to set it
here.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6656/main_usb.c | 13 -
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/vt6656/main_usb.c 
b/drivers/staging/vt6656/main_usb.c
index 4bca0b99cf45..c0545932866c 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -401,19 +401,6 @@ static int vnt_init_registers(struct vnt_private *priv)
dev_dbg(>usb->dev, "Network address = %pM\n",
priv->current_net_addr);
 
-   /*
-* set BB and packet type at the same time
-* set Short Slot Time, xIFS, and RSPINF
-*/
-   if (priv->bb_type == BB_TYPE_11A)
-   priv->short_slot_time = true;
-   else
-   priv->short_slot_time = false;
-
-   ret = vnt_set_short_slot_time(priv);
-   if (ret)
-   goto end;
-
priv->radio_ctl = priv->eeprom[EEP_OFS_RADIOCTL];
 
if ((priv->radio_ctl & EEP_RADIOCTL_ENABLE) != 0) {
-- 
2.25.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vt6656: rxtx: remove duration_id and void returns.

2020-04-23 Thread Malcolm Priestley
duration_id is not used by driver anymore so remove the returns
and set all functions in path to void.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6656/rxtx.c | 78 ---
 1 file changed, 36 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 335ef4fd104f..7e15534e52ff 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -327,8 +327,8 @@ static u16 vnt_mac_hdr_pos(struct vnt_usb_send_context 
*tx_context,
return (u16)(hdr_pos - head);
 }
 
-static u16 vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context,
-  struct vnt_tx_datahead_g *buf)
+static void vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context,
+   struct vnt_tx_datahead_g *buf)
 {
struct vnt_private *priv = tx_context->priv;
struct ieee80211_hdr *hdr =
@@ -349,12 +349,10 @@ static u16 vnt_rxtx_datahead_g(struct 
vnt_usb_send_context *tx_context,
   priv->top_cck_basic_rate);
 
tx_context->tx_hdr_size = vnt_mac_hdr_pos(tx_context, >hdr);
-
-   return le16_to_cpu(buf->duration_a);
 }
 
-static u16 vnt_rxtx_datahead_ab(struct vnt_usb_send_context *tx_context,
-   struct vnt_tx_datahead_ab *buf)
+static void vnt_rxtx_datahead_ab(struct vnt_usb_send_context *tx_context,
+struct vnt_tx_datahead_ab *buf)
 {
struct vnt_private *priv = tx_context->priv;
struct ieee80211_hdr *hdr =
@@ -371,12 +369,10 @@ static u16 vnt_rxtx_datahead_ab(struct 
vnt_usb_send_context *tx_context,
buf->time_stamp_off = vnt_time_stamp_off(priv, rate);
 
tx_context->tx_hdr_size = vnt_mac_hdr_pos(tx_context, >hdr);
-
-   return le16_to_cpu(buf->duration);
 }
 
-static int vnt_fill_ieee80211_rts(struct vnt_usb_send_context *tx_context,
- struct ieee80211_rts *rts, __le16 duration)
+static void vnt_fill_ieee80211_rts(struct vnt_usb_send_context *tx_context,
+  struct ieee80211_rts *rts, __le16 duration)
 {
struct ieee80211_hdr *hdr =
(struct ieee80211_hdr *)tx_context->skb->data;
@@ -387,12 +383,10 @@ static int vnt_fill_ieee80211_rts(struct 
vnt_usb_send_context *tx_context,
 
ether_addr_copy(rts->ra, hdr->addr1);
ether_addr_copy(rts->ta, hdr->addr2);
-
-   return 0;
 }
 
-static u16 vnt_rxtx_rts_g_head(struct vnt_usb_send_context *tx_context,
-  struct vnt_rts_g *buf)
+static void vnt_rxtx_rts_g_head(struct vnt_usb_send_context *tx_context,
+   struct vnt_rts_g *buf)
 {
struct vnt_private *priv = tx_context->priv;
u16 rts_frame_len = 20;
@@ -415,11 +409,11 @@ static u16 vnt_rxtx_rts_g_head(struct 
vnt_usb_send_context *tx_context,
 
vnt_fill_ieee80211_rts(tx_context, >data, buf->duration_aa);
 
-   return vnt_rxtx_datahead_g(tx_context, >data_head);
+   vnt_rxtx_datahead_g(tx_context, >data_head);
 }
 
-static u16 vnt_rxtx_rts_ab_head(struct vnt_usb_send_context *tx_context,
-   struct vnt_rts_ab *buf)
+static void vnt_rxtx_rts_ab_head(struct vnt_usb_send_context *tx_context,
+struct vnt_rts_ab *buf)
 {
struct vnt_private *priv = tx_context->priv;
u16 current_rate = tx_context->tx_rate;
@@ -434,11 +428,11 @@ static u16 vnt_rxtx_rts_ab_head(struct 
vnt_usb_send_context *tx_context,
 
vnt_fill_ieee80211_rts(tx_context, >data, buf->duration);
 
-   return vnt_rxtx_datahead_ab(tx_context, >data_head);
+   vnt_rxtx_datahead_ab(tx_context, >data_head);
 }
 
-static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
-union vnt_tx_data_head *head)
+static void vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
+ union vnt_tx_data_head *head)
 {
struct vnt_private *priv = tx_context->priv;
struct vnt_cts *buf = >cts_g;
@@ -460,11 +454,11 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context 
*tx_context,
 
ether_addr_copy(buf->data.ra, priv->current_net_addr);
 
-   return vnt_rxtx_datahead_g(tx_context, >data_head);
+   vnt_rxtx_datahead_g(tx_context, >data_head);
 }
 
-static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,
-   union vnt_tx_head *tx_head, bool need_mic)
+static void vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,
+union vnt_tx_head *tx_head, bool need_mic)
 {
struct vnt_private *priv = tx_context->priv;
struct vnt_rrv_time_rts *buf = _head->tx_rts.rts;
@@ -489,11 +483,11 @@ static u16 vnt_rxtx_rts(struct vnt_usb_send_context 
*tx_context,
if (need_mic)
head = _head->tx_rts.tx.mic.head;
 

[PATCH v2] staging:r8188eu: avoid skb_clone for amsdu to msdu conversion

2020-04-23 Thread Ivan Safonov
skb clones use same data buffer,
so tail of one skb is corrupted by beginning of next skb.

Signed-off-by: Ivan Safonov 
---
Changes in v2:
  - long line in the commit message is divided into two parts.

drivers/staging/rtl8188eu/core/rtw_recv.c | 19 ++-
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c 
b/drivers/staging/rtl8188eu/core/rtw_recv.c
index d4278361e002..a036ef104198 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1525,21 +1525,14 @@ static int amsdu_to_msdu(struct adapter *padapter, 
struct recv_frame *prframe)
 
/* Allocate new skb for releasing to upper layer */
sub_skb = dev_alloc_skb(nSubframe_Length + 12);
-   if (sub_skb) {
-   skb_reserve(sub_skb, 12);
-   skb_put_data(sub_skb, pdata, nSubframe_Length);
-   } else {
-   sub_skb = skb_clone(prframe->pkt, GFP_ATOMIC);
-   if (sub_skb) {
-   sub_skb->data = pdata;
-   sub_skb->len = nSubframe_Length;
-   skb_set_tail_pointer(sub_skb, nSubframe_Length);
-   } else {
-   DBG_88E("skb_clone() Fail!!! , 
nr_subframes=%d\n", nr_subframes);
-   break;
-   }
+   if (!sub_skb) {
+   DBG_88E("dev_alloc_skb() Fail!!! , nr_subframes=%d\n", 
nr_subframes);
+   break;
}
 
+   skb_reserve(sub_skb, 12);
+   skb_put_data(sub_skb, pdata, nSubframe_Length);
+
subframes[nr_subframes++] = sub_skb;
 
if (nr_subframes >= MAX_SUBFRAME_COUNT) {
-- 
2.25.3

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


[PATCH] Staging: rtl8188eu: core: rtw_pwrctrl: fixed a coding style issue

2020-04-23 Thread carlosteniswarrior
From: Carlos Guerrero Álvarez 

Fixed a checkpatch.pl warning: the constant should be in the right side
of the comparison.

Signed-off-by: Carlos Guerrero Álvarez 
---
 drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c 
b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
index c4f58507dbfd..c000382c96d9 100644
--- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
@@ -173,7 +173,7 @@ int ips_leave(struct adapter *padapter)

DBG_88E_LEVEL(_drv_info_, "nolinked power save leave\n");

-   if ((_WEP40_ == psecuritypriv->dot11PrivacyAlgrthm) || 
(_WEP104_ == psecuritypriv->dot11PrivacyAlgrthm)) {
+   if ((psecuritypriv->dot11PrivacyAlgrthm == _WEP40_) || 
(psecuritypriv->dot11PrivacyAlgrthm == _WEP104_)) {
DBG_88E("==>%s, channel(%d), processing(%x)\n", 
__func__, padapter->mlmeextpriv.cur_channel, pwrpriv->bips_processing);
set_channel_bwmode(padapter, 
padapter->mlmeextpriv.cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, 
HT_CHANNEL_WIDTH_20);
for (keyid = 0; keyid < 4; keyid++) {
--
2.26.1

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


[PATCH v2] staging: vt6656: Add formula to the vnt_rf_addpower function

2020-04-23 Thread Oscar Carter
Use a formula to calculate the return value of the vnt_rf_addpower
function instead of the "if" statement with literal values for every
case.

Signed-off-by: Oscar Carter 
---
Changelog v1 -> v2
- Change the type of "base" variable from s32 to int as Dan Carpenter
  suggested.
- Remove the "--" postoperator and replace with (base - 1) as Dan
  Carpenter suggested. Also, as this expression has a minus before the
  parenthesis, remove it an apply the minus operator changing the sign of
  "base" and literal "1".

 drivers/staging/vt6656/rf.c | 20 +++-
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 06fa8867cfa3..612fd4a59f8a 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -538,28 +538,14 @@ int vnt_rf_write_embedded(struct vnt_private *priv, u32 
data)

 static u8 vnt_rf_addpower(struct vnt_private *priv)
 {
+   int base;
s32 rssi = -priv->current_rssi;

if (!rssi)
return 7;

-   if (priv->rf_type == RF_VT3226D0) {
-   if (rssi < -70)
-   return 9;
-   else if (rssi < -65)
-   return 7;
-   else if (rssi < -60)
-   return 5;
-   } else {
-   if (rssi < -80)
-   return 9;
-   else if (rssi < -75)
-   return 7;
-   else if (rssi < -70)
-   return 5;
-   }
-
-   return 0;
+   base = (priv->rf_type == RF_VT3226D0) ? -60 : -70;
+   return (rssi < base) ? ((rssi - base + 1) / -5) * 2 + 5 : 0;
 }

 /* Set Tx power by power level and rate */
--
2.20.1

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


[PATCH v3 1/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-23 Thread Oscar Carter
Check the return value of vnt_control_out_* function calls. When
necessary modify the function prototype to be able to return the new
checked error code.

It's safe to modify all the function prototypes without fix the call
because the only change is the return value from void to int. If before
the call didn't check the return value, now neither.

Signed-off-by: Oscar Carter 
---
 drivers/staging/vt6656/baseband.c | 35 ++-
 drivers/staging/vt6656/baseband.h |  4 +-
 drivers/staging/vt6656/card.c | 97 ---
 drivers/staging/vt6656/card.h | 18 +++---
 drivers/staging/vt6656/mac.c  | 76 
 drivers/staging/vt6656/mac.h  | 26 -
 drivers/staging/vt6656/power.c| 12 +++-
 drivers/staging/vt6656/power.h|  2 +-
 8 files changed, 156 insertions(+), 114 deletions(-)

diff --git a/drivers/staging/vt6656/baseband.c 
b/drivers/staging/vt6656/baseband.c
index d21a9cf0afe5..3d2d20e6f055 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -23,6 +23,7 @@
  */

 #include 
+#include 
 #include 
 #include "device.h"
 #include "mac.h"
@@ -506,21 +507,22 @@ int vnt_set_short_slot_time(struct vnt_private *priv)

ret = vnt_control_in_u8(priv, MESSAGE_REQUEST_BBREG, 0xe7, _vga);
if (ret)
-   goto end;
+   return ret;

if (bb_vga == priv->bb_vga[0])
priv->bb_rx_conf |= 0x20;

-   ret = vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a,
-priv->bb_rx_conf);
-
-end:
-   return ret;
+   return vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a,
+ priv->bb_rx_conf);
 }

-void vnt_set_vga_gain_offset(struct vnt_private *priv, u8 data)
+int vnt_set_vga_gain_offset(struct vnt_private *priv, u8 data)
 {
-   vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xE7, data);
+   int ret;
+
+   ret = vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xE7, data);
+   if (ret)
+   return ret;

/* patch for 3253B0 Baseband with Cardbus module */
if (priv->short_slot_time)
@@ -528,7 +530,8 @@ void vnt_set_vga_gain_offset(struct vnt_private *priv, u8 
data)
else
priv->bb_rx_conf |= 0x20; /* 0010  */

-   vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->bb_rx_conf);
+   return vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a,
+ priv->bb_rx_conf);
 }

 /*
@@ -569,12 +572,13 @@ int vnt_exit_deep_sleep(struct vnt_private *priv)
return vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);
 }

-void vnt_update_pre_ed_threshold(struct vnt_private *priv, int scanning)
+int vnt_update_pre_ed_threshold(struct vnt_private *priv, int scanning)
 {
const struct vnt_threshold *threshold = NULL;
u8 length;
u8 cr_201, cr_206;
u8 ed_inx;
+   int ret;

switch (priv->rf_type) {
case RF_AL2230:
@@ -597,7 +601,7 @@ void vnt_update_pre_ed_threshold(struct vnt_private *priv, 
int scanning)
}

if (!threshold)
-   return;
+   return -EINVAL;

for (ed_inx = scanning ? 0 : length - 1; ed_inx > 0; ed_inx--) {
if (priv->bb_pre_ed_rssi <= threshold[ed_inx].bb_pre_ed_rssi)
@@ -608,14 +612,17 @@ void vnt_update_pre_ed_threshold(struct vnt_private 
*priv, int scanning)
cr_206 = threshold[ed_inx].cr_206;

if (ed_inx == priv->bb_pre_ed_index && !scanning)
-   return;
+   return 0;

priv->bb_pre_ed_index = ed_inx;

dev_dbg(>usb->dev, "%s bb_pre_ed_rssi %d\n",
__func__, priv->bb_pre_ed_rssi);

-   vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xc9, cr_201);
-   vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xce, cr_206);
+   ret = vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xc9, cr_201);
+   if (ret)
+   return ret;
+
+   return vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xce, cr_206);
 }

diff --git a/drivers/staging/vt6656/baseband.h 
b/drivers/staging/vt6656/baseband.h
index dc42aa6ae1d9..8739988bf9e8 100644
--- a/drivers/staging/vt6656/baseband.h
+++ b/drivers/staging/vt6656/baseband.h
@@ -80,11 +80,11 @@ void vnt_get_phy_field(struct vnt_private *priv, u32 
frame_length,
   u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy);

 int vnt_set_short_slot_time(struct vnt_private *priv);
-void vnt_set_vga_gain_offset(struct vnt_private *priv, u8 data);
+int vnt_set_vga_gain_offset(struct vnt_private *priv, u8 data);
 int vnt_set_antenna_mode(struct vnt_private *priv, u8 antenna_mode);
 int vnt_vt3184_init(struct vnt_private *priv);
 int vnt_set_deep_sleep(struct vnt_private *priv);
 int vnt_exit_deep_sleep(struct vnt_private *priv);
-void vnt_update_pre_ed_threshold(struct vnt_private *priv, int scanning);
+int 

[PATCH v3 2/2] staging: vt6656: Remove functions' documentation

2020-04-23 Thread Oscar Carter
Remove the functions' documentation as the names of the functions are
clear enought. Also, the actual documentation it's not correct in all
cases.

Signed-off-by: Oscar Carter 
---
 drivers/staging/vt6656/card.c  | 79 --
 drivers/staging/vt6656/mac.c   | 52 --
 drivers/staging/vt6656/power.c | 10 -
 3 files changed, 141 deletions(-)

diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index c29f7072c742..370ae4253a3f 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -46,16 +46,6 @@ static const u16 cw_rxbcntsf_off[MAX_RATE] = {
192, 96, 34, 17, 34, 23, 17, 11, 8, 5, 4, 3
 };

-/*
- * Description: Set NIC media channel
- *
- * Parameters:
- *  In:
- *  pDevice - The adapter to be set
- *  connection_channel  - Channel to be set
- *  Out:
- *  none
- */
 int vnt_set_channel(struct vnt_private *priv, u32 connection_channel)
 {
int ret;
@@ -99,19 +89,6 @@ static const u8 vnt_rspinf_gb_table[] = {
0x0e, 0x8d, 0x0a, 0x88, 0x0a, 0x8c, 0x0a, 0x8c, 0x0a
 };

-/*
- * Description: Set RSPINF
- *
- * Parameters:
- *  In:
- *  pDevice - The adapter to be set
- *  Out:
- *  none
- *
- * Return Value: None.
- *
- */
-
 int vnt_set_rspinf(struct vnt_private *priv, u8 bb_type)
 {
const u8 *data;
@@ -145,18 +122,6 @@ int vnt_set_rspinf(struct vnt_private *priv, u8 bb_type)
   MESSAGE_REQUEST_MACREG, len, data);
 }

-/*
- * Description: Update IFS
- *
- * Parameters:
- *  In:
- * priv - The adapter to be set
- * Out:
- * none
- *
- * Return Value: None.
- *
- */
 int vnt_update_ifs(struct vnt_private *priv)
 {
u8 max_min = 0;
@@ -300,21 +265,6 @@ u64 vnt_get_tsf_offset(u8 rx_rate, u64 tsf1, u64 tsf2)
return tsf1 - tsf2 - (u64)cw_rxbcntsf_off[rx_rate % MAX_RATE];
 }

-/*
- * Description: Sync. TSF counter to BSS
- *  Get TSF offset and write to HW
- *
- * Parameters:
- *  In:
- *  priv   - The adapter to be sync.
- *  time_stamp - Rx BCN's TSF
- *  local_tsf  - Local TSF
- *  Out:
- *  none
- *
- * Return Value: none
- *
- */
 int vnt_adjust_tsf(struct vnt_private *priv, u8 rx_rate,
   u64 time_stamp, u64 local_tsf)
 {
@@ -408,20 +358,6 @@ u64 vnt_get_next_tbtt(u64 tsf, u16 beacon_interval)
return tsf;
 }

-/*
- * Description: Set NIC TSF counter for first Beacon time
- *  Get NEXTTBTT from adjusted TSF and Beacon Interval
- *
- * Parameters:
- *  In:
- *  dwIoBase- IO Base
- * beacon_interval - Beacon Interval
- *  Out:
- *  none
- *
- * Return Value: none
- *
- */
 int vnt_reset_next_tbtt(struct vnt_private *priv, u16 beacon_interval)
 {
u64 next_tbtt = 0;
@@ -444,21 +380,6 @@ int vnt_reset_next_tbtt(struct vnt_private *priv, u16 
beacon_interval)
   MESSAGE_REQUEST_TBTT, 0, 8, data);
 }

-/*
- * Description: Sync NIC TSF counter for Beacon time
- *  Get NEXTTBTT and write to HW
- *
- * Parameters:
- *  In:
- * priv- The adapter to be set
- *  tsf- Current TSF counter
- *  beacon_interval - Beacon Interval
- *  Out:
- *  none
- *
- * Return Value: none
- *
- */
 int vnt_update_next_tbtt(struct vnt_private *priv, u64 tsf,
 u16 beacon_interval)
 {
diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index 639172fad0f3..da7067c34643 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -22,19 +22,6 @@
 #include "mac.h"
 #include "usbpipe.h"

-/*
- * Description:
- *  Write MAC Multicast Address Mask
- *
- * Parameters:
- *  In:
- * mc_filter (mac filter)
- *  Out:
- *  none
- *
- * Return Value: none
- *
- */
 int vnt_mac_set_filter(struct vnt_private *priv, u64 mc_filter)
 {
__le64 le_mc = cpu_to_le64(mc_filter);
@@ -44,17 +31,6 @@ int vnt_mac_set_filter(struct vnt_private *priv, u64 
mc_filter)
   (u8 *)_mc);
 }

-/*
- * Description:
- *  Shut Down MAC
- *
- * Parameters:
- *  In:
- *  Out:
- *  none
- *
- *
- */
 int vnt_mac_shutdown(struct vnt_private *priv)
 {
return vnt_control_out(priv, MESSAGE_TYPE_MACSHUTDOWN, 0, 0, 0, NULL);
@@ -72,40 +48,12 @@ int vnt_mac_set_bb_type(struct vnt_private *priv, u8 type)
   data);
 }

-/*
- * Description:
- *  Disable the Key Entry by MISCFIFO
- *
- * Parameters:
- *  In:
- *  dwIoBase- Base Address for MAC
- *
- *  Out:
- *  none
- *
- * Return Value: none
- *
- */
 int vnt_mac_disable_keyentry(struct vnt_private *priv, u8 entry_idx)
 {
return vnt_control_out(priv, MESSAGE_TYPE_CLRKEYENTRY, 0, 0,
   sizeof(entry_idx), _idx);
 }

-/*
- * Description:
- *  Set the Key by MISCFIFO
- *
- * Parameters:
- *  In:
- *  dwIoBase- Base Address 

[PATCH v3 0/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-23 Thread Oscar Carter
This patch series checks the return value of vnt_control_out_* function
calls.

The first patch checks the return value and when necessary modify the
function prototype to be able to return the new checked error code.

The second patch removes the documentation of functions that their
prototype has changed as the function names are clear enought. Also,
the actual documentation is not correct in all cases.

Changelog v1 -> v2
- Remove the function's documentation instead of fix them as suggested
  Malcolm Priestley.

Changelog v2 -> v3
- Rebase against the staging-next branch of Greg's staging tree.

Oscar Carter (2):
  staging: vt6656: Check the return value of vnt_control_out_* calls
  staging: vt6656: Remove functions' documentation

 drivers/staging/vt6656/baseband.c |  35 +++---
 drivers/staging/vt6656/baseband.h |   4 +-
 drivers/staging/vt6656/card.c | 176 +++---
 drivers/staging/vt6656/card.h |  18 +--
 drivers/staging/vt6656/mac.c  | 128 +++---
 drivers/staging/vt6656/mac.h  |  26 ++---
 drivers/staging/vt6656/power.c|  22 ++--
 drivers/staging/vt6656/power.h|   2 +-
 8 files changed, 156 insertions(+), 255 deletions(-)

--
2.20.1

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


HELLO

2020-04-23 Thread Ken
Hello

Please can you assist me for a shipment/sales of Raw Gold Bar in your
Country.
SPECIFICATION.Karat:
22 +,Purity:
96.6%,Raw Gold Bar,Origin:Ghana
Price: $35,000 per 1kg
Regards.
Lucas Duru
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 1/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-23 Thread Oscar Carter
On Thu, Apr 23, 2020 at 01:40:32PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Apr 19, 2020 at 12:48:20PM +0200, Oscar Carter wrote:
> > Check the return value of vnt_control_out_* function calls. When
> > necessary modify the function prototype to be able to return the new
> > checked error code.
> >
> > It's safe to modify all the function prototypes without fix the call
> > because the only change is the return value from void to int. If before
> > the call didn't check the return value, now neither.
> >
> > Signed-off-by: Oscar Carter 
>
> This patch, and the 2/2 patch did not apply to my tree.  Can you please
> rebase and resend?
>
Yes. I will rebase and I will resend a new patch series.

> thanks,
>
> greg k-h

thanks,

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


Re: [PATCH v2 6/9] dt-bindings: media: rkisp1: move rockchip-isp1 bindings out of staging

2020-04-23 Thread Johan Jonker
Hi Helen,


>   clocks:
> items:
>   - description: ISP clock
>   - description: ISP AXI clock clock
>   - description: ISP AXI clock  wrapper clock
>   - description: ISP AHB clock clock

Too many clocks here ^
Too many spaces here ^

>   - description: ISP AHB wrapper clock

We can expect 4 to 5 clocks.
With 5 clocks and a different description this layout is maybe not so handy.

As first change:

  clocks:
maxItems: 5
description:
  rk3399 clocks
ISP clock
ISP AXI clock
ISP AXI wrapper clock
ISP AHB clock
ISP AHB wrapper clock

And then later:

  clocks:
maxItems: 5
description:
  rk3288 clocks
ISP clock
ISP AXI clock
ISP AHB clock
ISP Pixel clock
ISP JPEG source clock
  rk3399 clocks
ISP clock
ISP AXI clock
ISP AXI wrapper clock
ISP AHB clock
ISP AHB wrapper clock

With 4 clocks:

  clocks:
minItems: 4
maxItems: 5
description:
  rk1808 clocks
  rk3288 clocks
  rk3326 clocks
  rk3368 clocks
  rk3399 clocks
[..]


> 
>   clock-names:
> items:
>   - const: clk_isp
>   - const: aclk_isp
>   - const: aclk_isp_wrap
>   - const: hclk_isp
>   - const: hclk_isp_wrap



On 4/3/20 6:15 PM, Helen Koike wrote:
> Move rkisp1 bindings to Documentation/devicetree/bindings/media
> 
> Verified with:
> make ARCH=arm64 dt_binding_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/media/rockchip-isp1.yaml
> 
> Signed-off-by: Helen Koike 
> ---
> 
> V2:
> - no changes
> 
>  .../devicetree/bindings/media/rockchip-isp1.yaml  | 0
>  1 file changed, 0 insertions(+), 0 deletions(-)
>  rename {drivers/staging/media/rkisp1/Documentation => 
> Documentation}/devicetree/bindings/media/rockchip-isp1.yaml (100%)
> 
> diff --git 
> a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
>  b/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
> similarity index 100%
> rename from 
> drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
> rename to Documentation/devicetree/bindings/media/rockchip-isp1.yaml
> 

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


Re: [PATCH] staging:r8188eu: avoid skb_clone for amsdu to msdu conversion

2020-04-23 Thread Ivan Safonov

On 4/23/20 2:29 PM, Greg Kroah-Hartman wrote:

On Sat, Apr 18, 2020 at 11:41:12AM +0300, Ivan Safonov wrote:

skb clones use same data buffer, so tail of one skb is corrupted by beginning 
of next skb.


Please properly wrap your changelog text at the correct column (72).

Also, your subject: line does not have the correct driver name :(


Correct driver name is 'r8188eu':

1. 
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2016-June/090556.html 
:
One other point, it is customary to start the patch subject with "staging: 
rtl8188eu: ..." for drivers in staging. I also prefer using r8188eu rather than 
rtl8188eu as the former is the actual name of the driver, but either will work.


2. ./drivers/staging/rtl8188eu/os_dep/usb_intf.c lines 483-522/522 (END):

static struct usb_driver rtl8188e_usb_drv = {
.name = "r8188eu",
.probe = rtw_drv_init,
.disconnect = rtw_dev_remove,
.id_table = rtw_usb_id_tbl,
.suspend =  rtw_suspend,
.resume = rtw_resume,
.reset_resume = rtw_resume,
};

module_usb_driver(rtl8188e_usb_drv)


Subject contain this name.



Signed-off-by: Ivan Safonov 
---
  drivers/staging/rtl8188eu/core/rtw_recv.c | 19 ++-
  1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c 
b/drivers/staging/rtl8188eu/core/rtw_recv.c
index d4278361e002..a036ef104198 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1525,21 +1525,14 @@ static int amsdu_to_msdu(struct adapter *padapter, 
struct recv_frame *prframe)
  
  		/* Allocate new skb for releasing to upper layer */

sub_skb = dev_alloc_skb(nSubframe_Length + 12);
-   if (sub_skb) {
-   skb_reserve(sub_skb, 12);
-   skb_put_data(sub_skb, pdata, nSubframe_Length);
-   } else {
-   sub_skb = skb_clone(prframe->pkt, GFP_ATOMIC);
-   if (sub_skb) {
-   sub_skb->data = pdata;
-   sub_skb->len = nSubframe_Length;
-   skb_set_tail_pointer(sub_skb, nSubframe_Length);
-   } else {
-   DBG_88E("skb_clone() Fail!!! , 
nr_subframes=%d\n", nr_subframes);
-   break;
-   }
+   if (!sub_skb) {
+   DBG_88E("dev_alloc_skb() Fail!!! , nr_subframes=%d\n", 
nr_subframes);
+   break;
}
  
+		skb_reserve(sub_skb, 12);

+   skb_put_data(sub_skb, pdata, nSubframe_Length);
+


Have you tested this?


I have not test this change.

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


Re: [PATCH v2 7/9] media: MAINTAINERS: rkisp1: add path to dt-bindings

2020-04-23 Thread Johan Jonker
Hi Helen,

On 4/3/20 6:15 PM, Helen Koike wrote:
> The Rockchip ISP bindings was moved out of staging.
> Update MAINTAINERS file with the new path.
> 
> Suggested-by: Johan Jonker 
> Signed-off-by: Helen Koike 
> ---
> 
> V2:
> - This is a new patch in the series
> ---
>  MAINTAINERS | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d66ac41ef5872..726044b84cf23 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -14303,6 +14303,7 @@ M:Helen Koike 
>  L:   linux-me...@vger.kernel.org

L:  linux-rockc...@lists.infradead.org

>  S:   Maintained

>  F:   drivers/staging/media/rkisp1/
> +F:   Documentation/devicetree/bindings/media/rockchip-isp1.yaml

Rebase.
The MAINTAINERS document was recently sort.
Check entries with:

./scripts/parse-maintainers.pl --input=MAINTAINERS --output=MAINTAINERS
--order

>  
>  ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER
>  M:   Jacob Chen 
> 

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


Re: [PATCH v2 6/9] dt-bindings: media: rkisp1: move rockchip-isp1 bindings out of staging

2020-04-23 Thread Johan Jonker
Hi Helen,

make ARCH=arm dt_binding_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/media/rockchip-isp1.yaml
  SCHEMA  Documentation/devicetree/bindings/processed-schema-examples.yaml
  SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
  CHKDT   Documentation/devicetree/bindings/media/rockchip-isp1.yaml
  DTC
Documentation/devicetree/bindings/media/rockchip-isp1.example.dt.yaml
Documentation/devicetree/bindings/media/rockchip-isp1.example.dts:22.27-99.11:
Warning (unit_address_vs_reg): /example-0/parent@0: node has a unit
name, but no reg or ranges property
  CHECK
Documentation/devicetree/bindings/media/rockchip-isp1.example.dt.yaml

On 4/3/20 6:15 PM, Helen Koike wrote:
> Move rkisp1 bindings to Documentation/devicetree/bindings/media
> 
> Verified with:
> make ARCH=arm64 dt_binding_check 
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/media/rockchip-isp1.yaml
> 
> Signed-off-by: Helen Koike 
> ---
> 
> V2:
> - no changes
> 
>  .../devicetree/bindings/media/rockchip-isp1.yaml  | 0
>  1 file changed, 0 insertions(+), 0 deletions(-)
>  rename {drivers/staging/media/rkisp1/Documentation => 
> Documentation}/devicetree/bindings/media/rockchip-isp1.yaml (100%)
> 
> diff --git 
> a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
>  b/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
> similarity index 100%
> rename from 
> drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
> rename to Documentation/devicetree/bindings/media/rockchip-isp1.yaml
> 

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


Re: [PATCH v7 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver

2020-04-23 Thread Nicolas Boichat
Hi,

Just commenting on the mode_fixup function that was added in v7.

On Tue, Feb 25, 2020 at 2:15 PM Xin Ji  wrote:
>
> The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed
> for portable device. It converts MIPI DSI/DPI to DisplayPort 1.3 4K.
>
> The ANX7625 can support both USB Type-C PD feature and MIPI DSI/DPI
> to DP feature. This driver only enabled MIPI DSI/DPI to DP feature.
>
> Signed-off-by: Xin Ji 
> ---
>  drivers/gpu/drm/bridge/Makefile   |2 +-
>  drivers/gpu/drm/bridge/analogix/Kconfig   |6 +
>  drivers/gpu/drm/bridge/analogix/Makefile  |1 +
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 2172 
> +
>  drivers/gpu/drm/bridge/analogix/anx7625.h |  410 ++
>  5 files changed, 2590 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c
>  create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h
>
> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
> index 4934fcf..bcd388a 100644
> --- a/drivers/gpu/drm/bridge/Makefile
> +++ b/drivers/gpu/drm/bridge/Makefile
[snip]
> +static bool anx7625_bridge_mode_fixup(struct drm_bridge *bridge,
> + const struct drm_display_mode *mode,
> + struct drm_display_mode *adj)
> +{
> +   struct anx7625_data *ctx = bridge_to_anx7625(bridge);
> +   struct device *dev = >client->dev;
> +   u32 hsync, hfp, hbp, hactive, hblanking;
> +   u32 adj_hsync, adj_hfp, adj_hbp, adj_hblanking, delta_adj;
> +   u32 vref, adj_clock;
> +
> +   DRM_DEV_DEBUG_DRIVER(dev, "drm mode fixup set\n");
> +
> +   mutex_lock(>lock);

Why do you need this lock?

> +
> +   hactive = mode->hdisplay;

This is never used, drop it?

> +   hsync = mode->hsync_end - mode->hsync_start;
> +   hfp = mode->hsync_start - mode->hdisplay;
> +   hbp = mode->htotal - mode->hsync_end;
> +   hblanking = mode->htotal - mode->hdisplay;
> +
> +   DRM_DEV_DEBUG_DRIVER(dev, "before mode fixup\n");
> +   DRM_DEV_DEBUG_DRIVER(dev, "hsync(%d),hfp(%d),hbp(%d),clock(%d)\n",
> +hsync,
> +hfp,
> +hbp,
> +adj->clock);
> +   DRM_DEV_DEBUG_DRIVER(dev, 
> "hsync_start(%d),hsync_end(%d),htotal(%d)\n",
> +adj->hsync_start,
> +adj->hsync_end,
> +adj->htotal);
> +
> +   adj_hfp = hfp;
> +   adj_hsync = hsync;
> +   adj_hbp = hbp;
> +   adj_hblanking = hblanking;
> +
> +   /* plus 1 if hfp is odd */

A better way to word these comments is to say "hfp needs to be even",
otherwise, you're just repeating what we can already see in the code.

> +   if (hfp & 0x1) {
> +   adj_hfp = hfp + 1;

adj_hfp -= 1 for consistency?

> +   adj_hblanking += 1;
> +   }
> +
> +   /* minus 1 if hbp is odd */
> +   if (hbp & 0x1) {
> +   adj_hbp = hbp - 1;

ditto, adj_hbp -= 1;

> +   adj_hblanking -= 1;
> +   }
> +
> +   /* plus 1 if hsync is odd */
> +   if (hsync & 0x1) {
> +   if (adj_hblanking < hblanking)
> +   adj_hsync = hsync + 1;

ditto

> +   else
> +   adj_hsync = hsync - 1;

ditto

> +   }
> +
> +   /*
> +* once illegal timing detected, use default HFP, HSYNC, HBP
> +*/
> +   if (hblanking < HBLANKING_MIN || (hfp < HP_MIN && hbp < HP_MIN)) {

should this be adj_hblanking/adj_hfp/adj_hbp?

> +   adj_hsync = SYNC_LEN_DEF;
> +   adj_hfp = HFP_HBP_DEF;
> +   adj_hbp = HFP_HBP_DEF;
> +   vref = adj->clock * 1000 / (adj->htotal * adj->vtotal);
> +   if (hblanking < HBLANKING_MIN) {
> +   delta_adj = HBLANKING_MIN - hblanking;
> +   adj_clock = vref * delta_adj * adj->vtotal;
> +   adj->clock += DIV_ROUND_UP(adj_clock, 1000);
> +   } else {
> +   delta_adj = hblanking - HBLANKING_MIN;
> +   adj_clock = vref * delta_adj * adj->vtotal;
> +   adj->clock -= DIV_ROUND_UP(adj_clock, 1000);
> +   }
> +
> +   DRM_WARN("illegal hblanking timing, use default.\n");
> +   DRM_WARN("hfp(%d),hbp(%d),hsync(%d).\n", hfp, hbp, hsync);

How likely is it that this mode is going to work? Can you just return
false here to reject the mode?

> +   } else if (adj_hfp < HP_MIN) {
> +   /* adjust hfp if hfp less than HP_MIN */
> +   delta_adj = HP_MIN - adj_hfp;
> +   adj_hfp = HP_MIN;
> +
> +   /*
> +* balance total HBlanking pixel, if HBP hasn't enough space,

"does not have enough space"

> +* adjust HSYNC length, otherwize 

Re: [PATCH v2 1/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-23 Thread Greg Kroah-Hartman
On Sun, Apr 19, 2020 at 12:48:20PM +0200, Oscar Carter wrote:
> Check the return value of vnt_control_out_* function calls. When
> necessary modify the function prototype to be able to return the new
> checked error code.
> 
> It's safe to modify all the function prototypes without fix the call
> because the only change is the return value from void to int. If before
> the call didn't check the return value, now neither.
> 
> Signed-off-by: Oscar Carter 

This patch, and the 2/2 patch did not apply to my tree.  Can you please
rebase and resend?

thanks,

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


Re: [PATCH] staging:r8188eu: avoid skb_clone for amsdu to msdu conversion

2020-04-23 Thread Greg Kroah-Hartman
On Sat, Apr 18, 2020 at 11:41:12AM +0300, Ivan Safonov wrote:
> skb clones use same data buffer, so tail of one skb is corrupted by beginning 
> of next skb.

Please properly wrap your changelog text at the correct column (72).

Also, your subject: line does not have the correct driver name :(

> 
> Signed-off-by: Ivan Safonov 
> ---
>  drivers/staging/rtl8188eu/core/rtw_recv.c | 19 ++-
>  1 file changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c 
> b/drivers/staging/rtl8188eu/core/rtw_recv.c
> index d4278361e002..a036ef104198 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_recv.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
> @@ -1525,21 +1525,14 @@ static int amsdu_to_msdu(struct adapter *padapter, 
> struct recv_frame *prframe)
>  
>   /* Allocate new skb for releasing to upper layer */
>   sub_skb = dev_alloc_skb(nSubframe_Length + 12);
> - if (sub_skb) {
> - skb_reserve(sub_skb, 12);
> - skb_put_data(sub_skb, pdata, nSubframe_Length);
> - } else {
> - sub_skb = skb_clone(prframe->pkt, GFP_ATOMIC);
> - if (sub_skb) {
> - sub_skb->data = pdata;
> - sub_skb->len = nSubframe_Length;
> - skb_set_tail_pointer(sub_skb, nSubframe_Length);
> - } else {
> - DBG_88E("skb_clone() Fail!!! , 
> nr_subframes=%d\n", nr_subframes);
> - break;
> - }
> + if (!sub_skb) {
> + DBG_88E("dev_alloc_skb() Fail!!! , nr_subframes=%d\n", 
> nr_subframes);
> + break;
>   }
>  
> + skb_reserve(sub_skb, 12);
> + skb_put_data(sub_skb, pdata, nSubframe_Length);
> +

Have you tested this?

thanks,

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


Re: [PATCH] staging: wfx: cleanup long lines in data_tx.c

2020-04-23 Thread Dan Carpenter
On Thu, Apr 23, 2020 at 09:29:28AM +, Jerome Pouiller wrote:
> > req->data_flags.fc_offset = offset;
> > if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)
> > req->data_flags.after_dtim = 1;
> > @@ -517,7 +523,8 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const 
> > struct hif_cnf_tx *arg)
> > if (tx_count < rate->count &&
> > arg->status == HIF_STATUS_RETRY_EXCEEDED &&
> > arg->ack_failures)
> > -   dev_dbg(wvif->wdev->dev, "all retries were not 
> > consumed: %d != %d\n",
> > +   dev_dbg(wvif->wdev->dev,
> > +   "all retries were not consumed: %d != %d\n",
> 
> Is this reported by checkpatch? The strings can exceed 80 columns.
> 

The string can go over 80 characters, but it's nice to do our best to
avoid it so we do normally break it up like this where the string is
on its own line.

regards,
dan carpenter

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


Re: [PATCH] staging: wfx: cleanup long lines in data_tx.c

2020-04-23 Thread Jerome Pouiller
Hello Suraj,

Thank you for your contribution.

On Wednesday 22 April 2020 17:39:00 CEST Suraj Upadhyay wrote:
> 
> Break lines with length over 80 characters to conform
> to the linux coding style. Issue found by checkpatch.
> 
> Signed-off-by: Suraj Upadhyay 
> ---
>  drivers/staging/wfx/data_tx.c | 25 +
>  1 file changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
> index c30e4f5b6e2d..85ad94de20e5 100644
> --- a/drivers/staging/wfx/data_tx.c
> +++ b/drivers/staging/wfx/data_tx.c
> @@ -165,7 +165,8 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif)
> spin_lock_bh(>tx_policy_cache.lock);
> for (i = 0; i < HIF_TX_RETRY_POLICY_MAX; ++i)
> if (!policies[i].uploaded &&
> -   memzcmp(policies[i].rates, 
> sizeof(policies[i].rates)))
> +   memzcmp(policies[i].rates,
> +   sizeof(policies[i].rates)))

hmm... since memzcmp() is called from a if condition, I am not sure that
breaking the line improves the readability. May be you should introduce a
temporary variable instead.

Before that line, I also see a line that exceed 80 columns in
wfx_get_hw_rate() could also address it?


> break;
> if (i < HIF_TX_RETRY_POLICY_MAX) {
> policies[i].uploaded = true;
> @@ -290,7 +291,8 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate 
> *rates)
> if (rates[i].idx == -1) {
> rates[i].idx = 0;
> rates[i].count = 8; // == hw->max_rate_tries
> -   rates[i].flags = rates[i - 1].flags & 
> IEEE80211_TX_RC_MCS;
> +   rates[i].flags = rates[i - 1].flags &
> +IEEE80211_TX_RC_MCS;

Ack.

> break;
> }
> }
> @@ -318,7 +320,9 @@ static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif,
> return rate_id;
>  }
> 
> -static struct hif_ht_tx_parameters wfx_tx_get_tx_parms(struct wfx_dev *wdev, 
> struct ieee80211_tx_info *tx_info)
> +static struct
> +hif_ht_tx_parameters wfx_tx_get_tx_parms(struct wfx_dev *wdev,
> +struct ieee80211_tx_info *tx_info)

Please, dont't break between 'struct' and name of the struct. In add, in
the rest of the file, there is no line break between the returned type the
name of the function. Let's try to keep it uniform.

>  {
> struct ieee80211_tx_rate *rate = _info->driver_rates[0];
> struct hif_ht_tx_parameters ret = { };
> @@ -381,7 +385,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct 
> ieee80211_sta *sta,
> hif_msg->id = HIF_REQ_ID_TX;
> hif_msg->interface = wvif->id;
> if (skb->len > wvif->wdev->hw_caps.size_inp_ch_buf) {
> -   dev_warn(wvif->wdev->dev, "requested frame size (%d) is 
> larger than maximum supported (%d)\n",
> +   dev_warn(wvif->wdev->dev,
> +"requested frame size (%d) is larger than maximum 
> supported (%d)\n",
>  skb->len, wvif->wdev->hw_caps.size_inp_ch_buf);
> skb_pull(skb, wmsg_len);
> return -EIO;
> @@ -394,7 +399,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct 
> ieee80211_sta *sta,
> // data for debug.
> req->packet_id = queue_id << 28 |
>  IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 
> 16 |
> -(atomic_add_return(1, >wdev->packet_id) & 
> 0x);
> +(atomic_add_return(1, >wdev->packet_id) &
> + 0x);

Since the line is already split on '|', I am not sure that adding a break
here improve the readability. Maybe:

 req->packet_id = atomic_add_return(1, >wdev->packet_id) & 0x;
 req->packet_id |= IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 
16;
 req->packet_id |= queue_id << 28;

or maybe if you introduce "struct wfx_dev *wdev = wvif->wdev;", you would
simplify the things.

> req->data_flags.fc_offset = offset;
> if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)
> req->data_flags.after_dtim = 1;
> @@ -517,7 +523,8 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct 
> hif_cnf_tx *arg)
> if (tx_count < rate->count &&
> arg->status == HIF_STATUS_RETRY_EXCEEDED &&
> arg->ack_failures)
> -   dev_dbg(wvif->wdev->dev, "all retries were not 
> consumed: %d != %d\n",
> +   dev_dbg(wvif->wdev->dev,
> +   "all retries were not consumed: %d != %d\n",

Is this reported by checkpatch? The strings can exceed 80 columns.

> rate->count, tx_count);
>