* [PATCH] Drivers:staging:vt6656: Fixed checkpatch warning
@ 2014-11-25 12:15 Athira Lekshmi C V
2014-11-25 12:17 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Athira Lekshmi C V @ 2014-11-25 12:15 UTC (permalink / raw)
To: gregkh; +Cc: forest, tvboxspy, devel, linux-kernel, Athira Lekshmi C V
Fixed the checkpatch warning:
WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
Signed-off-by: Athira Lekshmi C V <andnlnbn18@gmail.com>
---
drivers/staging/vt6656/rxtx.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index ea5140a..ede71a4 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -392,8 +392,8 @@ static int vnt_fill_ieee80211_rts(struct vnt_usb_send_context *tx_context,
rts->frame_control =
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
- memcpy(rts->ra, hdr->addr1, ETH_ALEN);
- memcpy(rts->ta, hdr->addr2, ETH_ALEN);
+ ether_addr_copy(rts->ra, hdr->addr1);
+ ether_addr_copy(rts->ta, hdr->addr2);
return 0;
}
@@ -552,7 +552,7 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
buf->data.frame_control =
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
- memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
+ ether_addr_copy(buf->data.ra, priv->current_net_addr);
return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
} else {
@@ -570,7 +570,7 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
buf->data.frame_control =
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
- memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
+ ether_addr_copy(buf->data.ra, priv->current_net_addr);
return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
}
@@ -739,7 +739,7 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context,
mic_hdr->id = 0x59;
mic_hdr->payload_len = cpu_to_be16(payload_len);
- memcpy(mic_hdr->mic_addr2, hdr->addr2, ETH_ALEN);
+ ether_addr_copy(mic_hdr->mic_addr2, hdr->addr2);
ieee80211_get_key_tx_seq(tx_key, &seq);
@@ -750,9 +750,9 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context,
else
mic_hdr->hlen = cpu_to_be16(22);
- memcpy(mic_hdr->addr1, hdr->addr1, ETH_ALEN);
- memcpy(mic_hdr->addr2, hdr->addr2, ETH_ALEN);
- memcpy(mic_hdr->addr3, hdr->addr3, ETH_ALEN);
+ ether_addr_copy(mic_hdr->addr1, hdr->addr1);
+ ether_addr_copy(mic_hdr->addr2, hdr->addr2);
+ ether_addr_copy(mic_hdr->addr3, hdr->addr3);
mic_hdr->frame_control = cpu_to_le16(
le16_to_cpu(hdr->frame_control) & 0xc78f);
@@ -760,7 +760,7 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context,
le16_to_cpu(hdr->seq_ctrl) & 0xf);
if (ieee80211_has_a4(hdr->frame_control))
- memcpy(mic_hdr->addr4, hdr->addr4, ETH_ALEN);
+ ether_addr_copy(mic_hdr->addr4, hdr->addr4);
memcpy(key_buffer, tx_key->key, WLAN_KEY_LEN_CCMP);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Drivers:staging:vt6656: Fixed checkpatch warning
2014-11-25 12:15 [PATCH] Drivers:staging:vt6656: Fixed checkpatch warning Athira Lekshmi C V
@ 2014-11-25 12:17 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-11-25 12:17 UTC (permalink / raw)
To: Athira Lekshmi C V; +Cc: gregkh, tvboxspy, devel, forest, linux-kernel
On Tue, Nov 25, 2014 at 05:45:40PM +0530, Athira Lekshmi C V wrote:
> Fixed the checkpatch warning:
> WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
For these changes the change log must say how you determined both
source and destination are aligned correctly.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Drivers:Staging:vt6656: Fixed checkpatch warning
@ 2014-11-25 13:35 Athira Lekshmi C V
2014-11-25 13:59 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Athira Lekshmi C V @ 2014-11-25 13:35 UTC (permalink / raw)
To: gregkh; +Cc: forest, tvboxspy, devel, linux-kernel, Athira Lekshmi C V
Fixed the checkpatch warning:
WARNING: else is not generally useful after a break or return
Signed-off-by: Athira Lekshmi C V <andnlnbn18@gmail.com>
---
drivers/staging/vt6656/rxtx.c | 35 ++++++++++++++++-------------------
1 file changed, 16 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index ea5140a..af79be8 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -555,27 +555,24 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
- } else {
- struct vnt_cts *buf = &head->cts_g;
- /* Get SignalField,ServiceField,Length */
- vnt_get_phy_field(priv, cts_frame_len,
- priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b);
- /* Get CTSDuration_ba */
- buf->duration_ba =
- vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA,
- tx_context->pkt_type,
- current_rate);
- /*Get CTS Frame body*/
- buf->data.duration = buf->duration_ba;
- buf->data.frame_control =
- cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
-
- memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
-
- return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
}
+ struct vnt_cts *buf = &head->cts_g;
+ /* Get SignalField,ServiceField,Length */
+ vnt_get_phy_field(priv, cts_frame_len,
+ priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b);
+ /* Get CTSDuration_ba */
+ buf->duration_ba =
+ vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA,
+ tx_context->pkt_type,
+ current_rate);
+ /*Get CTS Frame body*/
+ buf->data.duration = buf->duration_ba;
+ buf->data.frame_control =
+ cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
- return 0;
+ memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
+
+ return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
}
static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Drivers:Staging:vt6656: Fixed checkpatch warning
2014-11-25 13:35 [PATCH] Drivers:Staging:vt6656: " Athira Lekshmi C V
@ 2014-11-25 13:59 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-11-25 13:59 UTC (permalink / raw)
To: Athira Lekshmi C V; +Cc: gregkh, tvboxspy, devel, forest, linux-kernel
On Tue, Nov 25, 2014 at 07:05:51PM +0530, Athira Lekshmi C V wrote:
> Fixed the checkpatch warning:
> WARNING: else is not generally useful after a break or return
>
This patch adds a compile warning.
> Signed-off-by: Athira Lekshmi C V <andnlnbn18@gmail.com>
Btw, signing and from should be your legal name that you would use for
signing a document. The signed off by is supposed to mean that you
didn't violate copyrights. If you normally sign with "C V" that's fine
as well.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-11-25 13:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25 12:15 [PATCH] Drivers:staging:vt6656: Fixed checkpatch warning Athira Lekshmi C V
2014-11-25 12:17 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2014-11-25 13:35 [PATCH] Drivers:Staging:vt6656: " Athira Lekshmi C V
2014-11-25 13:59 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox