* [PATCH] mac80211: remove redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c)
@ 2008-10-02 12:56 Rami Rosen
2008-10-02 13:27 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Rami Rosen @ 2008-10-02 12:56 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, johannes
[-- Attachment #1: Type: text/plain, Size: 491 bytes --]
Hi,
- This patch (against the linux-wireless-next git tree) removes a
redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c).
In this method, there is no need to call again the
ieee80211_is_data() method; this is checked immediately before, in the
"if" command (we will not enter this block unless ieee80211_is_data()
is true, so that the "and" (&&) condition in that "if" command will be
fullfilled ).
Regards,
Rami Rosen
Signed-off-by: Rami Rosen <ramirose@gmail.com>
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 824 bytes --]
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0cc2e23..a29260c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1296,7 +1296,6 @@ int ieee80211_master_start_xmit(struct sk_buff *skb,
if (ieee80211_vif_is_mesh(&osdata->vif) &&
ieee80211_is_data(hdr->frame_control)) {
- if (ieee80211_is_data(hdr->frame_control)) {
if (is_multicast_ether_addr(hdr->addr3))
memcpy(hdr->addr1, hdr->addr3, ETH_ALEN);
else
@@ -1305,7 +1304,6 @@ int ieee80211_master_start_xmit(struct sk_buff *skb,
if (memcmp(odev->dev_addr, hdr->addr4, ETH_ALEN) != 0)
IEEE80211_IFSTA_MESH_CTR_INC(&osdata->u.mesh,
fwded_frames);
- }
} else if (unlikely(osdata->vif.type == NL80211_IFTYPE_MONITOR)) {
struct ieee80211_sub_if_data *sdata;
struct ieee80211_local *local = osdata->local;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: remove redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c)
2008-10-02 12:56 [PATCH] mac80211: remove redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c) Rami Rosen
@ 2008-10-02 13:27 ` Johannes Berg
2008-10-02 13:48 ` [PATCH] [RESEND] " Rami Rosen
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2008-10-02 13:27 UTC (permalink / raw)
To: Rami Rosen; +Cc: linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 562 bytes --]
On Thu, 2008-10-02 at 15:56 +0300, Rami Rosen wrote:
> Hi,
>
> - This patch (against the linux-wireless-next git tree) removes a
> redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c).
>
> In this method, there is no need to call again the
> ieee80211_is_data() method; this is checked immediately before, in the
> "if" command (we will not enter this block unless ieee80211_is_data()
> is true, so that the "and" (&&) condition in that "if" command will be
> fullfilled ).
You should un-indent the code accordingly.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] [RESEND] mac80211: remove redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c)
2008-10-02 13:27 ` Johannes Berg
@ 2008-10-02 13:48 ` Rami Rosen
2008-10-02 18:05 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Rami Rosen @ 2008-10-02 13:48 UTC (permalink / raw)
To: Johannes Berg; +Cc: linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
Hi,
- This patch (against the linux-wireless-next git tree) removes a
redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c)
and adjust indentation in this method accordingly.
In this method, there is no need to call again the
ieee80211_is_data() method; this is checked immediately before, in the
"if" command (we will not enter this block unless ieee80211_is_data()
is true, so that the "and" (&&) condition in that "if" command will be
fullfilled ).
Regards,
Rami Rosen
Signed-off-by: Rami Rosen <ramirose@gmail.com>
On Thu, Oct 2, 2008 at 4:27 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Thu, 2008-10-02 at 15:56 +0300, Rami Rosen wrote:
>> Hi,
>>
>> - This patch (against the linux-wireless-next git tree) removes a
>> redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c).
>>
>> In this method, there is no need to call again the
>> ieee80211_is_data() method; this is checked immediately before, in the
>> "if" command (we will not enter this block unless ieee80211_is_data()
>> is true, so that the "and" (&&) condition in that "if" command will be
>> fullfilled ).
>
> You should un-indent the code accordingly.
>
> johannes
>
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1102 bytes --]
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0cc2e23..6673252 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1296,16 +1296,14 @@ int ieee80211_master_start_xmit(struct sk_buff *skb,
if (ieee80211_vif_is_mesh(&osdata->vif) &&
ieee80211_is_data(hdr->frame_control)) {
- if (ieee80211_is_data(hdr->frame_control)) {
- if (is_multicast_ether_addr(hdr->addr3))
- memcpy(hdr->addr1, hdr->addr3, ETH_ALEN);
- else
- if (mesh_nexthop_lookup(skb, osdata))
- return 0;
- if (memcmp(odev->dev_addr, hdr->addr4, ETH_ALEN) != 0)
- IEEE80211_IFSTA_MESH_CTR_INC(&osdata->u.mesh,
- fwded_frames);
- }
+ if (is_multicast_ether_addr(hdr->addr3))
+ memcpy(hdr->addr1, hdr->addr3, ETH_ALEN);
+ else
+ if (mesh_nexthop_lookup(skb, osdata))
+ return 0;
+ if (memcmp(odev->dev_addr, hdr->addr4, ETH_ALEN) != 0)
+ IEEE80211_IFSTA_MESH_CTR_INC(&osdata->u.mesh,
+ fwded_frames);
} else if (unlikely(osdata->vif.type == NL80211_IFTYPE_MONITOR)) {
struct ieee80211_sub_if_data *sdata;
struct ieee80211_local *local = osdata->local;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] [RESEND] mac80211: remove redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c)
2008-10-02 13:48 ` [PATCH] [RESEND] " Rami Rosen
@ 2008-10-02 18:05 ` Johannes Berg
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2008-10-02 18:05 UTC (permalink / raw)
To: Rami Rosen; +Cc: linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 943 bytes --]
On Thu, 2008-10-02 at 16:48 +0300, Rami Rosen wrote:
> Hi,
>
> - This patch (against the linux-wireless-next git tree) removes a
> redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c)
> and adjust indentation in this method accordingly.
>
> In this method, there is no need to call again the
> ieee80211_is_data() method; this is checked immediately before, in the
> "if" command (we will not enter this block unless ieee80211_is_data()
> is true, so that the "and" (&&) condition in that "if" command will be
> fullfilled ).
Looks good to me, but I think you should look a bit more into how to
format a proper patch and try to send it inline rather than as an
attachment. Have you seen http://linux.yyz.us/patch-format.html? The
main point I guess is that we don't want to have the "Hi," and
"Regards, ..." stuff in the kernel changelog.
Acked-by: Johannes Berg <johannes@sipsolutions.net>
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-10-02 18:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-02 12:56 [PATCH] mac80211: remove redundant check in ieee80211_master_start_xmit (net/mac80211/tx.c) Rami Rosen
2008-10-02 13:27 ` Johannes Berg
2008-10-02 13:48 ` [PATCH] [RESEND] " Rami Rosen
2008-10-02 18:05 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox