Jacob Keller
2013-09-04 00:19:35 UTC
This patch adds some checks on the prints in sk.c in order to only show what
the driver changed. This cleans up the output so that we don't see "Tx type 1
not 1" lines.
Signed-off-by: Jacob Keller <***@intel.com>
---
sk.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sk.c b/sk.c
index a13d14d..1cc5a6d 100644
--- a/sk.c
+++ b/sk.c
@@ -60,9 +60,15 @@ static int hwts_init(int fd, char *device, int rx_filter, int one_step)
if (memcmp(&cfg, &req, sizeof(cfg))) {
- pr_warning("driver changed our HWTSTAMP options");
- pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
- pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ if (cfg.tx_type != req.tx_type) {
+ pr_warning("driver changed our Tx HWTSTAMP options");
+ pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
+ }
+
+ if (cfg.rx_type != req.rx_type) {
+ pr_warning("driver changed our Rx HWTSTAMP options");
+ pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ }
if (cfg.tx_type != req.tx_type ||
(cfg.rx_filter != HWTSTAMP_FILTER_ALL &&
the driver changed. This cleans up the output so that we don't see "Tx type 1
not 1" lines.
Signed-off-by: Jacob Keller <***@intel.com>
---
sk.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sk.c b/sk.c
index a13d14d..1cc5a6d 100644
--- a/sk.c
+++ b/sk.c
@@ -60,9 +60,15 @@ static int hwts_init(int fd, char *device, int rx_filter, int one_step)
if (memcmp(&cfg, &req, sizeof(cfg))) {
- pr_warning("driver changed our HWTSTAMP options");
- pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
- pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ if (cfg.tx_type != req.tx_type) {
+ pr_warning("driver changed our Tx HWTSTAMP options");
+ pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
+ }
+
+ if (cfg.rx_type != req.rx_type) {
+ pr_warning("driver changed our Rx HWTSTAMP options");
+ pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ }
if (cfg.tx_type != req.tx_type ||
(cfg.rx_filter != HWTSTAMP_FILTER_ALL &&