All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Replace data type declarations with variables of  same types in several source files.
@ 2016-10-10 14:02 Sergio Paracuellos
  2016-10-10 14:02 ` [PATCH 1/5] staging: wlan-ng: Replace data type declaration with variable of same type in cfg80211.c Sergio Paracuellos
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2016-10-10 14:02 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

This patch series replaces several sizeof(struct XXX) stuff in favour 
of sizeof(var) which is the preferred one.

Sergio Paracuellos (5):
  staging: wlan-ng: Replace data type declaration with variable of same
    type in cfg80211.c
  staging: wlan-ng: Replace data type declaration with variable of same
    type in hfa384x_usb.c
  staging: wlan-ng: Replace data type declaration with variable of same
    type in p80211conv.c
  staging: wlan-ng: Replace data type declaration with variable of same
    type in p80211netdev.c
  staging: wlan-ng: Replace data type declaration with variable of same
    type in prism2sta.c

 drivers/staging/wlan-ng/cfg80211.c     |  2 +-
 drivers/staging/wlan-ng/hfa384x_usb.c  |  2 +-
 drivers/staging/wlan-ng/p80211conv.c   |  2 +-
 drivers/staging/wlan-ng/p80211netdev.c | 12 ++++++------
 drivers/staging/wlan-ng/prism2sta.c    |  6 +++---
 5 files changed, 12 insertions(+), 12 deletions(-)

-- 
1.9.1

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

* [PATCH 1/5] staging: wlan-ng: Replace data type declaration with variable of same type in cfg80211.c
  2016-10-10 14:02 [PATCH 0/5] Replace data type declarations with variables of same types in several source files Sergio Paracuellos
@ 2016-10-10 14:02 ` Sergio Paracuellos
  2016-10-10 14:02 ` [PATCH 2/5] staging: wlan-ng: Replace data type declaration with variable of same type in hfa384x_usb.c Sergio Paracuellos
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2016-10-10 14:02 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

sizeof(var) instead of sizeof(struct XXX) is preferred. 
Fix it in cfg80211.c file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/cfg80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
index 182b2d5..67c48a8 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -323,7 +323,7 @@ static int prism2_scan(struct wiphy *wiphy,
 
 	priv->scan_request = request;
 
-	memset(&msg1, 0x00, sizeof(struct p80211msg_dot11req_scan));
+	memset(&msg1, 0x00, sizeof(msg1));
 	msg1.msgcode = DIDmsg_dot11req_scan;
 	msg1.bsstype.data = P80211ENUM_bsstype_any;
 
-- 
1.9.1

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

* [PATCH 2/5] staging: wlan-ng: Replace data type declaration with variable of same type in hfa384x_usb.c
  2016-10-10 14:02 [PATCH 0/5] Replace data type declarations with variables of same types in several source files Sergio Paracuellos
  2016-10-10 14:02 ` [PATCH 1/5] staging: wlan-ng: Replace data type declaration with variable of same type in cfg80211.c Sergio Paracuellos
@ 2016-10-10 14:02 ` Sergio Paracuellos
  2016-10-10 14:02 ` [PATCH 3/5] staging: wlan-ng: Replace data type declaration with variable of same type in p80211conv.c Sergio Paracuellos
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2016-10-10 14:02 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

sizeof(var) instead of sizeof(struct XXX) is preferred.
Fix it in hfa384x_usb.c file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index fbd9dc6..a83026e 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -531,7 +531,7 @@ static void hfa384x_usb_defer(struct work_struct *data)
  */
 void hfa384x_create(struct hfa384x *hw, struct usb_device *usb)
 {
-	memset(hw, 0, sizeof(struct hfa384x));
+	memset(hw, 0, sizeof(*hw));
 	hw->usb = usb;
 
 	/* set up the endpoints */
-- 
1.9.1

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

* [PATCH 3/5] staging: wlan-ng: Replace data type declaration with variable of same type in p80211conv.c
  2016-10-10 14:02 [PATCH 0/5] Replace data type declarations with variables of same types in several source files Sergio Paracuellos
  2016-10-10 14:02 ` [PATCH 1/5] staging: wlan-ng: Replace data type declaration with variable of same type in cfg80211.c Sergio Paracuellos
  2016-10-10 14:02 ` [PATCH 2/5] staging: wlan-ng: Replace data type declaration with variable of same type in hfa384x_usb.c Sergio Paracuellos
@ 2016-10-10 14:02 ` Sergio Paracuellos
  2016-10-10 14:02 ` [PATCH 4/5] staging: wlan-ng: Replace data type declaration with variable of same type in p80211netdev.c Sergio Paracuellos
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2016-10-10 14:02 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

sizeof(*var) instead of sizeof(struct XXX) is preferred. 
Fix it in p80211conv.c file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/p80211conv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index 0247cbc..bbed7ff 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -615,7 +615,7 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
 	}
 
 	/* Allocate the rxmeta */
