From: Leo Kim <leo.kim@atmel.com>
To: <gregkh@linuxfoundation.org>
Cc: <devel@driverdev.osuosl.org>, <linux-wireless@vger.kernel.org>,
<tony.cho@atmel.com>, <glen.lee@atmel.com>, <leo.kim@atmel.com>,
<austin.shin@atmel.com>, <Chris.Park@atmel.com>,
<adham.abozaeid@atmel.com>, <Nicolas.FERRE@atmel.com>,
Chris Park <chris.park@atmel.com>
Subject: [PATCH V3 21/24] staging: wilc1000: removes unused region feature
Date: Mon, 22 Feb 2016 13:12:06 +0900 [thread overview]
Message-ID: <1456114329-7036-22-git-send-email-leo.kim@atmel.com> (raw)
In-Reply-To: <1456114329-7036-1-git-send-email-leo.kim@atmel.com>
From: Chris Park <chris.park@atmel.com>
This patch removes unused region feature on debug message.
Also, removes the functions of related in this feature.
Signed-off-by: Chris Park <chris.park@atmel.com>
Signed-off-by: Leo Kim <leo.kim@atmel.com>
---
drivers/staging/wilc1000/linux_wlan_common.h | 17 ++---------
drivers/staging/wilc1000/wilc_debugfs.c | 42 ----------------------------
2 files changed, 3 insertions(+), 56 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan_common.h b/drivers/staging/wilc1000/linux_wlan_common.h
index e408631..57d3901 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -1,15 +1,7 @@
#ifndef LINUX_WLAN_COMMON_H
#define LINUX_WLAN_COMMON_H
-enum debug_region {
- Init_debug = 0,
- COMP = 0xFFFFFFFF,
-};
-
-#define INIT_DBG (1 << Init_debug)
-
#if defined(WILC_DEBUGFS)
-extern atomic_t WILC_REGION;
extern atomic_t WILC_DEBUG_LEVEL;
#define DEBUG BIT(0)
@@ -19,8 +11,7 @@ extern atomic_t WILC_DEBUG_LEVEL;
#define PRINT_D(region, ...) \
do { \
- if ((atomic_read(&WILC_DEBUG_LEVEL) & DEBUG) && \
- ((atomic_read(&WILC_REGION)) & (region))) { \
+ if ((atomic_read(&WILC_DEBUG_LEVEL) & DEBUG)) { \
printk("DBG [%s: %d]", __func__, __LINE__); \
printk(__VA_ARGS__); \
} \
@@ -28,8 +19,7 @@ extern atomic_t WILC_DEBUG_LEVEL;
#define PRINT_INFO(region, ...) \
do { \
- if ((atomic_read(&WILC_DEBUG_LEVEL) & INFO) && \
- ((atomic_read(&WILC_REGION)) & (region))) { \
+ if ((atomic_read(&WILC_DEBUG_LEVEL) & INFO)) { \
printk("INFO [%s]", __func__); \
printk(__VA_ARGS__); \
} \
@@ -37,8 +27,7 @@ extern atomic_t WILC_DEBUG_LEVEL;
#define PRINT_WRN(region, ...) \
do { \
- if ((atomic_read(&WILC_DEBUG_LEVEL) & WRN) && \
- ((atomic_read(&WILC_REGION)) & (region))) { \
+ if ((atomic_read(&WILC_DEBUG_LEVEL) & WRN)) { \
printk("WRN [%s: %d]", __func__, __LINE__); \
printk(__VA_ARGS__); \
} \
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c
index 266d96b..215e2f0 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -24,10 +24,7 @@ static struct dentry *wilc_dir;
* --------------------------------------------------------------------------------
*/
-#define DBG_REGION_ALL (INIT_DBG)
#define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR)
-atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG);
-EXPORT_SYMBOL_GPL(WILC_REGION);
atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
EXPORT_SYMBOL_GPL(WILC_DEBUG_LEVEL);
@@ -75,44 +72,6 @@ static ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf,
return count;
}
-static ssize_t wilc_debug_region_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos)
-{
- char buf[128];
- int res = 0;
-
- /* only allow read from start */
- if (*ppos > 0)
- return 0;
-
- res = scnprintf(buf, sizeof(buf), "Debug region: %x\n", atomic_read(&WILC_REGION));
-
- return simple_read_from_buffer(userbuf, count, ppos, buf, res);
-}
-
-static ssize_t wilc_debug_region_write(struct file *filp, const char __user *buf, size_t count, loff_t *ppos)
-{
- char buffer[128] = {};
- int flag;
-
- if (count > sizeof(buffer))
- return -EINVAL;
-
- if (copy_from_user(buffer, buf, count))
- return -EFAULT;
-
- flag = buffer[0] - '0';
-
- if (flag > DBG_REGION_ALL) {
- printk("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&WILC_REGION));
- return -EFAULT;
- }
-
- atomic_set(&WILC_REGION, (int)flag);
- printk("new debug-region is %x\n", atomic_read(&WILC_REGION));
-
- return count;
-}
-
/*
* --------------------------------------------------------------------------------
*/
@@ -134,7 +93,6 @@ struct wilc_debugfs_info_t {
static struct wilc_debugfs_info_t debugfs_info[] = {
{ "wilc_debug_level", 0666, (DEBUG | ERR), FOPS(NULL, wilc_debug_level_read, wilc_debug_level_write, NULL), },
- { "wilc_debug_region", 0666, (INIT_DBG), FOPS(NULL, wilc_debug_region_read, wilc_debug_region_write, NULL), },
};
static int __init wilc_debugfs_init(void)
--
1.9.1
next prev parent reply other threads:[~2016-02-22 4:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 4:11 [PATCH V3 00/24] staging: wilc1000: Resend V3 Leo Kim
2016-02-22 4:11 ` [PATCH V3 01/24] staging: wilc1000: wilc_wlan.c: removes PRINT_ER Leo Kim
2016-02-22 4:11 ` [PATCH V3 02/24] staging: wilc1000: linux_mon.c: removes debug logs Leo Kim
2016-02-22 4:11 ` [PATCH V3 03/24] staging: wilc1000: linux_mon.c: replaces PRINT_ER with netdev_err Leo Kim
2016-02-22 4:11 ` [PATCH V3 04/24] staging: wilc1000: linux_mon.c: add to check routine Leo Kim
2016-02-22 4:11 ` [PATCH V3 05/24] staging: wilc1000: removes potential null dereference Leo Kim
2016-02-22 4:11 ` [PATCH V3 06/24] staging: wilc1000: host_interface.c: removes unnecessary log message Leo Kim
2016-02-22 4:11 ` [PATCH V3 07/24] staging: wilc1000: linux_mon.c: " Leo Kim
2016-02-22 4:11 ` [PATCH V3 08/24] staging: wilc1000: linux_mon.c: removes comments Leo Kim
2016-02-22 4:11 ` [PATCH V3 09/24] staging: wilc1000: wilc_wfi_cfgoperations.c: removes unnecessary log messages Leo Kim
2016-02-22 4:11 ` [PATCH V3 10/24] staging: wilc1000: removes unused HOSTAPD_DBG tag Leo Kim
2016-02-22 4:11 ` [PATCH V3 11/24] staging: wilc1000: host_interface.c: removes unnecessary log messages Leo Kim
2016-02-22 4:11 ` [PATCH V3 12/24] staging: wilc1000: wilc_wfi_cfgoperations.c: " Leo Kim
2016-02-22 4:11 ` [PATCH V3 13/24] " Leo Kim
2016-02-22 4:11 ` [PATCH V3 14/24] staging: wilc1000: removes unused CFG80211_DBG tag Leo Kim
2016-02-22 4:12 ` [PATCH V3 15/24] staging: wilc1000: coreconfigurator.c: removes unnecessary log messages Leo Kim
2016-02-22 4:12 ` [PATCH V3 16/24] staging: wilc1000: host_interface.c: " Leo Kim
2016-02-22 4:12 ` [PATCH V3 17/24] staging: wilc1000: host_interface.c: replace PRINT_ER with netdev_err Leo Kim
2016-02-22 4:12 ` [PATCH V3 18/24] staging: wilc1000: linux_wlan.c: removes unnecessary log messages Leo Kim
2016-02-22 4:12 ` [PATCH V3 19/24] staging: wilc1000: wilc_wfi_cfgoperations.c: " Leo Kim
2016-02-22 4:12 ` [PATCH V3 20/24] staging: wilc1000: wilc_wlan.c: " Leo Kim
2016-02-22 4:12 ` Leo Kim [this message]
2016-02-22 4:12 ` [PATCH V3 22/24] staging: wilc1000: removes usused PRINT_XX(region...) Leo Kim
2016-02-22 4:12 ` [PATCH V3 23/24] staging: wilc1000: moves to define values Leo Kim
2016-02-22 4:12 ` [PATCH V3 24/24] staging: wilc1000: moves LINUX_RX_SIZE, LINUX_TX_SIZE Leo Kim
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=1456114329-7036-22-git-send-email-leo.kim@atmel.com \
--to=leo.kim@atmel.com \
--cc=Chris.Park@atmel.com \
--cc=Nicolas.FERRE@atmel.com \
--cc=adham.abozaeid@atmel.com \
--cc=austin.shin@atmel.com \
--cc=devel@driverdev.osuosl.org \
--cc=glen.lee@atmel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-wireless@vger.kernel.org \
--cc=tony.cho@atmel.com \
/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 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).