Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] reglib: fix memset usage
@ 2013-11-11 19:39 Christian Lamparter
  2013-11-20 14:07 ` Luis R. Rodriguez
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Lamparter @ 2013-11-11 19:39 UTC (permalink / raw)
  To: linux-wireless; +Cc: wireless-regdb, mcgrof

gcc-4.8 fails to compile reglib due to:

reglib.c:1133:22: error: argument to ‘sizeof’ in ‘memset’ call is
			 the same expression as the destination; did you mean
			 to dereference it? [-Werror=sizeof-pointer-memaccess]
  memset(rd, 0, sizeof(rd));
                      ^
reglib.c:1155:22: error: argument to ‘sizeof’ in... (same as above)

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
---
 reglib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/reglib.c b/reglib.c
index 9577ada..1e57634 100644
--- a/reglib.c
+++ b/reglib.c
@@ -1127,7 +1127,7 @@ reglib_parse_country_simple(char *line, struct ieee80211_regdomain *rd)
 	char alpha2[2];
 	int hits;
 
-	memset(rd, 0, sizeof(rd));
+	memset(rd, 0, sizeof(*rd));
 	memset(alpha2, 0, sizeof(alpha2));
 	memset(dfs_region_alpha, 0, sizeof(dfs_region_alpha));
 
@@ -1149,7 +1149,7 @@ static int reglib_parse_country_dfs(char *line, struct ieee80211_regdomain *rd)
 	char alpha2[2];
 	int hits;
 
-	memset(rd, 0, sizeof(rd));
+	memset(rd, 0, sizeof(*rd));
 	memset(alpha2, 0, sizeof(alpha2));
 	memset(dfs_region_alpha, 0, sizeof(dfs_region_alpha));
 
-- 
1.8.4.2


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

* Re: [PATCH] reglib: fix memset usage
  2013-11-11 19:39 [PATCH] reglib: fix memset usage Christian Lamparter
@ 2013-11-20 14:07 ` Luis R. Rodriguez
  0 siblings, 0 replies; 2+ messages in thread
From: Luis R. Rodriguez @ 2013-11-20 14:07 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-wireless, wireless-regdb@lists.infradead.org

On Mon, Nov 11, 2013 at 8:39 PM, Christian Lamparter
<chunkeey@googlemail.com> wrote:
> gcc-4.8 fails to compile reglib due to:
>
> reglib.c:1133:22: error: argument to ‘sizeof’ in ‘memset’ call is
>                          the same expression as the destination; did you mean
>                          to dereference it? [-Werror=sizeof-pointer-memaccess]
>   memset(rd, 0, sizeof(rd));
>                       ^
> reglib.c:1155:22: error: argument to ‘sizeof’ in... (same as above)
>
> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>

Thanks, applied and pushed!

  Luis

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

end of thread, other threads:[~2013-11-20 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-11 19:39 [PATCH] reglib: fix memset usage Christian Lamparter
2013-11-20 14:07 ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox