From patchwork Mon Nov 11 19:39:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 3169421 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1CAD29F461 for ; Mon, 11 Nov 2013 19:40:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B839203F1 for ; Mon, 11 Nov 2013 19:40:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C08952023F for ; Mon, 11 Nov 2013 19:40:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754502Ab3KKTkB (ORCPT ); Mon, 11 Nov 2013 14:40:01 -0500 Received: from mail-bk0-f46.google.com ([209.85.214.46]:62770 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755038Ab3KKTj4 convert rfc822-to-8bit (ORCPT ); Mon, 11 Nov 2013 14:39:56 -0500 Received: by mail-bk0-f46.google.com with SMTP id e11so1834161bkh.5 for ; Mon, 11 Nov 2013 11:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=wiVOs3/kacxywAJJ2tde/4wFB8aXbc5wYAWpuMlwxJ8=; b=MDYNTE52jERh71Y6Obqi5Ebg3WvsprLIUhNYAbHlJP51f3DjiGW14tElOFXWjWn5dc 7GxJhpPuwz1MmqeBEJODpQbTwaV0wr2opE2MvXVd80GOzkNxIpBR06I4TRVNWrksrm2Q YNFBzjxlAN2nsGrEsPIK3SOIl6xUi0/D7pVk07M4yOI1Oc+WQ8mXu4UGfi616+JUFtrI zZ9oA7iVo9Lqx0YyxMTo3VwKsl7igmzgENz1ZjGl6TKfO8iNydnqt7wTwZFqblOrAeDB V2o075yaF/aSdPZBk+zM7/AcLKUwxV5FgQqmPys0PV8noxyM+pag2TLTzNOic/Nrjfhx 1Igw== X-Received: by 10.204.233.129 with SMTP id jy1mr13399886bkb.27.1384198793348; Mon, 11 Nov 2013 11:39:53 -0800 (PST) Received: from blech.mobile (f053217212.adsl.alicedsl.de. [78.53.217.212]) by mx.google.com with ESMTPSA id qg7sm15448274bkb.6.2013.11.11.11.39.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Nov 2013 11:39:52 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by blech.mobile (Postfix) with ESMTP id 0C2D710172E; Mon, 11 Nov 2013 20:39:51 +0100 (CET) Received: from blech.mobile ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3oIdHA1nlx9v; Mon, 11 Nov 2013 20:39:50 +0100 (CET) Received: from blech.localnet (localhost [127.0.0.1]) by blech.mobile (Postfix) with ESMTP id 9D041100366; Mon, 11 Nov 2013 20:39:50 +0100 (CET) From: Christian Lamparter To: linux-wireless@vger.kernel.org Cc: wireless-regdb@lists.infradead.org, mcgrof@do-not-panic.com Subject: [PATCH] reglib: fix memset usage Date: Mon, 11 Nov 2013 20:39:50 +0100 Message-ID: <2765421.8z1iAPSgk6@blech> User-Agent: KMail/4.11.3 (Linux/3.12.0-wl+; KDE/4.11.3; x86_64; ; ) MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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));