netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] qed: Replace memset with eth_zero_addr
@ 2017-01-16  3:44 Shyam Saini
  2017-01-16  3:44 ` [PATCH 2/2] " Shyam Saini
  2017-01-16  4:38 ` [PATCH 1/2] " David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Shyam Saini @ 2017-01-16  3:44 UTC (permalink / raw)
  To: Yuval.Mintz; +Cc: Ariel.Elior, everest-linux-l2, netdev, Shyam Saini

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Also, it makes the code clearer

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
---
 drivers/net/ethernet/qlogic/qed/qed_l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c
index 6a3727c..778c52c 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
@@ -1776,7 +1776,7 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
 	qed_fill_dev_info(cdev, &info->common);
 
 	if (IS_VF(cdev))
-		memset(info->common.hw_mac, 0, ETH_ALEN);
+		eth_zero_addr(info->common.hw_mac);
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] qed: Replace memset with eth_zero_addr
  2017-01-16  3:44 [PATCH 1/2] qed: Replace memset with eth_zero_addr Shyam Saini
@ 2017-01-16  3:44 ` Shyam Saini
  2017-01-16  4:38 ` [PATCH 1/2] " David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: Shyam Saini @ 2017-01-16  3:44 UTC (permalink / raw)
  To: Yuval.Mintz; +Cc: Ariel.Elior, everest-linux-l2, netdev, Shyam Saini

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Also, it makes the code clearer

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
---
 drivers/net/ethernet/qlogic/qed/qed_sriov.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
index 85b09dd..a15fff4 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
@@ -1199,7 +1199,7 @@ static void qed_iov_clean_vf(struct qed_hwfn *p_hwfn, u8 vfid)
 		return;
 
 	/* Clear the VF mac */
-	memset(vf_info->mac, 0, ETH_ALEN);
+	eth_zero_addr(vf_info->mac);
 }
 
 static void qed_iov_vf_cleanup(struct qed_hwfn *p_hwfn,
@@ -2539,8 +2539,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
 		for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++) {
 			if (ether_addr_equal(p_vf->shadow_config.macs[i],
 					     p_params->mac)) {
-				memset(p_vf->shadow_config.macs[i], 0,
-				       ETH_ALEN);
+				eth_zero_addr(p_vf->shadow_config.macs[i]);
 				break;
 			}
 		}
@@ -2553,7 +2552,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
 	} else if (p_params->opcode == QED_FILTER_REPLACE ||
 		   p_params->opcode == QED_FILTER_FLUSH) {
 		for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++)
-			memset(p_vf->shadow_config.macs[i], 0, ETH_ALEN);
+			eth_zero_addr(p_vf->shadow_config.macs[i]);
 	}
 
 	/* List the new MAC address */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] qed: Replace memset with eth_zero_addr
  2017-01-16  3:44 [PATCH 1/2] qed: Replace memset with eth_zero_addr Shyam Saini
  2017-01-16  3:44 ` [PATCH 2/2] " Shyam Saini
@ 2017-01-16  4:38 ` David Miller
  2017-01-16  9:24   ` Shyam Saini
  1 sibling, 1 reply; 8+ messages in thread
From: David Miller @ 2017-01-16  4:38 UTC (permalink / raw)
  To: mayhs11saini; +Cc: Yuval.Mintz, Ariel.Elior, everest-linux-l2, netdev


Please do not ever submit two patches which have the same exact commit
header line, as these two patches do.

When someone looks into the shortlog of GIT history all they will see
is "qed: Replace memset with eth_zero_addr" twice.

This gives the reader no idea what might be different between those
two changes.

Therefore you must give unique a commit header text for each change,
which communicates sufficiently what is different in each change.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] qed: Replace memset with eth_zero_addr
  2017-01-16  4:38 ` [PATCH 1/2] " David Miller
@ 2017-01-16  9:24   ` Shyam Saini
  2017-01-16 16:46     ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Shyam Saini @ 2017-01-16  9:24 UTC (permalink / raw)
  To: David Miller; +Cc: Yuval.Mintz, Ariel.Elior, everest-linux-l2, netdev

On Sun, Jan 15, 2017 at 11:38:30PM -0500, David Miller wrote:
> 
> Please do not ever submit two patches which have the same exact commit
> header line, as these two patches do.
> 
> When someone looks into the shortlog of GIT history all they will see
> is "qed: Replace memset with eth_zero_addr" twice.
> 
> This gives the reader no idea what might be different between those
> two changes.
> 
> Therefore you must give unique a commit header text for each change,
> which communicates sufficiently what is different in each change.

Thanks a lot for correcting me. I'll take care of this thing.

I'm resending these two patches as 
	1). qed: Replace memset with eth_zero_addr
	2). qed: Use eth_zero_addr
	
I hope it resolves same commit header line conflict.

Regards,
Shyam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] qed: Replace memset with eth_zero_addr
  2017-01-16  9:24   ` Shyam Saini