-	rxmeta = kzalloc(sizeof(struct p80211_rxmeta), GFP_ATOMIC);
+	rxmeta = kzalloc(sizeof(*rxmeta), GFP_ATOMIC);
 
 	if (!rxmeta) {
 		netdev_err(wlandev->netdev,
-- 
1.9.1

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

* [PATCH 4/5]  staging: wlan-ng: Replace data type declaration with variable of same type in p80211netdev.c
  2016-10-10 14:02 [PATCH 0/5] Replace data type declarations with variables of same types in several source files Sergio Paracuellos
                   ` (2 preceding siblings ...)
  2016-10-10 14:02 ` [PATCH 3/5] staging: wlan-ng: Replace data type declaration with variable of same type in p80211conv.c Sergio Paracuellos
@ 2016-10-10 14:02 ` Sergio Paracuellos
  2016-10-10 14:02 ` [PATCH 5/5] staging: wlan-ng: Replace data type declaration with variable of same type in prism2sta.c Sergio Paracuellos
  2016-10-16  8:24 ` [PATCH 0/5] Replace data type declarations with variables of same types in several source files Alexander Alemayhu
  5 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2016-10-10 14:02 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

sizeof(var) instead of sizeof(struct XXX) is preferred. 
Fix them in p80211netdev.c

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/p80211netdev.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
index 825a63a..3a95b36 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -336,8 +336,8 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
 		goto failed;
 	}
 
-	memset(&p80211_hdr, 0, sizeof(union p80211_hdr));
-	memset(&p80211_wep, 0, sizeof(struct p80211_metawep));
+	memset(&p80211_hdr, 0, sizeof(p80211_hdr));
+	memset(&p80211_wep, 0, sizeof(p80211_wep));
 
 	if (netif_queue_stopped(netdev)) {
 		netdev_dbg(netdev, "called when queue stopped.\n");
@@ -375,8 +375,8 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
 			goto failed;
 		}
 		/* move the header over */
-		memcpy(&p80211_hdr, skb->data, sizeof(union p80211_hdr));
-		skb_pull(skb, sizeof(union p80211_hdr));
+		memcpy(&p80211_hdr, skb->data, sizeof(p80211_hdr));
+		skb_pull(skb, sizeof(p80211_hdr));
 	} else {
 		if (skb_ether_to_p80211
 		    (wlandev, wlandev->ethconv, skb, &p80211_hdr,
@@ -629,9 +629,9 @@ static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr)
 	resultcode = &dot11req.resultcode;
 
 	/* Set up a dot11req_mibset */
-	memset(&dot11req, 0, sizeof(struct p80211msg_dot11req_mibset));
+	memset(&dot11req, 0, sizeof(dot11req));
 	dot11req.msgcode = DIDmsg_dot11req_mibset;
-	dot11req.msglen = sizeof(struct p80211msg_dot11req_mibset);
+	dot11req.msglen = sizeof(dot11req);
 	memcpy(dot11req.devname,
 	       ((struct wlandevice *)dev->ml_priv)->name, WLAN_DEVNAMELEN_MAX - 1);
 
-- 
1.9.1

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

* [PATCH 5/5] staging: wlan-ng: Replace data type declaration with variable of same type in prism2sta.c
  2016-10-10 14:02 [PATCH 0/5] Replace data type declarations with variables of same types in several source files Sergio Paracuellos
                   ` (3 preceding siblings ...)
  2016-10-10 14:02 ` [PATCH 4/5] staging: wlan-ng: Replace data type declaration with variable of same type in p80211netdev.c Sergio Paracuellos
@ 2016-10-10 14:02 ` Sergio Paracuellos
  2016-10-16  8:24 ` [PATCH 0/5] Replace data type declarations with variables of same types in several source files Alexander Alemayhu
  5 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2016-10-10 14:02 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

sizeof(*var) instead of sizeof(struct XXX) is preferred.
Fix them in prism2sta.c file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/wlan-ng/prism2sta.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
index b3ae2bb..351f08d 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -1102,8 +1102,7 @@ static void prism2sta_inf_hostscanresults(struct wlandevice *wlandev,
 
 	kfree(hw->scanresults);
 
-	hw->scanresults = kmemdup(inf, sizeof(struct hfa384x_inf_frame),
-				  GFP_ATOMIC);
+	hw->scanresults = kmemdup(inf, sizeof(*inf), GFP_ATOMIC);
 
 	if (nbss == 0)
 		nbss = -1;
@@ -1888,8 +1887,8 @@ static struct wlandevice *create_wlan(void)
 	struct hfa384x *hw = NULL;
 
 	/* Alloc our structures */
-	wlandev = kzalloc(sizeof(struct wlandevice), GFP_KERNEL);
-	hw = kzalloc(sizeof(struct hfa384x), GFP_KERNEL);
+	wlandev = kzalloc(sizeof(*wlandev), GFP_KERNEL);
+	hw = kzalloc(sizeof(*hw), GFP_KERNEL);
 
 	if (!wlandev || !hw) {
 		kfree(wlandev);
-- 
1.9.1

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

* Re: [PATCH 0/5] Replace data type declarations with variables of same types in several source files.
  2016-10-10 14:02 [PATCH 0/5] Replace data type declarations with variables of same types in several source files Sergio Paracuellos
                   ` (4 preceding siblings ...)
  2016-10-10 14:02 ` [PATCH 5/5] staging: wlan-ng: Replace data type declaration with variable of same type in prism2sta.c Sergio Paracuellos
@ 2016-10-16  8:24 ` Alexander Alemayhu
  2016-10-16 18:54   ` Sergio Paracuellos
  5 siblings, 1 reply; 8+ messages in thread
From: Alexander Alemayhu @ 2016-10-16  8:24 UTC (permalink / raw)
  To: Sergio Paracuellos; +Cc: gregkh, devel, linux-kernel

On Mon, Oct 10, 2016 at 04:02:17PM +0200, Sergio Paracuellos wrote:
> This patch series replaces several sizeof(struct XXX) stuff in favour 
> of sizeof(var) which is the preferred one.
>

Why not squash this series into one patch? The commit messages are fairly
similar and the changes are focused into one area. Would be better with one
commit, IMO.

-- 
Mit freundlichen Grüßen

Alexander Alemayhu

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

* Re: [PATCH 0/5] Replace data type declarations with variables of same types in several source files.
  2016-10-16  8:24 ` [PATCH 0/5] Replace data type declarations with variables of same types in several source files Alexander Alemayhu
@ 2016-10-16 18:54   ` Sergio Paracuellos
  0 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2016-10-16 18:54 UTC (permalink / raw)
  To: Alexander Alemayhu; +Cc: gregkh, devel, linux-kernel



El 2016年10月16日 a las 10:24, Alexander Alemayhu escribió:
> On Mon, Oct 10, 2016 at 04:02:17PM +0200, Sergio Paracuellos wrote:
>> This patch series replaces several sizeof(struct XXX) stuff in favour
>> of sizeof(var) which is the preferred one.
>>
>
> Why not squash this series into one patch? The commit messages are fairly
> similar and the changes are focused into one area. Would be better with one
> commit, IMO.
>

Commit messages are similar but applies to different files. That was the 
reason of sending the patchset and not only one patch. If it had been 
better to send only one patch please, let me know to be correct next 
time. The patchset seems that has been already added to the staging branch.

Thanks in advance.

Cheers,
	Sergio Paracuellos

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

end of thread, other threads:[~2016-10-16 18:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-10 14:02 [PATCH 0/5] Replace data type declarations with variables of same types in several source files Sergio Paracuellos
2016-10-10 14:02 ` [PATCH 1/5] staging: wlan-ng: Replace data type declaration with variable of same type in cfg80211.c Sergio Paracuellos
2016-10-10 14:02 ` [PATCH 2/5] staging: wlan-ng: Replace data type declaration with variable of same type in hfa384x_usb.c Sergio Paracuellos
2016-10-10 14:02 ` [PATCH 3/5] staging: wlan-ng: Replace data type declaration with variable of same type in p80211conv.c Sergio Paracuellos
2016-10-10 14:02 ` [PATCH 4/5] staging: wlan-ng: Replace data type declaration with variable of same type in p80211netdev.c Sergio Paracuellos
2016-10-10 14:02 ` [PATCH 5/5] staging: wlan-ng: Replace data type declaration with variable of same type in prism2sta.c Sergio Paracuellos
2016-10-16  8:24 ` [PATCH 0/5] Replace data type declarations with variables of same types in several source files Alexander Alemayhu
2016-10-16 18:54   ` Sergio Paracuellos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.