From: "Diego 'Flameeyes' Pettenò" <flameeyes@gmail.com>
To: linux-wireless@vger.kernel.org
Subject: [crda PATCH 1/3] Move is_valid_reg_rule() in intersect.c.
Date: Mon, 01 Dec 2008 13:26:57 +0100 [thread overview]
Message-ID: <20081201122657.20222.49058.stgit@localhost> (raw)
The function is only ever used in that translation unit so it makes no
sense to define it for all the binaries.
---
intersect.c | 20 ++++++++++++++++++++
reglib.c | 20 --------------------
reglib.h | 1 -
3 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/intersect.c b/intersect.c
index d6d857d..2f4d416 100644
--- a/intersect.c
+++ b/intersect.c
@@ -19,6 +19,26 @@
} \
} while (0)
+/* Sanity check on a regulatory rule */
+static int is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
+{
+ const struct ieee80211_freq_range *freq_range = &rule->freq_range;
+ __u32 freq_diff;
+
+ if (freq_range->start_freq_khz == 0 || freq_range->end_freq_khz == 0)
+ return 0;
+
+ if (freq_range->start_freq_khz > freq_range->end_freq_khz)
+ return 0;
+
+ freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
+
+ if (freq_diff == 0 || freq_range->max_bandwidth_khz > freq_diff)
+ return 0;
+
+ return 1;
+}
+
/* Helper for regdom_intersect(), this does the real
* mathematical intersection fun */
static int reg_rules_intersect(
diff --git a/reglib.c b/reglib.c
index 2f10d23..e02bd8f 100644
--- a/reglib.c
+++ b/reglib.c
@@ -195,26 +195,6 @@ struct ieee80211_regdomain *country2rd(__u8 *db, int dblen,
return rd;
}
-/* Sanity check on a regulatory rule */
-int is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
-{
- const struct ieee80211_freq_range *freq_range = &rule->freq_range;
- __u32 freq_diff;
-
- if (freq_range->start_freq_khz == 0 || freq_range->end_freq_khz == 0)
- return 0;
-
- if (freq_range->start_freq_khz > freq_range->end_freq_khz)
- return 0;
-
- freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
-
- if (freq_diff == 0 || freq_range->max_bandwidth_khz > freq_diff)
- return 0;
-
- return 1;
-}
-
static void print_reg_rule(struct ieee80211_reg_rule *rule)
{
struct ieee80211_freq_range *freq;
diff --git a/reglib.h b/reglib.h
index 095090b..f3a76ef 100644
--- a/reglib.h
+++ b/reglib.h
@@ -92,7 +92,6 @@ struct ieee80211_regdomain *country2rd(__u8 *db, int dblen,
struct regdb_file_reg_country *country);
/* reg helpers */
-int is_valid_reg_rule(const struct ieee80211_reg_rule *rule);
void print_regdom(struct ieee80211_regdomain *rd);
#endif
next reply other threads:[~2008-12-01 12:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-01 12:26 Diego 'Flameeyes' Pettenò [this message]
2008-12-01 12:27 ` [crda PATCH 2/3] Split printing functions to their own translation unit Diego 'Flameeyes' Pettenò
2008-12-01 12:27 ` [crda PATCH 3/3] Use Makefile dependency information for linking Diego 'Flameeyes' Pettenò
2008-12-01 22:39 ` [crda PATCH 1/3] Move is_valid_reg_rule() in intersect.c Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081201122657.20222.49058.stgit@localhost \
--to=flameeyes@gmail.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.