@ 2017-01-16 16:46     ` David Miller
  2017-01-16 17:05       ` Mintz, Yuval
  2017-01-16 17:40       ` Shyam Saini
  0 siblings, 2 replies; 8+ messages in thread
From: David Miller @ 2017-01-16 16:46 UTC (permalink / raw)
  To: mayhs11saini; +Cc: Yuval.Mintz, Ariel.Elior, everest-linux-l2, netdev

From: Shyam Saini <mayhs11saini@gmail.com>
Date: Mon, 16 Jan 2017 14:54:35 +0530

> On Sun, Jan 15, 2017 at 11:38:30PM -0500, David Miller wrote:
>> 
>> Please do not ever submit two patches which have the same exact commit
>> header line, as these two patches do.
>> 
>> When someone looks into the shortlog of GIT history all they will see
>> is "qed: Replace memset with eth_zero_addr" twice.
>> 
>> This gives the reader no idea what might be different between those
>> two changes.
>> 
>> Therefore you must give unique a commit header text for each change,
>> which communicates sufficiently what is different in each change.
> 
> Thanks a lot for correcting me. I'll take care of this thing.
> 
> I'm resending these two patches as 
> 	1). qed: Replace memset with eth_zero_addr
> 	2). qed: Use eth_zero_addr
> 	
> I hope it resolves same commit header line conflict.

You aren't understanding the point.

Those two lines still say exactly the same thing.

What is different about these two changes?  The answer to that question
must propagate into those lines of text.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/2] qed: Replace memset with eth_zero_addr
  2017-01-16 16:46     ` David Miller
@ 2017-01-16 17:05       ` Mintz, Yuval
  2017-01-16 17:12         ` David Miller
  2017-01-16 17:40       ` Shyam Saini
  1 sibling, 1 reply; 8+ messages in thread
From: Mintz, Yuval @ 2017-01-16 17:05 UTC (permalink / raw)
  To: mayhs11saini; +Cc: netdev, David Miller

> > On Sun, Jan 15, 2017 at 11:38:30PM -0500, David Miller wrote:
> >>
> >> Please do not ever submit two patches which have the same exact
> >> commit header line, as these two patches do.
> >>
> >> When someone looks into the shortlog of GIT history all they will see
> >> is "qed: Replace memset with eth_zero_addr" twice.
> >>
> >> This gives the reader no idea what might be different between those
> >> two changes.
> >>
> >> Therefore you must give unique a commit header text for each change,
> >> which communicates sufficiently what is different in each change.
> >
> > Thanks a lot for correcting me. I'll take care of this thing.
> >
> > I'm resending these two patches as
> > 	1). qed: Replace memset with eth_zero_addr
> > 	2). qed: Use eth_zero_addr
> >
> > I hope it resolves same commit header line conflict.
> 
> You aren't understanding the point.
> 
> Those two lines still say exactly the same thing.
> 
> What is different about these two changes?  The answer to that question
> must propagate into those lines of text.

Other than the fact these 2 patches change 2 different qed files,
is there any significant difference between what each does?
If not, why not simply do both in a single patch?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] qed: Replace memset with eth_zero_addr
  2017-01-16 17:05       ` Mintz, Yuval
@ 2017-01-16 17:12         ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2017-01-16 17:12 UTC (permalink / raw)
  To: Yuval.Mintz; +Cc: mayhs11saini, netdev

From: "Mintz, Yuval" <Yuval.Mintz@cavium.com>
Date: Mon, 16 Jan 2017 17:05:05 +0000

> Other than the fact these 2 patches change 2 different qed files,

That's what I was trying to hint at, the locations within the drivers
were the unique element.

> is there any significant difference between what each does?
> If not, why not simply do both in a single patch?

Also agreed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] qed: Replace memset with eth_zero_addr
  2017-01-16 16:46     ` David Miller
  2017-01-16 17:05       ` Mintz, Yuval
@ 2017-01-16 17:40       ` Shyam Saini
  1 sibling, 0 replies; 8+ messages in thread
From: Shyam Saini @ 2017-01-16 17:40 UTC (permalink / raw)
  To: David Miller; +Cc: Yuval.Mintz, Ariel.Elior, everest-linux-l2, netdev

On Mon, Jan 16, 2017 at 11:46:06AM -0500, David Miller wrote:
> From: Shyam Saini <mayhs11saini@gmail.com>
> Date: Mon, 16 Jan 2017 14:54:35 +0530
> 
> > On Sun, Jan 15, 2017 at 11:38:30PM -0500, David Miller wrote:
> >> 
> >> Please do not ever submit two patches which have the same exact commit
> >> header line, as these two patches do.
> >> 
> >> When someone looks into the shortlog of GIT history all they will see
> >> is "qed: Replace memset with eth_zero_addr" twice.
> >> 
> >> This gives the reader no idea what might be different between those
> >> two changes.
> >> 
> >> Therefore you must give unique a commit header text for each change,
> >> which communicates sufficiently what is different in each change.
> > 
> > Thanks a lot for correcting me. I'll take care of this thing.
> > 
> > I'm resending these two patches as 
> > 	1). qed: Replace memset with eth_zero_addr
> > 	2). qed: Use eth_zero_addr
> > 	
> > I hope it resolves same commit header line conflict.
> 
> You aren't understanding the point.
> 
> Those two lines still say exactly the same thing.
> 
> What is different about these two changes?  The answer to that question
> must propagate into those lines of text.

I got your point now. As pointed by you and Mintz,  I'll resend it
as a single patch. 

I sincerely appreciate your efforts for making things clearer and
correcting me.

Thanks a lot,
Shyam

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-01-16 17:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-16  3:44 [PATCH 1/2] qed: Replace memset with eth_zero_addr Shyam Saini
2017-01-16  3:44 ` [PATCH 2/2] " Shyam Saini
2017-01-16  4:38 ` [PATCH 1/2] " David Miller
2017-01-16  9:24   ` Shyam Saini
2017-01-16 16:46     ` David Miller
2017-01-16 17:05       ` Mintz, Yuval
2017-01-16 17:12         ` David Miller
2017-01-16 17:40       ` Shyam Saini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).