[PATCH] MAINTAINERS: add self as reviewer to INTEL STRATIX10 FIRMWARE DRIVERS

2021-03-27 Thread trix
From: Tom Rix 

The Intel stratix 10 is a fpga.  I review fpga's. So I want to help
in this related subsystem.

Signed-off-by: Tom Rix 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 67b104202602..00828de0a7bc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9266,6 +9266,7 @@ F:tools/power/x86/intel-speed-select/
 
 INTEL STRATIX10 FIRMWARE DRIVERS
 M: Richard Gong 
+R: Tom Rix 
 L: linux-kernel@vger.kernel.org
 S: Maintained
 F: Documentation/ABI/testing/sysfs-devices-platform-stratix10-rsu
-- 
2.27.0



[PATCH] sched/deadline: fix BUG_ON() ENQUEUE_REPLENISH check

2021-02-06 Thread trix
From: Tom Rix 

When the BUG_ON check for (flags != ENQUEUE_REPLENISH) was created, the
flag was set to ENQUEUE_REPLENISH in rt_mutex_setprio(), now it is or-ed
in.  So the checking logic needs to change.

Fixes: 1de64443d755 ("sched/core: Fix task and run queue sched_info::run_delay 
inconsistencies")
Signed-off-by: Tom Rix 
---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 1508d126e88b..f50d20b7fe7c 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1561,7 +1561,7 @@ static void enqueue_task_dl(struct rq *rq, struct 
task_struct *p, int flags)
 * the throttle.
 */
p->dl.dl_throttled = 0;
-   BUG_ON(!is_dl_boosted(>dl) || flags != ENQUEUE_REPLENISH);
+   BUG_ON(!is_dl_boosted(>dl) || !(flags & ENQUEUE_REPLENISH));
return;
}
 
-- 
2.27.0



[PATCH] iwlwifi: mvm: remove h from printk format specifier

2021-01-28 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
  unnecessary %h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c   | 6 +++---
 drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 8 
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 80f848a9ee13..8f61406ea69a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -326,10 +326,10 @@ static ssize_t iwl_dbgfs_sar_geo_profile_read(struct file 
*file,
pos += scnprintf(buf + pos, bufsz - pos,
 "Use geographic profile %d\n", tbl_idx);
pos += scnprintf(buf + pos, bufsz - pos,
-"2.4GHz:\n\tChain A offset: %hhu dBm\n\tChain 
B offset: %hhu dBm\n\tmax tx power: %hhu dBm\n",
+"2.4GHz:\n\tChain A offset: %u dBm\n\tChain B 
offset: %u dBm\n\tmax tx power: %u dBm\n",
 value[1], value[2], value[0]);
pos += scnprintf(buf + pos, bufsz - pos,
-"5.2GHz:\n\tChain A offset: %hhu dBm\n\tChain 
B offset: %hhu dBm\n\tmax tx power: %hhu dBm\n",
+"5.2GHz:\n\tChain A offset: %u dBm\n\tChain B 
offset: %u dBm\n\tmax tx power: %u dBm\n",
 value[4], value[5], value[3]);
}
mutex_unlock(>mutex);
@@ -1035,7 +1035,7 @@ iwl_dbgfs_scan_ant_rxchain_read(struct file *file,
pos += scnprintf(buf + pos, bufsz - pos, "B");
if (mvm->scan_rx_ant & ANT_C)
pos += scnprintf(buf + pos, bufsz - pos, "C");
-   pos += scnprintf(buf + pos, bufsz - pos, " (%hhx)\n", mvm->scan_rx_ant);
+   pos += scnprintf(buf + pos, bufsz - pos, " (%x)\n", mvm->scan_rx_ant);
 
return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
 }
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
index a4fd0bf9ba19..0d5e96fa6525 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
@@ -949,10 +949,10 @@ static void iwl_mvm_debug_range_resp(struct iwl_mvm *mvm, 
u8 index,
IWL_DEBUG_INFO(mvm, "\tstatus: %d\n", res->status);
IWL_DEBUG_INFO(mvm, "\tBSSID: %pM\n", res->addr);
IWL_DEBUG_INFO(mvm, "\thost time: %llu\n", res->host_time);
-   IWL_DEBUG_INFO(mvm, "\tburst index: %hhu\n", res->ftm.burst_index);
+   IWL_DEBUG_INFO(mvm, "\tburst index: %u\n", res->ftm.burst_index);
IWL_DEBUG_INFO(mvm, "\tsuccess num: %u\n", res->ftm.num_ftmr_successes);
IWL_DEBUG_INFO(mvm, "\trssi: %d\n", res->ftm.rssi_avg);
-   IWL_DEBUG_INFO(mvm, "\trssi spread: %hhu\n", res->ftm.rssi_spread);
+   IWL_DEBUG_INFO(mvm, "\trssi spread: %u\n", res->ftm.rssi_spread);
IWL_DEBUG_INFO(mvm, "\trtt: %lld\n", res->ftm.rtt_avg);
IWL_DEBUG_INFO(mvm, "\trtt var: %llu\n", res->ftm.rtt_variance);
IWL_DEBUG_INFO(mvm, "\trtt spread: %llu\n", res->ftm.rtt_spread);
@@ -1051,7 +1051,7 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct 
iwl_rx_cmd_buffer *rxb)
}
 
IWL_DEBUG_INFO(mvm, "Range response received\n");
-   IWL_DEBUG_INFO(mvm, "request id: %lld, num of entries: %hhu\n",
+   IWL_DEBUG_INFO(mvm, "request id: %lld, num of entries: %u\n",
   mvm->ftm_initiator.req->cookie, num_of_aps);
 
for (i = 0; i < num_of_aps && i < IWL_MVM_TOF_MAX_APS; i++) {
@@ -1143,7 +1143,7 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct 
iwl_rx_cmd_buffer *rxb)
 
if (fw_has_api(>fw->ucode_capa,
   IWL_UCODE_TLV_API_FTM_RTT_ACCURACY))
-   IWL_DEBUG_INFO(mvm, "RTT confidence: %hhu\n",
+   IWL_DEBUG_INFO(mvm, "RTT confidence: %u\n",
   fw_ap->rttConfidence);
 
iwl_mvm_debug_range_resp(mvm, i, );
-- 
2.27.0



[PATCH] ath11k: remove h from printk format specifier

2021-01-28 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
  unnecessary %h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/wireless/ath/ath11k/dp_rx.c | 10 +-
 drivers/net/wireless/ath/ath11k/mac.c   | 10 +-
 drivers/net/wireless/ath/ath11k/trace.h |  2 +-
 drivers/net/wireless/ath/ath11k/wmi.c   |  4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c 
b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 42328a06107b..859cfcabceb5 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -1292,7 +1292,7 @@ int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const 
void *ptr, size_t len,
len -= sizeof(*tlv);
 
if (tlv_len > len) {
-   ath11k_err(ab, "htt tlv parse failure of tag %hhu at 
byte %zd (%zu bytes left, %hhu expected)\n",
+   ath11k_err(ab, "htt tlv parse failure of tag %u at byte 
%zd (%zu bytes left, %u expected)\n",
   tlv_tag, ptr - begin, len, tlv_len);
return -EINVAL;
}
@@ -1381,22 +1381,22 @@ ath11k_update_per_peer_tx_stats(struct ath11k *ar,
 */
 
if (flags == WMI_RATE_PREAMBLE_HE && mcs > 11) {
-   ath11k_warn(ab, "Invalid HE mcs %hhd peer stats",  mcs);
+   ath11k_warn(ab, "Invalid HE mcs %d peer stats",  mcs);
return;
}
 
if (flags == WMI_RATE_PREAMBLE_HE && mcs > ATH11K_HE_MCS_MAX) {
-   ath11k_warn(ab, "Invalid HE mcs %hhd peer stats",  mcs);
+   ath11k_warn(ab, "Invalid HE mcs %d peer stats",  mcs);
return;
}
 
if (flags == WMI_RATE_PREAMBLE_VHT && mcs > ATH11K_VHT_MCS_MAX) {
-   ath11k_warn(ab, "Invalid VHT mcs %hhd peer stats",  mcs);
+   ath11k_warn(ab, "Invalid VHT mcs %d peer stats",  mcs);
return;
}
 
if (flags == WMI_RATE_PREAMBLE_HT && (mcs > ATH11K_HT_MCS_MAX || nss < 
1)) {
-   ath11k_warn(ab, "Invalid HT mcs %hhd nss %hhd peer stats",
+   ath11k_warn(ab, "Invalid HT mcs %d nss %d peer stats",
mcs, nss);
return;
}
diff --git a/drivers/net/wireless/ath/ath11k/mac.c 
b/drivers/net/wireless/ath/ath11k/mac.c
index c1608f64ea95..9f56e0ad1fee 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -4849,7 +4849,7 @@ static int ath11k_mac_op_add_chanctx(struct ieee80211_hw 
*hw,
struct ath11k_base *ab = ar->ab;
 
ath11k_dbg(ab, ATH11K_DBG_MAC,
-  "mac chanctx add freq %hu width %d ptr %pK\n",
+  "mac chanctx add freq %u width %d ptr %pK\n",
   ctx->def.chan->center_freq, ctx->def.width, ctx);
 
mutex_lock(>conf_mutex);
@@ -4873,7 +4873,7 @@ static void ath11k_mac_op_remove_chanctx(struct 
ieee80211_hw *hw,
struct ath11k_base *ab = ar->ab;
 
ath11k_dbg(ab, ATH11K_DBG_MAC,
-  "mac chanctx remove freq %hu width %d ptr %pK\n",
+  "mac chanctx remove freq %u width %d ptr %pK\n",
   ctx->def.chan->center_freq, ctx->def.width, ctx);
 
mutex_lock(>conf_mutex);
@@ -5117,7 +5117,7 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
arvif = (void *)vifs[i].vif->drv_priv;
 
ath11k_dbg(ab, ATH11K_DBG_MAC,
-  "mac chanctx switch vdev_id %i freq %hu->%hu width 
%d->%d\n",
+  "mac chanctx switch vdev_id %i freq %u->%u width 
%d->%d\n",
   arvif->vdev_id,
   vifs[i].old_ctx->def.chan->center_freq,
   vifs[i].new_ctx->def.chan->center_freq,
@@ -5214,7 +5214,7 @@ static void ath11k_mac_op_change_chanctx(struct 
ieee80211_hw *hw,
mutex_lock(>conf_mutex);
 
ath11k_dbg(ab, ATH11K_DBG_MAC,
-  "mac chanctx change freq %hu width %d ptr %pK changed %x\n",
+  "mac chanctx change freq %u width %d ptr %pK changed %x\n",
   ctx->def.chan->center_freq, ctx->def.width, ctx, changed);
 
/* This shouldn't really happen because channel switching should use
@@ -5583,7 +5583,7 @@ static int ath11k_mac_set_fixed_rate_params(struct 
ath11k_vif *arvif,
 
lockdep_assert_held(>conf_mutex);
 
-   ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac set fixed rate params vdev %i 
rate 0x%02hhx nss %hhu sgi %hhu\n",
+   ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac set fixed rate params vdev %i 
rate 0x%02x nss %u sgi %u\n",
   arvif->vdev_id, rate, nss, sgi);
 

[PATCH] ath10k: remove h from printk format specifier

2021-01-27 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
  unnecessary %h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/wireless/ath/ath10k/htt_rx.c  | 32 +++
 drivers/net/wireless/ath/ath10k/htt_tx.c  | 12 -
 drivers/net/wireless/ath/ath10k/mac.c | 12 -
 drivers/net/wireless/ath/ath10k/trace.h   |  4 +--
 drivers/net/wireless/ath/ath10k/txrx.c|  4 +--
 drivers/net/wireless/ath/ath10k/wmi-tlv.c |  6 ++---
 drivers/net/wireless/ath/ath10k/wmi.c |  2 +-
 7 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c 
b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 9c4e6cf2137a..1a08156d5011 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2781,13 +2781,13 @@ static void ath10k_htt_rx_addba(struct ath10k *ar, 
struct htt_resp *resp)
peer_id = MS(info0, HTT_RX_BA_INFO0_PEER_ID);
 
ath10k_dbg(ar, ATH10K_DBG_HTT,
-  "htt rx addba tid %hu peer_id %hu size %hhu\n",
+  "htt rx addba tid %u peer_id %u size %u\n",
   tid, peer_id, ev->window_size);
 
spin_lock_bh(>data_lock);
peer = ath10k_peer_find_by_id(ar, peer_id);
if (!peer) {
-   ath10k_warn(ar, "received addba event for invalid peer_id: 
%hu\n",
+   ath10k_warn(ar, "received addba event for invalid peer_id: 
%u\n",
peer_id);
spin_unlock_bh(>data_lock);
return;
@@ -2802,7 +2802,7 @@ static void ath10k_htt_rx_addba(struct ath10k *ar, struct 
htt_resp *resp)
}
 
ath10k_dbg(ar, ATH10K_DBG_HTT,
-  "htt rx start rx ba session sta %pM tid %hu size %hhu\n",
+  "htt rx start rx ba session sta %pM tid %u size %u\n",
   peer->addr, tid, ev->window_size);
 
ieee80211_start_rx_ba_session_offl(arvif->vif, peer->addr, tid);
@@ -2821,13 +2821,13 @@ static void ath10k_htt_rx_delba(struct ath10k *ar, 
struct htt_resp *resp)
peer_id = MS(info0, HTT_RX_BA_INFO0_PEER_ID);
 
ath10k_dbg(ar, ATH10K_DBG_HTT,
-  "htt rx delba tid %hu peer_id %hu\n",
+  "htt rx delba tid %u peer_id %u\n",
   tid, peer_id);
 
spin_lock_bh(>data_lock);
peer = ath10k_peer_find_by_id(ar, peer_id);
if (!peer) {
-   ath10k_warn(ar, "received addba event for invalid peer_id: 
%hu\n",
+   ath10k_warn(ar, "received addba event for invalid peer_id: 
%u\n",
peer_id);
spin_unlock_bh(>data_lock);
return;
@@ -2842,7 +2842,7 @@ static void ath10k_htt_rx_delba(struct ath10k *ar, struct 
htt_resp *resp)
}
 
ath10k_dbg(ar, ATH10K_DBG_HTT,
-  "htt rx stop rx ba session sta %pM tid %hu\n",
+  "htt rx stop rx ba session sta %pM tid %u\n",
   peer->addr, tid);
 
ieee80211_stop_rx_ba_session_offl(arvif->vif, peer->addr, tid);
@@ -3102,7 +3102,7 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k *ar, 
struct sk_buff *skb)
return;
}
 
-   ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx tx fetch ind num records %hu num 
resps %hu seq %hu\n",
+   ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx tx fetch ind num records %u num 
resps %u seq %u\n",
   num_records, num_resp_ids,
   le16_to_cpu(resp->tx_fetch_ind.fetch_seq_num));
 
@@ -3127,12 +3127,12 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k 
*ar, struct sk_buff *skb)
max_num_msdus = le16_to_cpu(record->num_msdus);
max_num_bytes = le32_to_cpu(record->num_bytes);
 
-   ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx tx fetch record %i 
peer_id %hu tid %hhu msdus %zu bytes %zu\n",
+   ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx tx fetch record %i 
peer_id %u tid %u msdus %zu bytes %zu\n",
   i, peer_id, tid, max_num_msdus, max_num_bytes);
 
if (unlikely(peer_id >= ar->htt.tx_q_state.num_peers) ||
unlikely(tid >= ar->htt.tx_q_state.num_tids)) {
-   ath10k_warn(ar, "received out of range peer_id %hu tid 
%hhu\n",
+   ath10k_warn(ar, "received out of range peer_id %u tid 
%u\n",
peer_id, tid);
continue;
}
@@ -3146,7 +3146,7 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k *ar, 
struct sk_buff *skb)
 */
 
if (unlikely(!txq)) {
-   ath10k_warn(ar, "failed to lookup txq for peer_id %hu 
tid 

[PATCH] net: phy: remove h from printk format specifier

2021-01-25 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
  unnecessary %h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/phy/dp83640.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 0d79f68f301c..1bc68a3bffa2 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -186,7 +186,7 @@ static void dp83640_gpio_defaults(struct ptp_pin_desc *pd)
 
for (i = 0; i < GPIO_TABLE_SIZE; i++) {
if (gpio_tab[i] < 1 || gpio_tab[i] > DP83640_N_PINS) {
-   pr_err("gpio_tab[%d]=%hu out of range", i, gpio_tab[i]);
+   pr_err("gpio_tab[%d]=%u out of range", i, gpio_tab[i]);
return;
}
}
-- 
2.27.0



[PATCH v4] selftests: drivers: fpga: A test for interrupt support

2021-01-25 Thread trix
From: Tom Rix 

Check that the ioctl DFL_FPGA_PORT_ERR_GET_IRQ_NUM returns
an expected result.

Tested on vf device 0xbcc1

Sample run with
 # make -C tools/testing/selftests TARGETS=drivers/fpga run_tests
 ...
 TAP version 13
 1..1
 # selftests: drivers/fpga: intr
 # TAP version 13
 # 1..1
 # # Starting 1 tests from 1 test cases.
 # #  RUN   global.afu_intr ...
 # #OK  global.afu_intr
 # ok 1 global.afu_intr
 # # PASSED: 1 / 1 tests passed.
 # # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0
 ok 1 selftests: drivers/fpga: intr

Signed-off-by: Tom Rix 
Acked-by: Moritz Fischer 
---
v1: Convert to kselftest_harness.h framework
v2: reverse xmas tree variables
v3: rebase to linux-kselftest, tag linux-kselftest-next-5.11-rc3
---
 MAINTAINERS   |  1 +
 tools/testing/selftests/Makefile  |  1 +
 tools/testing/selftests/drivers/fpga/Makefile |  7 
 tools/testing/selftests/drivers/fpga/config   |  1 +
 tools/testing/selftests/drivers/fpga/intr.c   | 36 +++
 5 files changed, 46 insertions(+)
 create mode 100644 tools/testing/selftests/drivers/fpga/Makefile
 create mode 100644 tools/testing/selftests/drivers/fpga/config
 create mode 100644 tools/testing/selftests/drivers/fpga/intr.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 6eff4f720c72..10bea5417c82 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6972,6 +6972,7 @@ F:Documentation/driver-api/fpga/
 F: Documentation/fpga/
 F: drivers/fpga/
 F: include/linux/fpga/
+F: tools/testing/selftests/drivers/fpga/
 
 FPU EMULATOR
 M: Bill Metzenthen 
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index afbab4aeef3c..aad4763ec348 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -9,6 +9,7 @@ TARGETS += core
 TARGETS += cpufreq
 TARGETS += cpu-hotplug
 TARGETS += drivers/dma-buf
+TARGETS += drivers/fpga
 TARGETS += efivarfs
 TARGETS += exec
 TARGETS += filesystems
diff --git a/tools/testing/selftests/drivers/fpga/Makefile 
b/tools/testing/selftests/drivers/fpga/Makefile
new file mode 100644
index ..eba35c405d5b
--- /dev/null
+++ b/tools/testing/selftests/drivers/fpga/Makefile
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-only
+CFLAGS += -I../../../../../usr/include/
+CFLAGS += -I../../../../../include/uapi/
+
+TEST_GEN_PROGS := intr
+
+include ../../lib.mk
diff --git a/tools/testing/selftests/drivers/fpga/config 
b/tools/testing/selftests/drivers/fpga/config
new file mode 100644
index ..e2111b81d8d7
--- /dev/null
+++ b/tools/testing/selftests/drivers/fpga/config
@@ -0,0 +1 @@
+CONFIG_FPGA_DFL_AFU=m
diff --git a/tools/testing/selftests/drivers/fpga/intr.c 
b/tools/testing/selftests/drivers/fpga/intr.c
new file mode 100644
index ..927dcc757f0b
--- /dev/null
+++ b/tools/testing/selftests/drivers/fpga/intr.c
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "../../kselftest_harness.h"
+
+TEST(afu_intr)
+{
+   struct dfl_fpga_port_info port_info;
+   uint32_t irq_num = UINT32_MAX;
+   int devfd, status;
+
+   devfd = open("/dev/dfl-port.0", O_RDONLY);
+   if (devfd < 0)
+   SKIP(0, "no fpga afu device 0");
+   /*
+* From fpga-dl.h :
+* Currently hardware supports up to 1 irq.
+* Return: 0 on success, -errno on failure.
+*/
+   status = ioctl(devfd, DFL_FPGA_PORT_ERR_GET_IRQ_NUM, _num);
+   ASSERT_EQ(0, status) {
+   TH_LOG("ioctl() failed to get the number irqs");
+   }
+   ASSERT_LT(irq_num, 256) {
+   TH_LOG("unexpeced number of irqs");
+   }
+   close(devfd);
+}
+
+TEST_HARNESS_MAIN
-- 
2.27.0



[PATCH] ipvlan: remove h from printk format specifier

2021-01-24 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
  unnecessary %h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Cleanup output to use __func__ over explicit function strings.

Signed-off-by: Tom Rix 
---
 drivers/net/ipvlan/ipvlan_core.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 8801d093135c..6cd50106e611 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -651,8 +651,7 @@ int ipvlan_queue_xmit(struct sk_buff *skb, struct 
net_device *dev)
}
 
/* Should not reach here */
-   WARN_ONCE(true, "ipvlan_queue_xmit() called for mode = [%hx]\n",
- port->mode);
+   WARN_ONCE(true, "%s called for mode = [%x]\n", __func__, port->mode);
 out:
kfree_skb(skb);
return NET_XMIT_DROP;
@@ -749,8 +748,7 @@ rx_handler_result_t ipvlan_handle_frame(struct sk_buff 
**pskb)
}
 
/* Should not reach here */
-   WARN_ONCE(true, "ipvlan_handle_frame() called for mode = [%hx]\n",
- port->mode);
+   WARN_ONCE(true, "%s called for mode = [%x]\n", __func__, port->mode);
kfree_skb(skb);
return RX_HANDLER_CONSUMED;
 }
-- 
2.27.0



[PATCH] can: mcba_usb: remove h from printk format specifier

2021-01-24 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
  unnecessary %h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/can/usb/mcba_usb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/usb/mcba_usb.c b/drivers/net/can/usb/mcba_usb.c
index df54eb7d4b36..dc79c050f5f7 100644
--- a/drivers/net/can/usb/mcba_usb.c
+++ b/drivers/net/can/usb/mcba_usb.c
@@ -466,7 +466,7 @@ static void mcba_usb_process_ka_usb(struct mcba_priv *priv,
struct mcba_usb_msg_ka_usb *msg)
 {
if (unlikely(priv->usb_ka_first_pass)) {
-   netdev_info(priv->netdev, "PIC USB version %hhu.%hhu\n",
+   netdev_info(priv->netdev, "PIC USB version %u.%u\n",
msg->soft_ver_major, msg->soft_ver_minor);
 
priv->usb_ka_first_pass = false;
@@ -492,7 +492,7 @@ static void mcba_usb_process_ka_can(struct mcba_priv *priv,
struct mcba_usb_msg_ka_can *msg)
 {
if (unlikely(priv->can_ka_first_pass)) {
-   netdev_info(priv->netdev, "PIC CAN version %hhu.%hhu\n",
+   netdev_info(priv->netdev, "PIC CAN version %u.%u\n",
msg->soft_ver_major, msg->soft_ver_minor);
 
priv->can_ka_first_pass = false;
@@ -554,7 +554,7 @@ static void mcba_usb_process_rx(struct mcba_priv *priv,
break;
 
default:
-   netdev_warn(priv->netdev, "Unsupported msg (0x%hhX)",
+   netdev_warn(priv->netdev, "Unsupported msg (0x%X)",
msg->cmd_id);
break;
}
-- 
2.27.0



[PATCH] sgi-xp: remove h from printk format specifier

2021-01-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
  unnecessary %h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/misc/sgi-xp/xpnet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c
index 23837d0d6f4a..2508f83bdc3f 100644
--- a/drivers/misc/sgi-xp/xpnet.c
+++ b/drivers/misc/sgi-xp/xpnet.c
@@ -208,7 +208,7 @@ xpnet_receive(short partid, int channel, struct 
xpnet_message *msg)
} else {
dst = (void *)((u64)skb->data & ~(L1_CACHE_BYTES - 1));
dev_dbg(xpnet, "transferring buffer to the skb->data area;\n\t"
-   "xp_remote_memcpy(0x%p, 0x%p, %hu)\n", dst,
+   "xp_remote_memcpy(0x%p, 0x%p, %u)\n", dst,
  (void *)msg->buf_pa, msg->size);
 
ret = xp_remote_memcpy(xp_pa(dst), msg->buf_pa, msg->size);
@@ -218,7 +218,7 @@ xpnet_receive(short partid, int channel, struct 
xpnet_message *msg)
 * !!! appears in_use and we can't just call
 * !!! dev_kfree_skb.
 */
-   dev_err(xpnet, "xp_remote_memcpy(0x%p, 0x%p, 0x%hx) "
+   dev_err(xpnet, "xp_remote_memcpy(0x%p, 0x%p, 0x%x) "
"returned error=0x%x\n", dst,
(void *)msg->buf_pa, msg->size, ret);
 
-- 
2.27.0



[PATCH v2] MAINTAINERS: Add FPGA SUBDEVICES

2021-01-22 Thread trix
From: Tom Rix 

Every FPGA has several subdevices in other subsystems.
The new FPGA subdevices section is necessary to ensure changes to
the subdevices files get reviewed within the context of the FPGA
subsystem.

Signed-off-by: Tom Rix 
---
v1: Add several more subdevices
---
 MAINTAINERS | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 17ac5bdce521..96d6f00b0584 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6975,6 +6975,17 @@ F:   drivers/fpga/
 F: include/linux/fpga/
 F: tools/testing/selftests/drivers/fpga/
 
+FPGA SUBDEVICES
+R: Tom Rix 
+L: linux-f...@vger.kernel.org
+S: Maintained
+F: Documentation/ABI/testing/sysfs-driver-intel-m10-bmc
+F: Documentation/hwmon/intel-m10-bmc-hwmon.rst
+F: drivers/hwmon/intel-m10-bmc-hwmon.c
+F: drivers/memory/dfl-emif.c
+F: drivers/mfd/intel-m10-bmc.c
+F: include/linux/mfd/intel-m10-bmc.h
+
 FPU EMULATOR
 M: Bill Metzenthen 
 S: Maintained
-- 
2.27.0



[PATCH] MAINTAINERS: Add FPGA SUBDEVICES

2021-01-22 Thread trix
From: Tom Rix 

Every FPGA has several subdevices in other subsystems.
The new FPGA subdevices section is necessary to ensure changes to
the subdevices files get reviewed within the context of the FPGA
subsystem.

Signed-off-by: Tom Rix 
---
 MAINTAINERS | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 17ac5bdce521..cdda41f182b9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6975,6 +6975,12 @@ F:   drivers/fpga/
 F: include/linux/fpga/
 F: tools/testing/selftests/drivers/fpga/
 
+FPGA SUBDEVICES
+R: Tom Rix 
+L: linux-f...@vger.kernel.org
+S: Maintained
+F: include/linux/mfd/intel-m10-bmc.*
+
 FPU EMULATOR
 M: Bill Metzenthen 
 S: Maintained
-- 
2.27.0



[PATCH] ata: sata_nv: remove h from printk format specifier

2021-01-22 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
  unnecessary %h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/ata/sata_nv.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 20190f66ced9..81b75e513266 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -603,7 +603,7 @@ static void nv_adma_register_mode(struct ata_port *ap)
count++;
}
if (count == 20)
-   ata_port_warn(ap, "timeout waiting for ADMA IDLE, stat=0x%hx\n",
+   ata_port_warn(ap, "timeout waiting for ADMA IDLE, stat=0x%x\n",
  status);
 
tmp = readw(mmio + NV_ADMA_CTL);
@@ -618,7 +618,7 @@ static void nv_adma_register_mode(struct ata_port *ap)
}
if (count == 20)
ata_port_warn(ap,
- "timeout waiting for ADMA LEGACY, stat=0x%hx\n",
+ "timeout waiting for ADMA LEGACY, stat=0x%x\n",
  status);
 
pp->flags |= NV_ADMA_PORT_REGISTER_MODE;
@@ -648,7 +648,7 @@ static void nv_adma_mode(struct ata_port *ap)
}
if (count == 20)
ata_port_warn(ap,
-   "timeout waiting for ADMA LEGACY clear and IDLE, 
stat=0x%hx\n",
+   "timeout waiting for ADMA LEGACY clear and IDLE, 
stat=0x%x\n",
status);
 
pp->flags &= ~NV_ADMA_PORT_REGISTER_MODE;
@@ -736,7 +736,7 @@ static int nv_adma_slave_config(struct scsi_device *sdev)
blk_queue_segment_boundary(sdev->request_queue, segment_boundary);
blk_queue_max_segments(sdev->request_queue, sg_tablesize);
ata_port_info(ap,
- "DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n",
+ "DMA mask 0x%llX, segment boundary 0x%lX, hw segs %u\n",
  (unsigned long long)*ap->host->dev->dma_mask,
  segment_boundary, sg_tablesize);
 
-- 
2.27.0



[PATCH v2] clocksource: mxs_timer: add missing semicolon when DEBUG is defined

2021-01-18 Thread trix
From: Tom Rix 

When DEBUG is defined this error occurs

drivers/clocksource/mxs_timer.c:138:1: error:
  expected ‘;’ before ‘}’ token

The preceding statement needs a semicolon.
Replace pr_info() with pr_debug() and remove the unneeded ifdef.

Fixes: eb8703e2ef7c ("clockevents/drivers/mxs: Migrate to new 'set-state' 
interface")
Signed-off-by: Tom Rix 
---
v1: replace pr_info() with pr_debug()
---
 drivers/clocksource/mxs_timer.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/clocksource/mxs_timer.c b/drivers/clocksource/mxs_timer.c
index bc96a4cbf26c..e52e12d27d2a 100644
--- a/drivers/clocksource/mxs_timer.c
+++ b/drivers/clocksource/mxs_timer.c
@@ -131,10 +131,7 @@ static void mxs_irq_clear(char *state)
 
/* Clear pending interrupt */
timrot_irq_acknowledge();
-
-#ifdef DEBUG
-   pr_info("%s: changing mode to %s\n", __func__, state)
-#endif /* DEBUG */
+   pr_debug("%s: changing mode to %s\n", __func__, state);
 }
 
 static int mxs_shutdown(struct clock_event_device *evt)
-- 
2.27.0



[PATCH] clocksource: mxs_timer: add missing semicolon when DEBUG is defined

2021-01-18 Thread trix
From: Tom Rix 

When DEBUG is defined this error occurs

drivers/clocksource/mxs_timer.c:138:1: error:
  expected ‘;’ before ‘}’ token

The preceding statement needs a semicolon.

Fixes: eb8703e2ef7c ("clockevents/drivers/mxs: Migrate to new 'set-state' 
interface")
Signed-off-by: Tom Rix 
---
 drivers/clocksource/mxs_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/mxs_timer.c b/drivers/clocksource/mxs_timer.c
index bc96a4cbf26c..55aa6b72d075 100644
--- a/drivers/clocksource/mxs_timer.c
+++ b/drivers/clocksource/mxs_timer.c
@@ -133,7 +133,7 @@ static void mxs_irq_clear(char *state)
timrot_irq_acknowledge();
 
 #ifdef DEBUG
-   pr_info("%s: changing mode to %s\n", __func__, state)
+   pr_info("%s: changing mode to %s\n", __func__, state);
 #endif /* DEBUG */
 }
 
-- 
2.27.0



[PATCH] media: pxa_camera: declare variable when DEBUG is defined

2021-01-18 Thread trix
From: Tom Rix 

When DEBUG is defined this error occurs

drivers/media/platform/pxa_camera.c:1410:7: error:
  ‘i’ undeclared (first use in this function)
  for (i = 0; i < vb->num_planes; i++)
   ^
The variable 'i' is missing, so declare it.

Fixes: 6f28435d1c15 ("[media] media: platform: pxa_camera: trivial move of 
functions")
Signed-off-by: Tom Rix 
---
 drivers/media/platform/pxa_camera.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/pxa_camera.c 
b/drivers/media/platform/pxa_camera.c
index b664ce7558a1..75fad9689c90 100644
--- a/drivers/media/platform/pxa_camera.c
+++ b/drivers/media/platform/pxa_camera.c
@@ -1386,6 +1386,9 @@ static int pxac_vb2_prepare(struct vb2_buffer *vb)
struct pxa_camera_dev *pcdev = vb2_get_drv_priv(vb->vb2_queue);
struct pxa_buffer *buf = vb2_to_pxa_buffer(vb);
int ret = 0;
+#ifdef DEBUG
+   int i;
+#endif
 
switch (pcdev->channels) {
case 1:
-- 
2.27.0



[PATCH] media: mtk-vcodec: fix argument used when DEBUG is defined

2021-01-17 Thread trix
From: Tom Rix 

When DEBUG is defined this error occurs

drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c:306:41:
  error: ‘i’ undeclared (first use in this function)
  mtk_v4l2_debug(2, "reg[%d] base=0x%p", i, dev->reg_base[VENC_SYS]);

Reviewing the old line

mtk_v4l2_debug(2, "reg[%d] base=0x%p", i, dev->reg_base[i]);

All the i's need to be changed to VENC_SYS.
Fix a similar error for VENC_LT_SYS.

Fixes: 0dc4b3286125 ("media: mtk-vcodec: venc: support SCP firmware")
Signed-off-by: Tom Rix 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
index dfb42e19bf81..be3842e6ca47 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -303,7 +303,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
ret = PTR_ERR((__force void *)dev->reg_base[VENC_SYS]);
goto err_res;
}
-   mtk_v4l2_debug(2, "reg[%d] base=0x%p", i, dev->reg_base[VENC_SYS]);
+   mtk_v4l2_debug(2, "reg[%d] base=0x%p", VENC_SYS, 
dev->reg_base[VENC_SYS]);
 
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) {
@@ -332,7 +332,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
ret = PTR_ERR((__force void 
*)dev->reg_base[VENC_LT_SYS]);
goto err_res;
}
-   mtk_v4l2_debug(2, "reg[%d] base=0x%p", i, 
dev->reg_base[VENC_LT_SYS]);
+   mtk_v4l2_debug(2, "reg[%d] base=0x%p", VENC_LT_SYS, 
dev->reg_base[VENC_LT_SYS]);
 
dev->enc_lt_irq = platform_get_irq(pdev, 1);
irq_set_status_flags(dev->enc_lt_irq, IRQ_NOAUTOEN);
-- 
2.27.0



[PATCH] net: hns: fix variable used when DEBUG is defined

2021-01-17 Thread trix
From: Tom Rix 

When DEBUG is defined this error occurs

drivers/net/ethernet/hisilicon/hns/hns_enet.c:1505:36: error:
  ‘struct net_device’ has no member named ‘ae_handle’;
  did you mean ‘rx_handler’?
  assert(skb->queue_mapping < ndev->ae_handle->q_num);
^

ae_handle is an element of struct hns_nic_priv, so change
ndev to priv.

Fixes: b5996f11ea54 ("net: add Hisilicon Network Subsystem basic ethernet 
support")
Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c 
b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 858cb293152a..5d7824d2b4d4 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -1502,7 +1502,7 @@ static netdev_tx_t hns_nic_net_xmit(struct sk_buff *skb,
 {
struct hns_nic_priv *priv = netdev_priv(ndev);
 
-   assert(skb->queue_mapping < ndev->ae_handle->q_num);
+   assert(skb->queue_mapping < priv->ae_handle->q_num);
 
return hns_nic_net_xmit_hw(ndev, skb,
   _ring_data(priv, skb->queue_mapping));
-- 
2.27.0



[PATCH] arcnet: fix macro name when DEBUG is defined

2021-01-17 Thread trix
From: Tom Rix 

When DEBUG is defined this error occurs

drivers/net/arcnet/com20020_cs.c:70:15: error: ‘com20020_REG_W_ADDR_HI’
  undeclared (first use in this function);
  did you mean ‘COM20020_REG_W_ADDR_HI’?
   ioaddr, com20020_REG_W_ADDR_HI);
   ^~

>From reviewing the context, the suggestion is what is meant.

Fixes: 0fec65130b9f ("arcnet: com20020: Use arcnet_ routines")
Signed-off-by: Tom Rix 
---
 drivers/net/arcnet/com20020_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/arcnet/com20020_cs.c b/drivers/net/arcnet/com20020_cs.c
index cf607ffcf358..81223f6bebcc 100644
--- a/drivers/net/arcnet/com20020_cs.c
+++ b/drivers/net/arcnet/com20020_cs.c
@@ -67,7 +67,7 @@ static void regdump(struct net_device *dev)
/* set up the address register */
count = 0;
arcnet_outb((count >> 8) | RDDATAflag | AUTOINCflag,
-   ioaddr, com20020_REG_W_ADDR_HI);
+   ioaddr, COM20020_REG_W_ADDR_HI);
arcnet_outb(count & 0xff, ioaddr, COM20020_REG_W_ADDR_LO);
 
for (count = 0; count < 256 + 32; count++) {
-- 
2.27.0



[PATCH v3] selftests: drivers: fpga: A test for interrupt support

2021-01-17 Thread trix
From: Tom Rix 

Check that the ioctl DFL_FPGA_PORT_ERR_GET_IRQ_NUM returns
an expected result.

Tested on vf device 0xbcc1

Sample run with
 # make -C tools/testing/selftests TARGETS=drivers/fpga run_tests
 ...
 TAP version 13
 1..1
 # selftests: drivers/fpga: intr
 # TAP version 13
 # 1..1
 # # Starting 1 tests from 1 test cases.
 # #  RUN   global.afu_intr ...
 # #OK  global.afu_intr
 # ok 1 global.afu_intr
 # # PASSED: 1 / 1 tests passed.
 # # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0
 ok 1 selftests: drivers/fpga: intr

Signed-off-by: Tom Rix 
---
v1: Convert to kselftest_harness.h framework
v2: reverse xmas tree variables
---
 MAINTAINERS   |  1 +
 tools/testing/selftests/Makefile  |  1 +
 tools/testing/selftests/drivers/fpga/Makefile |  7 
 tools/testing/selftests/drivers/fpga/config   |  1 +
 tools/testing/selftests/drivers/fpga/intr.c   | 36 +++
 5 files changed, 46 insertions(+)
 create mode 100644 tools/testing/selftests/drivers/fpga/Makefile
 create mode 100644 tools/testing/selftests/drivers/fpga/config
 create mode 100644 tools/testing/selftests/drivers/fpga/intr.c

diff --git a/MAINTAINERS b/MAINTAINERS
index de610a06cb5c..7ed3ce58d95e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6973,6 +6973,7 @@ F:Documentation/driver-api/fpga/
 F: Documentation/fpga/
 F: drivers/fpga/
 F: include/linux/fpga/
+F: tools/testing/selftests/drivers/fpga/
 
 FPGA SECURITY MANAGER DRIVERS
 M: Russ Weight 
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index afbab4aeef3c..aad4763ec348 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -9,6 +9,7 @@ TARGETS += core
 TARGETS += cpufreq
 TARGETS += cpu-hotplug
 TARGETS += drivers/dma-buf
+TARGETS += drivers/fpga
 TARGETS += efivarfs
 TARGETS += exec
 TARGETS += filesystems
diff --git a/tools/testing/selftests/drivers/fpga/Makefile 
b/tools/testing/selftests/drivers/fpga/Makefile
new file mode 100644
index ..eba35c405d5b
--- /dev/null
+++ b/tools/testing/selftests/drivers/fpga/Makefile
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-only
+CFLAGS += -I../../../../../usr/include/
+CFLAGS += -I../../../../../include/uapi/
+
+TEST_GEN_PROGS := intr
+
+include ../../lib.mk
diff --git a/tools/testing/selftests/drivers/fpga/config 
b/tools/testing/selftests/drivers/fpga/config
new file mode 100644
index ..e2111b81d8d7
--- /dev/null
+++ b/tools/testing/selftests/drivers/fpga/config
@@ -0,0 +1 @@
+CONFIG_FPGA_DFL_AFU=m
diff --git a/tools/testing/selftests/drivers/fpga/intr.c 
b/tools/testing/selftests/drivers/fpga/intr.c
new file mode 100644
index ..927dcc757f0b
--- /dev/null
+++ b/tools/testing/selftests/drivers/fpga/intr.c
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "../../kselftest_harness.h"
+
+TEST(afu_intr)
+{
+   struct dfl_fpga_port_info port_info;
+   uint32_t irq_num = UINT32_MAX;
+   int devfd, status;
+
+   devfd = open("/dev/dfl-port.0", O_RDONLY);
+   if (devfd < 0)
+   SKIP(0, "no fpga afu device 0");
+   /*
+* From fpga-dl.h :
+* Currently hardware supports up to 1 irq.
+* Return: 0 on success, -errno on failure.
+*/
+   status = ioctl(devfd, DFL_FPGA_PORT_ERR_GET_IRQ_NUM, _num);
+   ASSERT_EQ(0, status) {
+   TH_LOG("ioctl() failed to get the number irqs");
+   }
+   ASSERT_LT(irq_num, 256) {
+   TH_LOG("unexpeced number of irqs");
+   }
+   close(devfd);
+}
+
+TEST_HARNESS_MAIN
-- 
2.27.0



[PATCH v2] selftests: drivers: fpga: A test for interrupt support

2021-01-16 Thread trix
From: Tom Rix 

Check that the ioctl DFL_FPGA_PORT_ERR_GET_IRQ_NUM returns
an expected result.

Tested on vf device 0xbcc1

Sample run with
 # make -C tools/testing/selftests TARGETS=drivers/fpga run_tests
 ...
 TAP version 13
 1..1
 # selftests: drivers/fpga: intr
 # TAP version 13
 # 1..1
 # # Starting 1 tests from 1 test cases.
 # #  RUN   global.afu_intr ...
 # #OK  global.afu_intr
 # ok 1 global.afu_intr
 # # PASSED: 1 / 1 tests passed.
 # # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0
 ok 1 selftests: drivers/fpga: intr

Signed-off-by: Tom Rix 
---
v1: Convert to kselftest_harness.h framework
---
 MAINTAINERS   |  1 +
 tools/testing/selftests/Makefile  |  1 +
 tools/testing/selftests/drivers/fpga/Makefile |  7 
 tools/testing/selftests/drivers/fpga/config   |  1 +
 tools/testing/selftests/drivers/fpga/intr.c   | 36 +++
 5 files changed, 46 insertions(+)
 create mode 100644 tools/testing/selftests/drivers/fpga/Makefile
 create mode 100644 tools/testing/selftests/drivers/fpga/config
 create mode 100644 tools/testing/selftests/drivers/fpga/intr.c

diff --git a/MAINTAINERS b/MAINTAINERS
index de610a06cb5c..7ed3ce58d95e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6973,6 +6973,7 @@ F:Documentation/driver-api/fpga/
 F: Documentation/fpga/
 F: drivers/fpga/
 F: include/linux/fpga/
+F: tools/testing/selftests/drivers/fpga/
 
 FPGA SECURITY MANAGER DRIVERS
 M: Russ Weight 
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index afbab4aeef3c..aad4763ec348 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -9,6 +9,7 @@ TARGETS += core
 TARGETS += cpufreq
 TARGETS += cpu-hotplug
 TARGETS += drivers/dma-buf
+TARGETS += drivers/fpga
 TARGETS += efivarfs
 TARGETS += exec
 TARGETS += filesystems
diff --git a/tools/testing/selftests/drivers/fpga/Makefile 
b/tools/testing/selftests/drivers/fpga/Makefile
new file mode 100644
index ..eba35c405d5b
--- /dev/null
+++ b/tools/testing/selftests/drivers/fpga/Makefile
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-only
+CFLAGS += -I../../../../../usr/include/
+CFLAGS += -I../../../../../include/uapi/
+
+TEST_GEN_PROGS := intr
+
+include ../../lib.mk
diff --git a/tools/testing/selftests/drivers/fpga/config 
b/tools/testing/selftests/drivers/fpga/config
new file mode 100644
index ..e2111b81d8d7
--- /dev/null
+++ b/tools/testing/selftests/drivers/fpga/config
@@ -0,0 +1 @@
+CONFIG_FPGA_DFL_AFU=m
diff --git a/tools/testing/selftests/drivers/fpga/intr.c 
b/tools/testing/selftests/drivers/fpga/intr.c
new file mode 100644
index ..b362fb1f788d
--- /dev/null
+++ b/tools/testing/selftests/drivers/fpga/intr.c
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "../../kselftest_harness.h"
+
+TEST(afu_intr)
+{
+   int devfd, status;
+   struct dfl_fpga_port_info port_info;
+   uint32_t irq_num = UINT32_MAX;
+
+   devfd = open("/dev/dfl-port.0", O_RDONLY);
+   if (devfd < 0)
+   SKIP(0, "no fpga afu device 0");
+   /*
+* From fpga-dl.h :
+* Currently hardware supports up to 1 irq.
+* Return: 0 on success, -errno on failure.
+*/
+   status = ioctl(devfd, DFL_FPGA_PORT_ERR_GET_IRQ_NUM, _num);
+   ASSERT_EQ(0, status) {
+   TH_LOG("ioctl() failed to get the number irqs");
+   }
+   ASSERT_LT(irq_num, 256) {
+   TH_LOG("unexpeced number of irqs");
+   }
+   close(devfd);
+}
+
+TEST_HARNESS_MAIN
-- 
2.27.0



[PATCH] intel_idle: remove definition of DEBUG

2021-01-15 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 drivers/idle/intel_idle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 28f93b9aa51b..3273360f30f7 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -37,7 +37,7 @@
  */
 
 /* un-comment DEBUG to enable pr_debug() statements */
-#define DEBUG
+/* #define DEBUG */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-- 
2.27.0



[PATCH] [media] s5p-mfc: remove definition of DEBUG

2021-01-15 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 drivers/media/platform/s5p-mfc/s5p_mfc_debug.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h 
b/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h
index 752bbe4fe48e..e7e696c08081 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_debug.h
@@ -12,8 +12,6 @@
 #ifndef S5P_MFC_DEBUG_H_
 #define S5P_MFC_DEBUG_H_
 
-#define DEBUG
-
 #ifdef DEBUG
 extern int mfc_debug_level;
 
-- 
2.27.0



[PATCH] Input: i8042: remove definition of DEBUG

2021-01-15 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 drivers/input/serio/i8042.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index abae23af0791..411ebb2cefb5 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -111,7 +111,6 @@ module_param_named(nopnp, i8042_nopnp, bool, 0);
 MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings");
 #endif
 
-#define DEBUG
 #ifdef DEBUG
 static bool i8042_debug;
 module_param_named(debug, i8042_debug, bool, 0600);
-- 
2.27.0



[PATCH] net: phy: national: remove definition of DEBUG

2021-01-15 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 drivers/net/phy/national.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c
index 5a8c8eb18582..46160baaafe3 100644
--- a/drivers/net/phy/national.c
+++ b/drivers/net/phy/national.c
@@ -19,8 +19,6 @@
 #include 
 #include 
 
-#define DEBUG
-
 /* DP83865 phy identifier values */
 #define DP83865_PHY_ID 0x20005c7a
 
-- 
2.27.0



[PATCH] tracing: remove definition of DEBUG

2021-01-15 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 kernel/trace/trace_mmiotrace.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c
index 84582bf1ed5f..2c3c31791497 100644
--- a/kernel/trace/trace_mmiotrace.c
+++ b/kernel/trace/trace_mmiotrace.c
@@ -5,8 +5,6 @@
  * Copyright (C) 2008 Pekka Paalanen 
  */
 
-#define DEBUG 1
-
 #include 
 #include 
 #include 
-- 
2.27.0



[PATCH] net: ks8851: remove definition of DEBUG

2021-01-15 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/micrel/ks8851_common.c | 2 --
 drivers/net/ethernet/micrel/ks8851_par.c| 2 --
 drivers/net/ethernet/micrel/ks8851_spi.c| 2 --
 3 files changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/micrel/ks8851_common.c 
b/drivers/net/ethernet/micrel/ks8851_common.c
index 058fd99bd483..2feed6ce19d3 100644
--- a/drivers/net/ethernet/micrel/ks8851_common.c
+++ b/drivers/net/ethernet/micrel/ks8851_common.c
@@ -8,8 +8,6 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#define DEBUG
-
 #include 
 #include 
 #include 
diff --git a/drivers/net/ethernet/micrel/ks8851_par.c 
b/drivers/net/ethernet/micrel/ks8851_par.c
index 3bab0cb2b1a5..2e8fcce50f9d 100644
--- a/drivers/net/ethernet/micrel/ks8851_par.c
+++ b/drivers/net/ethernet/micrel/ks8851_par.c
@@ -8,8 +8,6 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#define DEBUG
-
 #include 
 #include 
 #include 
diff --git a/drivers/net/ethernet/micrel/ks8851_spi.c 
b/drivers/net/ethernet/micrel/ks8851_spi.c
index 4ec7f1615977..479406ecbaa3 100644
--- a/drivers/net/ethernet/micrel/ks8851_spi.c
+++ b/drivers/net/ethernet/micrel/ks8851_spi.c
@@ -8,8 +8,6 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#define DEBUG
-
 #include 
 #include 
 #include 
-- 
2.27.0



[PATCH] watchdog: it8712f_wdt: remove definition of DEBUG

2021-01-15 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 drivers/watchdog/it8712f_wdt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c
index 9b89d2f09568..3ce6a58bd81e 100644
--- a/drivers/watchdog/it8712f_wdt.c
+++ b/drivers/watchdog/it8712f_wdt.c
@@ -31,7 +31,6 @@
 #include 
 #include 
 
-#define DEBUG
 #define NAME "it8712f_wdt"
 
 MODULE_AUTHOR("Jorge Boncompte - DTI2 ");
-- 
2.27.0



[PATCH] neighbor: remove definition of DEBUG

2021-01-14 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 net/core/neighbour.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 277ed854aef1..ff073581b5b1 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -41,7 +41,6 @@
 
 #include 
 
-#define DEBUG
 #define NEIGH_DEBUG 1
 #define neigh_dbg(level, fmt, ...) \
 do {   \
-- 
2.27.0



[PATCH v2] x86 : remove definition of DEBUG

2021-01-14 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
v1: merge all 4 in arch/x86/
---
 arch/x86/kernel/cpu/mtrr/generic.c | 1 -
 arch/x86/kernel/cpu/mtrr/mtrr.c| 2 --
 arch/x86/kernel/pci-iommu_table.c  | 3 ---
 arch/x86/mm/mmio-mod.c | 2 --
 4 files changed, 8 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/generic.c 
b/arch/x86/kernel/cpu/mtrr/generic.c
index a29997e6cf9e..b90f3f437765 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -3,7 +3,6 @@
  * This only handles 32bit MTRR on 32bit hosts. This is strictly wrong
  * because MTRRs can span up to 40 bits (36bits on most modern x86)
  */
-#define DEBUG
 
 #include 
 #include 
diff --git a/arch/x86/kernel/cpu/mtrr/mtrr.c b/arch/x86/kernel/cpu/mtrr/mtrr.c
index 61eb26edc6d2..28c8a23aa42e 100644
--- a/arch/x86/kernel/cpu/mtrr/mtrr.c
+++ b/arch/x86/kernel/cpu/mtrr/mtrr.c
@@ -31,8 +31,6 @@
 System Programming Guide; Section 9.11. (1997 edition - PPro).
 */
 
-#define DEBUG
-
 #include  /* FIXME: kvm_para.h needs this */
 
 #include 
diff --git a/arch/x86/kernel/pci-iommu_table.c 
b/arch/x86/kernel/pci-iommu_table.c
index 2e9006c1e240..42e92ec62973 100644
--- a/arch/x86/kernel/pci-iommu_table.c
+++ b/arch/x86/kernel/pci-iommu_table.c
@@ -4,9 +4,6 @@
 #include 
 #include 
 
-
-#define DEBUG 1
-
 static struct iommu_table_entry * __init
 find_dependents_of(struct iommu_table_entry *start,
   struct iommu_table_entry *finish,
diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c
index bd7aff5c51f7..cd768dafca9e 100644
--- a/arch/x86/mm/mmio-mod.c
+++ b/arch/x86/mm/mmio-mod.c
@@ -10,8 +10,6 @@
 
 #define pr_fmt(fmt) "mmiotrace: " fmt
 
-#define DEBUG 1
-
 #include 
 #include 
 #include 
-- 
2.27.0



[PATCH] x86/mm/mtrr: remove definition of DEBUG

2021-01-14 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 arch/x86/kernel/cpu/mtrr/generic.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mtrr/generic.c 
b/arch/x86/kernel/cpu/mtrr/generic.c
index a29997e6cf9e..b90f3f437765 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -3,7 +3,6 @@
  * This only handles 32bit MTRR on 32bit hosts. This is strictly wrong
  * because MTRRs can span up to 40 bits (36bits on most modern x86)
  */
-#define DEBUG
 
 #include 
 #include 
-- 
2.27.0



[PATCH] x86 mmiotrace: remove definition of DEBUG

2021-01-14 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 arch/x86/mm/mmio-mod.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c
index bd7aff5c51f7..cd768dafca9e 100644
--- a/arch/x86/mm/mmio-mod.c
+++ b/arch/x86/mm/mmio-mod.c
@@ -10,8 +10,6 @@
 
 #define pr_fmt(fmt) "mmiotrace: " fmt
 
-#define DEBUG 1
-
 #include 
 #include 
 #include 
-- 
2.27.0



[PATCH] i2c: stub: remove definition of DEBUG

2021-01-13 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 drivers/i2c/i2c-stub.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/i2c/i2c-stub.c b/drivers/i2c/i2c-stub.c
index 537a598e22db..d642cad219d9 100644
--- a/drivers/i2c/i2c-stub.c
+++ b/drivers/i2c/i2c-stub.c
@@ -7,7 +7,6 @@
 
 */
 
-#define DEBUG 1
 #define pr_fmt(fmt) "i2c-stub: " fmt
 
 #include 
-- 
2.27.0



[PATCH] gianfar: remove definition of DEBUG

2021-01-13 Thread trix
From: Tom Rix 

Defining DEBUG should only be done in development.
So remove DEBUG.

Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/freescale/gianfar.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c 
b/drivers/net/ethernet/freescale/gianfar.c
index d391a45cebb6..541de32ea662 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -58,7 +58,6 @@
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#define DEBUG
 
 #include 
 #include 
-- 
2.27.0



[PATCH] USB: serial: mos7720: improve handling of a kmalloc failure in read_mos_reg()

2021-01-11 Thread trix
From: Tom Rix 

clang static analysis reports this problem

mos7720.c:352:2: warning: Undefined or garbage value returned to caller
return d;
^~~~

In the parport_mos7715_read_data()'s call to read_mos_reg(), 'd' is
only set after the alloc block.

buf = kmalloc(1, GFP_KERNEL);
if (!buf)
return -ENOMEM;

Although the problem is reported in parport_most7715_read_data(),
none of the callee's of read_mos_reg() check the return status.

So move the clearing of data to before the malloc.

Fixes: 0d130367abf5 ("USB: serial: mos7720: fix control-message error handling")
Signed-off-by: Tom Rix 
---
 drivers/usb/serial/mos7720.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 41ee2984a0df..23e8162c768b 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -214,6 +214,7 @@ static int read_mos_reg(struct usb_serial *serial, unsigned 
int serial_portnum,
u8 *buf;
int status;
 
+   *data = 0;
buf = kmalloc(1, GFP_KERNEL);
if (!buf)
return -ENOMEM;
@@ -227,7 +228,6 @@ static int read_mos_reg(struct usb_serial *serial, unsigned 
int serial_portnum,
"mos7720: usb_control_msg() failed: %d\n", status);
if (status >= 0)
status = -EIO;
-   *data = 0;
}
 
kfree(buf);
-- 
2.27.0



[PATCH] block/rnbd-clt: improve find_or_create_sess() return check

2021-01-10 Thread trix
From: Tom Rix 

clang static analysis reports this problem

rnbd-clt.c:1212:11: warning: Branch condition evaluates to a
  garbage value
else if (!first)
 ^~

This is triggered in the find_and_get_or_create_sess() call
because the variable first is not initialized and the
earlier check is specifically for

if (sess == ERR_PTR(-ENOMEM))

This is false positive.

But the if-check can be reduced by initializing first to
false and then returning if the call to find_or_creat_sess()
does not set it to true.  When it remains false, either
sess will be valid or not.  The not case is caught by
find_and_get_or_create_sess()'s caller rnbd_clt_map_device()

sess = find_and_get_or_create_sess(...);
if (IS_ERR(sess))
return ERR_CAST(sess);

Since find_and_get_or_create_sess() initializes first to false
setting it in find_or_create_sess() is not needed.

Signed-off-by: Tom Rix 
---
 drivers/block/rnbd/rnbd-clt.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c
index 96e3f9fe8241..251f747cf10d 100644
--- a/drivers/block/rnbd/rnbd-clt.c
+++ b/drivers/block/rnbd/rnbd-clt.c
@@ -919,6 +919,7 @@ static struct rnbd_clt_session *__find_and_get_sess(const 
char *sessname)
return NULL;
 }
 
+/* caller is responsible for initializing 'first' to false */
 static struct
 rnbd_clt_session *find_or_create_sess(const char *sessname, bool *first)
 {
@@ -934,8 +935,7 @@ rnbd_clt_session *find_or_create_sess(const char *sessname, 
bool *first)
}
list_add(>list, _list);
*first = true;
-   } else
-   *first = false;
+   }
mutex_unlock(_lock);
 
return sess;
@@ -1203,13 +1203,11 @@ find_and_get_or_create_sess(const char *sessname,
struct rnbd_clt_session *sess;
struct rtrs_attrs attrs;
int err;
-   bool first;
+   bool first = false;
struct rtrs_clt_ops rtrs_ops;
 
sess = find_or_create_sess(sessname, );
-   if (sess == ERR_PTR(-ENOMEM))
-   return ERR_PTR(-ENOMEM);
-   else if (!first)
+   if (!first)
return sess;
 
if (!path_cnt) {
-- 
2.27.0



[PATCH] cifs: check pointer before freeing

2021-01-05 Thread trix
From: Tom Rix 

clang static analysis reports this problem

dfs_cache.c:591:2: warning: Argument to kfree() is a constant address
  (18446744073709551614), which is not memory allocated by malloc()
kfree(vi);
^

In dfs_cache_del_vol() the volume info pointer 'vi' being freed
is the return of a call to find_vol().  The large constant address
is find_vol() returning an error.

Add an error check to dfs_cache_del_vol() similar to the one done
in dfs_cache_update_vol().

Fixes: 54be1f6c1c37 ("cifs: Add DFS cache routines")
Signed-off-by: Tom Rix 
---
 fs/cifs/dfs_cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
index 6ad6ba5f6ebe..0fdb0de7ff86 100644
--- a/fs/cifs/dfs_cache.c
+++ b/fs/cifs/dfs_cache.c
@@ -1260,7 +1260,8 @@ void dfs_cache_del_vol(const char *fullpath)
vi = find_vol(fullpath);
spin_unlock(_list_lock);
 
-   kref_put(>refcnt, vol_release);
+   if (!IS_ERR(vi))
+   kref_put(>refcnt, vol_release);
 }
 
 /**
-- 
2.27.0



[PATCH] jffs2: fix use after free in jffs2_sum_write_data()

2020-12-30 Thread trix
From: Tom Rix 

clang static analysis reports this problem

fs/jffs2/summary.c:794:31: warning: Use of memory after it is freed
c->summary->sum_list_head = temp->u.next;
^~~~

In jffs2_sum_write_data(), in a loop summary data is handles a node at
a time.  When it has written out the node it is removed the summary list,
and the node is deleted.  In the corner case when a
JFFS2_FEATURE_RWCOMPAT_COPY is seen, a call is made to
jffs2_sum_disable_collecting().  jffs2_sum_disable_collecting() deletes
the whole list which conflicts with the loop's deleting the list by parts.

To preserve the old behavior of stopping the write midway, bail out of
the loop after disabling summary collection.

Fixes: 6171586a7ae5 ("[JFFS2] Correct handling of JFFS2_FEATURE_RWCOMPAT_COPY 
nodes.")
Signed-off-by: Tom Rix 
---
 fs/jffs2/summary.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c
index be7c8a6a5748..4fe64519870f 100644
--- a/fs/jffs2/summary.c
+++ b/fs/jffs2/summary.c
@@ -783,6 +783,8 @@ static int jffs2_sum_write_data(struct jffs2_sb_info *c, 
struct jffs2_eraseblock
dbg_summary("Writing unknown 
RWCOMPAT_COPY node type %x\n",

je16_to_cpu(temp->u.nodetype));

jffs2_sum_disable_collecting(c->summary);
+   /* The above call removes the list, 
nothing more to do */
+   goto bail_rwcompat;
} else {
BUG();  /* unknown node in summary 
information */
}
@@ -794,6 +796,7 @@ static int jffs2_sum_write_data(struct jffs2_sb_info *c, 
struct jffs2_eraseblock
 
c->summary->sum_num--;
}
+ bail_rwcompat:
 
jffs2_sum_reset_collected(c->summary);
 
-- 
2.27.0



[PATCH] RDMA/ocrdma: fix use after free in ocrdma_dealloc_ucontext_pd()

2020-12-29 Thread trix
From: Tom Rix 

In ocrdma_dealloc_ucontext_pd() uctx->cntxt_pd is assigned to
the variable pd and then after uctx->cntxt_pd is freed, the
variable pd is passed to function _ocrdma_dealloc_pd() which
dereferences pd directly or through its call to
ocrdma_mbx_dealloc_pd().

Reorder the free using the variable pd.

Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
Signed-off-by: Tom Rix 
---
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c 
b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index bc98bd950d99..3acb5c10b155 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -434,9 +434,9 @@ static void ocrdma_dealloc_ucontext_pd(struct 
ocrdma_ucontext *uctx)
pr_err("%s(%d) Freeing in use pdid=0x%x.\n",
   __func__, dev->id, pd->id);
}
-   kfree(uctx->cntxt_pd);
uctx->cntxt_pd = NULL;
_ocrdma_dealloc_pd(dev, pd);
+   kfree(pd);
 }
 
 static struct ocrdma_pd *ocrdma_get_ucontext_pd(struct ocrdma_ucontext *uctx)
-- 
2.27.0



[PATCH] rxrpc: fix handling of an unsupported token type in rxrpc_read()

2020-12-29 Thread trix
From: Tom Rix 

clang static analysis reports this problem

net/rxrpc/key.c:657:11: warning: Assigned value is garbage or undefined
toksize = toksizes[tok++];
^ ~~~

rxrpc_read() contains two loops.  The first loop calculates the token
sizes and stores the results in toksizes[] and the second one uses the
array.  When there is an error in identifying the token in the first
loop, the token is skipped, no change is made to the toksizes[] array.
When the same error happens in the second loop, the token is not
skipped.  This will cause the toksizes[] array to be out of step and
will overrun past the calculated sizes.

Change the error handling in the second loop to be consistent with
the first.  Simplify the error handling to an if check.

Fixes: 9a059cd5ca7d ("rxrpc: Downgrade the BUG() for unsupported token type in 
rxrpc_read()")
Signed-off-by: Tom Rix 
---
 net/rxrpc/key.c | 48 ++--
 1 file changed, 22 insertions(+), 26 deletions(-)

diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c
index 9631aa8543b5..eea877ee6ab3 100644
--- a/net/rxrpc/key.c
+++ b/net/rxrpc/key.c
@@ -587,20 +587,19 @@ static long rxrpc_read(const struct key *key,
for (token = key->payload.data[0]; token; token = token->next) {
toksize = 4;/* sec index */
 
-   switch (token->security_index) {
-   case RXRPC_SECURITY_RXKAD:
-   toksize += 8 * 4;   /* viceid, kvno, key*2, begin,
-* end, primary, tktlen */
-   if (!token->no_leak_key)
-   toksize += RND(token->kad->ticket_len);
-   break;
-
-   default: /* we have a ticket we can't encode */
+   if (token->security_index != RXRPC_SECURITY_RXKAD) {
+   /* we have a ticket we can't encode */
pr_err("Unsupported key token type (%u)\n",
   token->security_index);
continue;
}
 
+   /* viceid, kvno, key*2, begin, end, primary, tktlen */
+   toksize += 8 * 4;
+
+   if (!token->no_leak_key)
+   toksize += RND(token->kad->ticket_len);
+
_debug("token[%u]: toksize=%u", ntoks, toksize);
ASSERTCMP(toksize, <=, AFSTOKEN_LENGTH_MAX);
 
@@ -654,28 +653,25 @@ static long rxrpc_read(const struct key *key,
 
tok = 0;
for (token = key->payload.data[0]; token; token = token->next) {
+   /* error reported above */
+   if (token->security_index != RXRPC_SECURITY_RXKAD)
+   continue;
+
toksize = toksizes[tok++];
ENCODE(toksize);
oldxdr = xdr;
ENCODE(token->security_index);
 
-   switch (token->security_index) {
-   case RXRPC_SECURITY_RXKAD:
-   ENCODE(token->kad->vice_id);
-   ENCODE(token->kad->kvno);
-   ENCODE_BYTES(8, token->kad->session_key);
-   ENCODE(token->kad->start);
-   ENCODE(token->kad->expiry);
-   ENCODE(token->kad->primary_flag);
-   if (token->no_leak_key)
-   ENCODE(0);
-   else
-   ENCODE_DATA(token->kad->ticket_len, 
token->kad->ticket);
-   break;
-
-   default:
-   break;
-   }
+   ENCODE(token->kad->vice_id);
+   ENCODE(token->kad->kvno);
+   ENCODE_BYTES(8, token->kad->session_key);
+   ENCODE(token->kad->start);
+   ENCODE(token->kad->expiry);
+   ENCODE(token->kad->primary_flag);
+   if (token->no_leak_key)
+   ENCODE(0);
+   else
+   ENCODE_DATA(token->kad->ticket_len, token->kad->ticket);
 
ASSERTCMP((unsigned long)xdr - (unsigned long)oldxdr, ==,
  toksize);
-- 
2.27.0



[PATCH] via-velocity: remove h from printk format specifier

2020-12-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/via/via-velocity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/via/via-velocity.c 
b/drivers/net/ethernet/via/via-velocity.c
index b65767f9e499..119439f78c1b 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -1823,7 +1823,7 @@ static void velocity_error(struct velocity_info *vptr, 
int status)
if (status & ISR_TXSTLI) {
struct mac_regs __iomem *regs = vptr->mac_regs;
 
-   netdev_err(vptr->netdev, "TD structure error TDindex=%hx\n",
+   netdev_err(vptr->netdev, "TD structure error TDindex=%x\n",
   readw(>TDIdx[0]));
BYTE_REG_BITS_ON(TXESR_TDSTR, >TXESR);
writew(TRDCSR_RUN, >TDCSRClr);
-- 
2.27.0



[PATCH] qed: remove h from printk format specifier

2020-12-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/qlogic/qed/qed_dev.c  | 22 +++---
 drivers/net/ethernet/qlogic/qed/qed_main.c |  2 +-
 drivers/net/ethernet/qlogic/qed/qed_mcp.c  |  4 ++--
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c 
b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index d2f5855b2ea7..feee5535a9e2 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -410,7 +410,7 @@ static int qed_llh_alloc(struct qed_dev *cdev)
continue;
 
p_llh_info->ppfid_array[p_llh_info->num_ppfid] = i;
-   DP_VERBOSE(cdev, QED_MSG_SP, "ppfid_array[%d] = %hhd\n",
+   DP_VERBOSE(cdev, QED_MSG_SP, "ppfid_array[%d] = %d\n",
   p_llh_info->num_ppfid, i);
p_llh_info->num_ppfid++;
}
@@ -624,7 +624,7 @@ static int qed_llh_abs_ppfid(struct qed_dev *cdev, u8 
ppfid, u8 *p_abs_ppfid)
 
if (ppfid >= p_llh_info->num_ppfid) {
DP_NOTICE(cdev,
- "ppfid %d is not valid, available indices are 
0..%hhd\n",
+ "ppfid %d is not valid, available indices are 
0..%d\n",
  ppfid, p_llh_info->num_ppfid - 1);
*p_abs_ppfid = 0;
return -EINVAL;
@@ -988,13 +988,13 @@ int qed_llh_add_mac_filter(struct qed_dev *cdev,
 
DP_VERBOSE(cdev,
   QED_MSG_SP,
-  "LLH: Added MAC filter [%pM] to ppfid %hhd [abs %hhd] at idx 
%hhd [ref_cnt %d]\n",
+  "LLH: Added MAC filter [%pM] to ppfid %d [abs %d] at idx %d 
[ref_cnt %d]\n",
   mac_addr, ppfid, abs_ppfid, filter_idx, ref_cnt);
 
goto out;
 
 err:   DP_NOTICE(cdev,
- "LLH: Failed to add MAC filter [%pM] to ppfid %hhd\n",
+ "LLH: Failed to add MAC filter [%pM] to ppfid %d\n",
  mac_addr, ppfid);
 out:
qed_ptt_release(p_hwfn, p_ptt);
@@ -1134,13 +1134,13 @@ qed_llh_add_protocol_filter(struct qed_dev *cdev,
 
DP_VERBOSE(cdev,
   QED_MSG_SP,
-  "LLH: Added protocol filter [%s] to ppfid %hhd [abs %hhd] at 
idx %hhd [ref_cnt %d]\n",
+  "LLH: Added protocol filter [%s] to ppfid %d [abs %d] at idx 
%d [ref_cnt %d]\n",
   str, ppfid, abs_ppfid, filter_idx, ref_cnt);
 
goto out;
 
 err:   DP_NOTICE(p_hwfn,
- "LLH: Failed to add protocol filter [%s] to ppfid %hhd\n",
+ "LLH: Failed to add protocol filter [%s] to ppfid %d\n",
  str, ppfid);
 out:
qed_ptt_release(p_hwfn, p_ptt);
@@ -1184,13 +1184,13 @@ void qed_llh_remove_mac_filter(struct qed_dev *cdev,
 
DP_VERBOSE(cdev,
   QED_MSG_SP,
-  "LLH: Removed MAC filter [%pM] from ppfid %hhd [abs %hhd] at 
idx %hhd [ref_cnt %d]\n",
+  "LLH: Removed MAC filter [%pM] from ppfid %d [abs %d] at idx 
%d [ref_cnt %d]\n",
   mac_addr, ppfid, abs_ppfid, filter_idx, ref_cnt);
 
goto out;
 
 err:   DP_NOTICE(cdev,
- "LLH: Failed to remove MAC filter [%pM] from ppfid %hhd\n",
+ "LLH: Failed to remove MAC filter [%pM] from ppfid %d\n",
  mac_addr, ppfid);
 out:
qed_ptt_release(p_hwfn, p_ptt);
@@ -1242,13 +1242,13 @@ void qed_llh_remove_protocol_filter(struct qed_dev 
*cdev,
 
DP_VERBOSE(cdev,
   QED_MSG_SP,
-  "LLH: Removed protocol filter [%s] from ppfid %hhd [abs 
%hhd] at idx %hhd [ref_cnt %d]\n",
+  "LLH: Removed protocol filter [%s] from ppfid %d [abs %d] at 
idx %d [ref_cnt %d]\n",
   str, ppfid, abs_ppfid, filter_idx, ref_cnt);
 
goto out;
 
 err:   DP_NOTICE(cdev,
- "LLH: Failed to remove protocol filter [%s] from ppfid 
%hhd\n",
+ "LLH: Failed to remove protocol filter [%s] from ppfid %d\n",
  str, ppfid);
 out:
qed_ptt_release(p_hwfn, p_ptt);
@@ -3865,7 +3865,7 @@ static int qed_hw_get_ppfid_bitmap(struct qed_hwfn 
*p_hwfn,
 
if (!(cdev->ppfid_bitmap & (0x1 << native_ppfid_idx))) {
DP_INFO(p_hwfn,
-   "Fix the PPFID bitmap to include the native PPFID 
[native_ppfid_idx %hhd, orig_bitmap 0x%hhx]\n",
+   "Fix the PPFID bitmap to include the native PPFID 
[native_ppfid_idx %d, orig_bitmap 0x%x]\n",
native_ppfid_idx, cdev->ppfid_bitmap);
cdev->ppfid_bitmap = 0x1 << 

[PATCH] nfp: remove h from printk format specifier

2020-12-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/netronome/nfp/bpf/verifier.c  | 2 +-
 drivers/net/ethernet/netronome/nfp/crypto/tls.c| 4 ++--
 drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c | 2 +-
 drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c   | 6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/netronome/nfp/bpf/verifier.c 
b/drivers/net/ethernet/netronome/nfp/bpf/verifier.c
index e92ee510fd52..2681b5d56a38 100644
--- a/drivers/net/ethernet/netronome/nfp/bpf/verifier.c
+++ b/drivers/net/ethernet/netronome/nfp/bpf/verifier.c
@@ -828,7 +828,7 @@ int nfp_bpf_opt_replace_insn(struct bpf_verifier_env *env, 
u32 off,
return 0;
}
 
-   pr_vlog(env, "unsupported instruction replacement %hhx -> %hhx\n",
+   pr_vlog(env, "unsupported instruction replacement %x -> %x\n",
meta->insn.code, insn->code);
return -EINVAL;
 }
diff --git a/drivers/net/ethernet/netronome/nfp/crypto/tls.c 
b/drivers/net/ethernet/netronome/nfp/crypto/tls.c
index 84d66d138c3d..697317d60d29 100644
--- a/drivers/net/ethernet/netronome/nfp/crypto/tls.c
+++ b/drivers/net/ethernet/netronome/nfp/crypto/tls.c
@@ -486,7 +486,7 @@ int nfp_net_tls_rx_resync_req(struct net_device *netdev,
th = pkt + req->l4_offset;
 
if ((u8 *)[1] > (u8 *)pkt + pkt_len) {
-   netdev_warn_once(netdev, "invalid TLS RX resync request 
(l3_off: %hhu l4_off: %hhu pkt_len: %u)\n",
+   netdev_warn_once(netdev, "invalid TLS RX resync request 
(l3_off: %u l4_off: %u pkt_len: %u)\n",
 req->l3_offset, req->l4_offset, pkt_len);
err = -EINVAL;
goto err_cnt_ign;
@@ -507,7 +507,7 @@ int nfp_net_tls_rx_resync_req(struct net_device *netdev,
break;
 #endif
default:
-   netdev_warn_once(netdev, "invalid TLS RX resync request 
(l3_off: %hhu l4_off: %hhu ipver: %u)\n",
+   netdev_warn_once(netdev, "invalid TLS RX resync request 
(l3_off: %u l4_off: %u ipver: %u)\n",
 req->l3_offset, req->l4_offset, iph->version);
err = -EINVAL;
goto err_cnt_ign;
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c 
b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c
index 7bc17b94ac60..041801f0e668 100644
--- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c
@@ -195,7 +195,7 @@ int nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
if (time_is_before_eq_jiffies(warn_at)) {
warn_at = jiffies + NFP_MUTEX_WAIT_NEXT_WARN * HZ;
nfp_warn(mutex->cpp,
-"Warning: waiting for NFP mutex [depth:%hd 
target:%d addr:%llx key:%08x]\n",
+"Warning: waiting for NFP mutex [depth:%d 
target:%d addr:%llx key:%08x]\n",
 mutex->depth,
 mutex->target, mutex->address, mutex->key);
}
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c 
b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c
index 10e7d8b21c46..06d03081a4dd 100644
--- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c
@@ -247,12 +247,12 @@ static int nfp_nsp_check(struct nfp_nsp *state)
state->ver.minor = FIELD_GET(NSP_STATUS_MINOR, reg);
 
if (state->ver.major != NSP_MAJOR) {
-   nfp_err(cpp, "Unsupported ABI %hu.%hu\n",
+   nfp_err(cpp, "Unsupported ABI %u.%u\n",
state->ver.major, state->ver.minor);
return -EINVAL;
}
if (state->ver.minor < NSP_MINOR) {
-   nfp_err(cpp, "ABI too old to support NIC operation (%u.%hu < 
%u.%u), please update the management FW on the flash\n",
+   nfp_err(cpp, "ABI too old to support NIC operation (%u.%u < 
%u.%u), please update the management FW on the flash\n",
NSP_MAJOR, state->ver.minor, NSP_MAJOR, NSP_MINOR);
return -EINVAL;
}
@@ -662,7 +662,7 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, struct 
nfp_nsp_command_buf_arg *arg)
int err;
 
if (nsp->ver.minor < 13) {
-   nfp_err(cpp, "NSP: Code 0x%04x with buffer not supported (ABI 
%hu.%hu)\n",
+   nfp_err(cpp, "NSP: Code 0x%04x with buffer not supported (ABI 
%u.%u)\n",
arg->arg.code, nsp->ver.major, nsp->ver.minor);
return 

[PATCH] net/mlx5e: remove h from printk format specifier

2020-12-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c 
b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
index 43271a3856ca..36381a2ed5a5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
@@ -179,7 +179,7 @@ int mlx5e_validate_params(struct mlx5e_priv *priv, struct 
mlx5e_params *params)
 
stop_room = mlx5e_calc_sq_stop_room(priv->mdev, params);
if (stop_room >= sq_size) {
-   netdev_err(priv->netdev, "Stop room %hu is bigger than the SQ 
size %zu\n",
+   netdev_err(priv->netdev, "Stop room %u is bigger than the SQ 
size %zu\n",
   stop_room, sq_size);
return -EINVAL;
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 
b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 03831650f655..d41bfea85aa2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3763,7 +3763,7 @@ static int set_feature_lro(struct net_device *netdev, 
bool enable)
mutex_lock(>state_lock);
 
if (enable && priv->xsk.refcnt) {
-   netdev_warn(netdev, "LRO is incompatible with AF_XDP (%hu XSKs 
are active)\n",
+   netdev_warn(netdev, "LRO is incompatible with AF_XDP (%u XSKs 
are active)\n",
priv->xsk.refcnt);
err = -EINVAL;
goto out;
@@ -4005,7 +4005,7 @@ static bool mlx5e_xsk_validate_mtu(struct net_device 
*netdev,
max_mtu_page = mlx5e_xdp_max_mtu(new_params, );
max_mtu = min(max_mtu_frame, max_mtu_page);
 
-   netdev_err(netdev, "MTU %d is too big for an XSK 
running on channel %hu. Try MTU <= %d\n",
+   netdev_err(netdev, "MTU %d is too big for an XSK 
running on channel %u. Try MTU <= %d\n",
   new_params->sw_mtu, ix, max_mtu);
return false;
}
-- 
2.27.0



[PATCH] igb: remove h from printk format specifier

2020-12-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c 
b/drivers/net/ethernet/intel/igb/igb_main.c
index 03f78fdb0dcd..cb682232df16 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3156,7 +3156,7 @@ static int igb_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
 * the PCIe SR-IOV capability.
 */
if (pdev->is_virtfn) {
-   WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
+   WARN(1, KERN_ERR "%s (%x:%x) should not be a VF!\n",
pci_name(pdev), pdev->vendor, pdev->device);
return -EINVAL;
}
-- 
2.27.0



[PATCH] amd-xgbe: remove h from printk format specifier

2020-12-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c 
b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
index 61f39a0e04f9..3c18f26bf2a5 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
@@ -339,14 +339,14 @@ static int xgbe_set_link_ksettings(struct net_device 
*netdev,
speed = cmd->base.speed;
 
if (cmd->base.phy_address != pdata->phy.address) {
-   netdev_err(netdev, "invalid phy address %hhu\n",
+   netdev_err(netdev, "invalid phy address %u\n",
   cmd->base.phy_address);
return -EINVAL;
}
 
if ((cmd->base.autoneg != AUTONEG_ENABLE) &&
(cmd->base.autoneg != AUTONEG_DISABLE)) {
-   netdev_err(netdev, "unsupported autoneg %hhu\n",
+   netdev_err(netdev, "unsupported autoneg %u\n",
   cmd->base.autoneg);
return -EINVAL;
}
@@ -358,7 +358,7 @@ static int xgbe_set_link_ksettings(struct net_device 
*netdev,
}
 
if (cmd->base.duplex != DUPLEX_FULL) {
-   netdev_err(netdev, "unsupported duplex %hhu\n",
+   netdev_err(netdev, "unsupported duplex %u\n",
   cmd->base.duplex);
return -EINVAL;
}
-- 
2.27.0



[PATCH] net: ena: remove h from printk format specifier

2020-12-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/net/ethernet/amazon/ena/ena_com.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c 
b/drivers/net/ethernet/amazon/ena/ena_com.c
index 02087d443e73..764852ead1d6 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_com.c
@@ -863,7 +863,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev 
*ena_dev, u16 offset)
 
if (unlikely(i == timeout)) {
netdev_err(ena_dev->net_device,
-  "Reading reg failed for timeout. expected: req 
id[%hu] offset[%hu] actual: req id[%hu] offset[%hu]\n",
+  "Reading reg failed for timeout. expected: req 
id[%u] offset[%u] actual: req id[%u] offset[%u]\n",
   mmio_read->seq_num, offset, read_resp->req_id,
   read_resp->reg_off);
ret = ENA_MMIO_READ_TIMEOUT;
@@ -2396,7 +2396,7 @@ int ena_com_fill_hash_function(struct ena_com_dev 
*ena_dev,
if (key) {
if (key_len != sizeof(hash_key->key)) {
netdev_err(ena_dev->net_device,
-  "key len (%hu) doesn't equal the 
supported size (%zu)\n",
+  "key len (%u) doesn't equal the 
supported size (%zu)\n",
   key_len, sizeof(hash_key->key));
return -EINVAL;
}
-- 
2.27.0



[PATCH] RDMA/hns: remove h from printk format specifier

2020-12-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c 
b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 833e1f259936..4c068899c52b 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -361,7 +361,7 @@ static int check_send_valid(struct hns_roce_dev *hr_dev,
} else if (unlikely(hr_qp->state == IB_QPS_RESET ||
   hr_qp->state == IB_QPS_INIT ||
   hr_qp->state == IB_QPS_RTR)) {
-   ibdev_err(ibdev, "failed to post WQE, QP state %hhu!\n",
+   ibdev_err(ibdev, "failed to post WQE, QP state %u!\n",
  hr_qp->state);
return -EINVAL;
} else if (unlikely(hr_dev->state >= HNS_ROCE_DEVICE_STATE_RST_DOWN)) {
-- 
2.27.0



[PATCH] block: sed-opal: remove h from printk format specifier

2020-12-23 Thread trix
From: Tom Rix 

This change fixes the checkpatch warning described in this commit
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 block/sed-opal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/sed-opal.c b/block/sed-opal.c
index daafadbb88ca..9be24559ee9a 100644
--- a/block/sed-opal.c
+++ b/block/sed-opal.c
@@ -2540,7 +2540,7 @@ bool opal_unlock_from_suspend(struct opal_dev *dev)
 
ret = __opal_lock_unlock(dev, >unlk);
if (ret) {
-   pr_debug("Failed to unlock LR %hhu with sum %d\n",
+   pr_debug("Failed to unlock LR %u with sum %d\n",
 suspend->unlk.session.opal_key.lr,
 suspend->unlk.session.sum);
was_failure = true;
-- 
2.27.0



[PATCH] tracing: add printf attribute to log function

2020-12-21 Thread trix
From: Tom Rix 

Attributing the function allows the compiler to more thoroughly
check the use of the function with -Wformat and similar flags.

Signed-off-by: Tom Rix 
---
 include/linux/trace.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/trace.h b/include/linux/trace.h
index 886a4ffd9d45..be1e130ed87c 100644
--- a/include/linux/trace.h
+++ b/include/linux/trace.h
@@ -34,8 +34,9 @@ int unregister_ftrace_export(struct trace_export *export);
 struct trace_array;
 
 void trace_printk_init_buffers(void);
+__printf(3, 4)
 int trace_array_printk(struct trace_array *tr, unsigned long ip,
-   const char *fmt, ...);
+  const char *fmt, ...);
 int trace_array_init_printk(struct trace_array *tr);
 void trace_array_put(struct trace_array *tr);
 struct trace_array *trace_array_get_by_name(const char *name);
-- 
2.27.0



[PATCH] usb: musb: add printf attribute to log function

2020-12-21 Thread trix
From: Tom Rix 

Attributing the function allows the compiler to more thoroughly
check the use of the function with -Wformat and similar flags.

Signed-off-by: Tom Rix 
---
 drivers/usb/musb/musb_debug.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/musb/musb_debug.h b/drivers/usb/musb/musb_debug.h
index e5b3506c7b3f..dfc0d02695fa 100644
--- a/drivers/usb/musb/musb_debug.h
+++ b/drivers/usb/musb/musb_debug.h
@@ -17,6 +17,7 @@
 #define INFO(fmt, args...) yprintk(KERN_INFO, fmt, ## args)
 #define ERR(fmt, args...) yprintk(KERN_ERR, fmt, ## args)
 
+__printf(2, 3)
 void musb_dbg(struct musb *musb, const char *fmt, ...);
 
 #ifdef CONFIG_DEBUG_FS
-- 
2.27.0



[PATCH] scsi: qedi: add printf attribute to log function

2020-12-21 Thread trix
From: Tom Rix 

Attributing the function allows the compiler to more thoroughly
check the use of the function with -Wformat and similar flags.

Signed-off-by: Tom Rix 
---
 drivers/scsi/qedi/qedi_dbg.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qedi/qedi_dbg.h b/drivers/scsi/qedi/qedi_dbg.h
index 37d084086fd4..b2c9b0a2db6a 100644
--- a/drivers/scsi/qedi/qedi_dbg.h
+++ b/drivers/scsi/qedi/qedi_dbg.h
@@ -78,13 +78,16 @@ struct qedi_dbg_ctx {
 #define QEDI_INFO(pdev, level, fmt, ...)   \
qedi_dbg_info(pdev, __func__, __LINE__, level, fmt, \
  ## __VA_ARGS__)
-
+__printf(4, 5)
 void qedi_dbg_err(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
  const char *fmt, ...);
+__printf(4, 5)
 void qedi_dbg_warn(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
   const char *fmt, ...);
+__printf(4, 5)
 void qedi_dbg_notice(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
 const char *fmt, ...);
+__printf(5, 6)
 void qedi_dbg_info(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
   u32 info, const char *fmt, ...);
 
-- 
2.27.0



[PATCH] [SCSI] BusLogic: add printf attribute to log function

2020-12-21 Thread trix
From: Tom Rix 

Attributing the function allows the compiler to more thoroughly
check the use of the function with -Wformat and similar flags.

Signed-off-by: Tom Rix 
---
 drivers/scsi/BusLogic.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/BusLogic.h b/drivers/scsi/BusLogic.h
index 6182cc8a0344..b701fc8ba789 100644
--- a/drivers/scsi/BusLogic.h
+++ b/drivers/scsi/BusLogic.h
@@ -1289,6 +1289,7 @@ static int blogic_slaveconfig(struct scsi_device *);
 static void blogic_qcompleted_ccb(struct blogic_ccb *);
 static irqreturn_t blogic_inthandler(int, void *);
 static int blogic_resetadapter(struct blogic_adapter *, bool hard_reset);
+__printf(2, 4)
 static void blogic_msg(enum blogic_msglevel, char *, struct blogic_adapter *, 
...);
 static int __init blogic_setup(char *);
 
-- 
2.27.0



[PATCH] PNP: add printf attribute to log function

2020-12-21 Thread trix
From: Tom Rix 

Attributing the function allows the compiler to more thoroughly
check the use of the function with -Wformat and similar flags.

Signed-off-by: Tom Rix 
---
 drivers/pnp/interface.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index 187e4a1175b0..602c46893e83 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -33,6 +33,7 @@ struct pnp_info_buffer {
 
 typedef struct pnp_info_buffer pnp_info_buffer_t;
 
+__printf(2, 3)
 static int pnp_printf(pnp_info_buffer_t * buffer, char *fmt, ...)
 {
va_list args;
-- 
2.27.0



[PATCH] Input: add printf attribute to log function

2020-12-21 Thread trix
From: Tom Rix 

Attributing the function allows the compiler to more thoroughly
check the use of the function with -Wformat and similar flags.

Signed-off-by: Tom Rix 
---
 drivers/input/rmi4/rmi_bus.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/rmi4/rmi_bus.h b/drivers/input/rmi4/rmi_bus.h
index 25df6320f9f1..62a93d7d98f8 100644
--- a/drivers/input/rmi4/rmi_bus.h
+++ b/drivers/input/rmi4/rmi_bus.h
@@ -195,5 +195,6 @@ int rmi_of_property_read_u32(struct device *dev, u32 
*result,
 #define RMI_DEBUG_FN   BIT(2)
 #define RMI_DEBUG_2D_SENSORBIT(3)
 
+__printf(3, 4)
 void rmi_dbg(int flags, struct device *dev, const char *fmt, ...);
 #endif
-- 
2.27.0



[PATCH] x86/resctrl: add printf attribute to log function

2020-12-21 Thread trix
From: Tom Rix 

Attributing the function allows the compiler to more thoroughly
check the use of the function with -Wformat and similar flags.

Signed-off-by: Tom Rix 
---
 arch/x86/kernel/cpu/resctrl/internal.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/resctrl/internal.h 
b/arch/x86/kernel/cpu/resctrl/internal.h
index ee71c47844cb..c4d320d02fd5 100644
--- a/arch/x86/kernel/cpu/resctrl/internal.h
+++ b/arch/x86/kernel/cpu/resctrl/internal.h
@@ -572,6 +572,7 @@ union cpuid_0x10_x_edx {
 
 void rdt_last_cmd_clear(void);
 void rdt_last_cmd_puts(const char *s);
+__printf(1, 2)
 void rdt_last_cmd_printf(const char *fmt, ...);
 
 void rdt_ctrl_update(void *arg);
-- 
2.27.0



[PATCH] [media] radio-si470x: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.

commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/media/radio/si470x/radio-si470x-i2c.c | 2 +-
 drivers/media/radio/si470x/radio-si470x-usb.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c 
b/drivers/media/radio/si470x/radio-si470x-i2c.c
index f491420d7b53..6a25c29d5d4d 100644
--- a/drivers/media/radio/si470x/radio-si470x-i2c.c
+++ b/drivers/media/radio/si470x/radio-si470x-i2c.c
@@ -410,7 +410,7 @@ static int si470x_i2c_probe(struct i2c_client *client)
radio->registers[DEVICEID], 
radio->registers[SI_CHIPID]);
if ((radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE) < 
RADIO_FW_VERSION) {
dev_warn(>dev,
-   "This driver is known to work with firmware version 
%hu,\n",
+   "This driver is known to work with firmware version 
%u,\n",
RADIO_FW_VERSION);
dev_warn(>dev,
"but the device has firmware version %hu.\n",
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c 
b/drivers/media/radio/si470x/radio-si470x-usb.c
index fedff68d8c49..ce0709aae4a0 100644
--- a/drivers/media/radio/si470x/radio-si470x-usb.c
+++ b/drivers/media/radio/si470x/radio-si470x-usb.c
@@ -681,7 +681,7 @@ static int si470x_usb_driver_probe(struct usb_interface 
*intf,
radio->registers[DEVICEID], 
radio->registers[SI_CHIPID]);
if ((radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE) < 
RADIO_FW_VERSION) {
dev_warn(>dev,
-   "This driver is known to work with firmware version 
%hu,\n",
+   "This driver is known to work with firmware version 
%u,\n",
RADIO_FW_VERSION);
dev_warn(>dev,
"but the device has firmware version %hu.\n",
@@ -698,7 +698,7 @@ static int si470x_usb_driver_probe(struct usb_interface 
*intf,
radio->software_version, radio->hardware_version);
if (radio->hardware_version < RADIO_HW_VERSION) {
dev_warn(>dev,
-   "This driver is known to work with hardware version 
%hu,\n",
+   "This driver is known to work with hardware version 
%u,\n",
RADIO_HW_VERSION);
dev_warn(>dev,
"but the device has hardware version %hu.\n",
-- 
2.27.0



[PATCH] dm dust: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.

commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/md/dm-dust.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-dust.c b/drivers/md/dm-dust.c
index 072ea913cebc..cbe1058ee589 100644
--- a/drivers/md/dm-dust.c
+++ b/drivers/md/dm-dust.c
@@ -130,7 +130,7 @@ static int dust_add_block(struct dust_device *dd, unsigned 
long long block,
 
dd->badblock_count++;
if (!dd->quiet_mode) {
-   DMINFO("%s: badblock added at block %llu with write fail count 
%hhu",
+   DMINFO("%s: badblock added at block %llu with write fail count 
%u",
   __func__, block, wr_fail_cnt);
}
spin_unlock_irqrestore(>dust_lock, flags);
-- 
2.27.0



[PATCH] iommu/amd: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.

commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary 
%h[xudi] and %hh[xudi]")

Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi].

Signed-off-by: Tom Rix 
---
 drivers/iommu/amd/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 5ff5687a87c7..eb17fb4ba67c 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -1883,7 +1883,7 @@ static void print_iommu_info(void)
struct pci_dev *pdev = iommu->dev;
int i;
 
-   pci_info(pdev, "Found IOMMU cap 0x%hx\n", iommu->cap_ptr);
+   pci_info(pdev, "Found IOMMU cap 0x%x\n", iommu->cap_ptr);
 
if (iommu->cap & (1 << IOMMU_CAP_EFR)) {
pci_info(pdev, "Extended features (%#llx):",
-- 
2.27.0



[PATCH] IB/hfi1: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/infiniband/hw/hfi1/sdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hfi1/sdma.c 
b/drivers/infiniband/hw/hfi1/sdma.c
index a307d4c8b15a..27ec2851160a 100644
--- a/drivers/infiniband/hw/hfi1/sdma.c
+++ b/drivers/infiniband/hw/hfi1/sdma.c
@@ -1740,7 +1740,7 @@ static inline u16 sdma_gethead(struct sdma_engine *sde)
sane = (hwhead == swhead);
 
if (unlikely(!sane)) {
-   dd_dev_err(dd, "SDMA(%u) bad head (%s) hwhd=%hu 
swhd=%hu swtl=%hu cnt=%hu\n",
+   dd_dev_err(dd, "SDMA(%u) bad head (%s) hwhd=%u swhd=%u 
swtl=%u cnt=%u\n",
   sde->this_idx,
   use_dmahead ? "dma" : "kreg",
   hwhead, swhead, swtail, cnt);
-- 
2.27.0



[PATCH] i2c: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/i2c/i2c-smbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
index d3d06e3b4f3b..5cd2cf84659e 100644
--- a/drivers/i2c/i2c-smbus.c
+++ b/drivers/i2c/i2c-smbus.c
@@ -396,7 +396,7 @@ void i2c_register_spd(struct i2c_adapter *adap)
 
if (!IS_ERR(i2c_new_scanned_device(adap, , addr_list, 
NULL))) {
dev_info(>dev,
-"Successfully instantiated SPD at 0x%hx\n",
+"Successfully instantiated SPD at 0x%x\n",
 addr_list[0]);
dimm_count--;
}
-- 
2.27.0



[PATCH] hwmon: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/hwmon/smsc47m1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
index b637836b58a1..37531b5c8254 100644
--- a/drivers/hwmon/smsc47m1.c
+++ b/drivers/hwmon/smsc47m1.c
@@ -682,7 +682,7 @@ static int __init smsc47m1_handle_resources(unsigned short 
address,
/* Request the resources */
if (!devm_request_region(dev, start, len, DRVNAME)) {
dev_err(dev,
-   "Region 0x%hx-0x%hx already in use!\n",
+   "Region 0x%x-0x%x already in use!\n",
start, start + len);
return -EBUSY;
}
-- 
2.27.0



[PATCH] HID: wiimote: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/hid/hid-wiimote-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c
index 41012681cafd..4399d6c6afef 100644
--- a/drivers/hid/hid-wiimote-core.c
+++ b/drivers/hid/hid-wiimote-core.c
@@ -1482,7 +1482,7 @@ static void handler_return(struct wiimote_data *wdata, 
const __u8 *payload)
wdata->state.cmd_err = err;
wiimote_cmd_complete(wdata);
} else if (err) {
-   hid_warn(wdata->hdev, "Remote error %hhu on req %hhu\n", err,
+   hid_warn(wdata->hdev, "Remote error %u on req %u\n", err,
cmd);
}
 }
-- 
2.27.0



[PATCH] HID: uclogic: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/hid/hid-uclogic-params.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
index d26d8cd98efc..56406cee401f 100644
--- a/drivers/hid/hid-uclogic-params.c
+++ b/drivers/hid/hid-uclogic-params.c
@@ -90,7 +90,7 @@ static int uclogic_params_get_str_desc(__u8 **pbuf, struct 
hid_device *hdev,
goto cleanup;
} else if (rc < 0) {
hid_err(hdev,
-   "failed retrieving string descriptor #%hhu: %d\n",
+   "failed retrieving string descriptor #%u: %d\n",
idx, rc);
goto cleanup;
}
-- 
2.27.0



[PATCH] greybus: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/greybus/greybus_trace.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/greybus/greybus_trace.h b/drivers/greybus/greybus_trace.h
index 1bc9f1275c65..616a3bd61aa6 100644
--- a/drivers/greybus/greybus_trace.h
+++ b/drivers/greybus/greybus_trace.h
@@ -40,7 +40,7 @@ DECLARE_EVENT_CLASS(gb_message,
__entry->result = message->header->result;
),
 
-   TP_printk("size=%hu operation_id=0x%04x type=0x%02x result=0x%02x",
+   TP_printk("size=%u operation_id=0x%04x type=0x%02x result=0x%02x",
  __entry->size, __entry->operation_id,
  __entry->type, __entry->result)
 );
@@ -317,7 +317,7 @@ DECLARE_EVENT_CLASS(gb_interface,
__entry->mode_switch = intf->mode_switch;
),
 
-   TP_printk("intf_id=%hhu device_id=%hhu module_id=%hhu D=%d J=%d A=%d 
E=%d M=%d",
+   TP_printk("intf_id=%u device_id=%u module_id=%u D=%d J=%d A=%d E=%d 
M=%d",
__entry->id, __entry->device_id, __entry->module_id,
__entry->disconnected, __entry->ejected, __entry->active,
__entry->enabled, __entry->mode_switch)
@@ -391,7 +391,7 @@ DECLARE_EVENT_CLASS(gb_module,
__entry->disconnected = module->disconnected;
),
 
-   TP_printk("hd_bus_id=%d module_id=%hhu num_interfaces=%zu 
disconnected=%d",
+   TP_printk("hd_bus_id=%d module_id=%u num_interfaces=%zu 
disconnected=%d",
__entry->hd_bus_id, __entry->module_id,
__entry->num_interfaces, __entry->disconnected)
 );
-- 
2.27.0



[PATCH] drm/radeon: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/gpu/drm/radeon/radeon_uvd.c | 2 +-
 drivers/gpu/drm/radeon/radeon_vce.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c 
b/drivers/gpu/drm/radeon/radeon_uvd.c
index 57fb3eb3a4b4..39c1c339be7b 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -155,7 +155,7 @@ int radeon_uvd_init(struct radeon_device *rdev)
family_id = le32_to_cpu(hdr->ucode_version) & 0xff;
version_major = (le32_to_cpu(hdr->ucode_version) >> 24) 
& 0xff;
version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) 
& 0xff;
-   DRM_INFO("Found UVD firmware Version: %hu.%hu Family 
ID: %hu\n",
+   DRM_INFO("Found UVD firmware Version: %u.%u Family ID: 
%u\n",
 version_major, version_minor, family_id);
 
/*
diff --git a/drivers/gpu/drm/radeon/radeon_vce.c 
b/drivers/gpu/drm/radeon/radeon_vce.c
index 5e8006444704..a450497368b2 100644
--- a/drivers/gpu/drm/radeon/radeon_vce.c
+++ b/drivers/gpu/drm/radeon/radeon_vce.c
@@ -122,7 +122,7 @@ int radeon_vce_init(struct radeon_device *rdev)
if (sscanf(c, "%2u]", >vce.fb_version) != 1)
return -EINVAL;
 
-   DRM_INFO("Found VCE firmware/feedback version %hhd.%hhd.%hhd / %d!\n",
+   DRM_INFO("Found VCE firmware/feedback version %d.%d.%d / %d!\n",
 start, mid, end, rdev->vce.fb_version);
 
rdev->vce.fw_version = (start << 24) | (mid << 16) | (end << 8);
-- 
2.27.0



[PATCH] drm/amdgpu: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index 7c5b60e53482..8b989670ed66 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -240,7 +240,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)
 
version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff;
version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff;
-   DRM_INFO("Found UVD firmware Version: %hu.%hu Family ID: %hu\n",
+   DRM_INFO("Found UVD firmware Version: %u.%u Family ID: %u\n",
version_major, version_minor, family_id);
 
/*
@@ -267,7 +267,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)
dec_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff;
enc_minor = (le32_to_cpu(hdr->ucode_version) >> 24) & 0x3f;
enc_major = (le32_to_cpu(hdr->ucode_version) >> 30) & 0x3;
-   DRM_INFO("Found UVD firmware ENC: %hu.%hu DEC: .%hu Family ID: 
%hu\n",
+   DRM_INFO("Found UVD firmware ENC: %u.%u DEC: .%u Family ID: 
%u\n",
enc_major, enc_minor, dec_minor, family_id);
 
adev->uvd.max_handles = AMDGPU_MAX_UVD_HANDLES;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
index 4861f8ddc1b5..ea6a62f67e38 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
@@ -179,7 +179,7 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned 
long size)
version_major = (ucode_version >> 20) & 0xfff;
version_minor = (ucode_version >> 8) & 0xfff;
binary_id = ucode_version & 0xff;
-   DRM_INFO("Found VCE firmware Version: %hhd.%hhd Binary ID: %hhd\n",
+   DRM_INFO("Found VCE firmware Version: %d.%d Binary ID: %d\n",
version_major, version_minor, binary_id);
adev->vce.fw_version = ((version_major << 24) | (version_minor << 16) |
(binary_id << 8));
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 1e756186e3f8..99b82f3c2617 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -181,7 +181,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
enc_major = fw_check;
dec_ver = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xf;
vep = (le32_to_cpu(hdr->ucode_version) >> 28) & 0xf;
-   DRM_INFO("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: 
%hu Revision: %hu\n",
+   DRM_INFO("Found VCN firmware Version ENC: %u.%u DEC: %u VEP: %u 
Revision: %u\n",
enc_major, enc_minor, dec_ver, vep, fw_rev);
} else {
unsigned int version_major, version_minor, family_id;
@@ -189,7 +189,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
family_id = le32_to_cpu(hdr->ucode_version) & 0xff;
version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff;
version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff;
-   DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n",
+   DRM_INFO("Found VCN firmware Version: %u.%u Family ID: %u\n",
version_major, version_minor, family_id);
}
 
-- 
2.27.0



[PATCH] drm/i915: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/gpu/drm/i915/gt/intel_sseu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_sseu.c 
b/drivers/gpu/drm/i915/gt/intel_sseu.c
index 8a72e0fe34ca..80be9e818a6b 100644
--- a/drivers/gpu/drm/i915/gt/intel_sseu.c
+++ b/drivers/gpu/drm/i915/gt/intel_sseu.c
@@ -755,7 +755,7 @@ void intel_sseu_print_topology(const struct sseu_dev_info 
*sseu,
for (ss = 0; ss < sseu->max_subslices; ss++) {
u16 enabled_eus = sseu_get_eus(sseu, s, ss);
 
-   drm_printf(p, "\tsubslice%d: %u EUs (0x%hx)\n",
+   drm_printf(p, "\tsubslice%d: %u EUs (0x%x)\n",
   ss, hweight16(enabled_eus), enabled_eus);
}
}
-- 
2.27.0



[PATCH] atm: horizon: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/atm/horizon.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
index 4f2951cbe69c..e110c305fc9c 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
@@ -1609,7 +1609,7 @@ static int hrz_send (struct atm_vcc * atm_vcc, struct 
sk_buff * skb) {
 if (*s++ == 'D') {
for (i = 0; i < 4; ++i)
d = (d << 4) | hex_to_bin(*s++);
-  PRINTK (KERN_INFO, "debug bitmap is now %hx", debug = d);
+  PRINTK (KERN_INFO, "debug bitmap is now %x", debug = d);
 }
   }
 #endif
@@ -2675,7 +2675,7 @@ static int hrz_probe(struct pci_dev *pci_dev,
   "changing", lat, pci_lat);
pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, pci_lat);
} else if (lat < MIN_PCI_LATENCY) {
-   PRINTK(KERN_INFO, "%s PCI latency timer from %hu to %hu",
+   PRINTK(KERN_INFO, "%s PCI latency timer from %u to %u",
   "increasing", lat, MIN_PCI_LATENCY);
pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, 
MIN_PCI_LATENCY);
}
@@ -2777,7 +2777,7 @@ static void hrz_remove_one(struct pci_dev *pci_dev)
 
 static void __init hrz_check_args (void) {
 #ifdef DEBUG_HORIZON
-  PRINTK (KERN_NOTICE, "debug bitmap is %hx", debug &= DBG_MASK);
+  PRINTK (KERN_NOTICE, "debug bitmap is %x", debug &= DBG_MASK);
 #else
   if (debug)
 PRINTK (KERN_NOTICE, "no debug support in this image");
-- 
2.27.0



[PATCH] atm: ambassador: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 drivers/atm/ambassador.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index c039b8a4fefe..6b0fff8c0141 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -2169,7 +2169,7 @@ static void setup_pci_dev(struct pci_dev *pci_dev)
pci_lat = (lat < MIN_PCI_LATENCY) ? MIN_PCI_LATENCY : lat;
 
if (lat != pci_lat) {
-   PRINTK (KERN_INFO, "Changing PCI latency timer from %hu to %hu",
+   PRINTK (KERN_INFO, "Changing PCI latency timer from %u to %u",
lat, pci_lat);
pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, pci_lat);
}
@@ -2300,7 +2300,7 @@ static void __init amb_check_args (void) {
   unsigned int max_rx_size;
   
 #ifdef DEBUG_AMBASSADOR
-  PRINTK (KERN_NOTICE, "debug bitmap is %hx", debug &= DBG_MASK);
+  PRINTK (KERN_NOTICE, "debug bitmap is %x", debug &= DBG_MASK);
 #else
   if (debug)
 PRINTK (KERN_NOTICE, "no debugging support");
-- 
2.27.0



[PATCH] block: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 block/blk-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 7663a9b94b80..7c839e396f24 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1181,7 +1181,7 @@ static blk_status_t blk_cloned_rq_check_limits(struct 
request_queue *q,
 */
rq->nr_phys_segments = blk_recalc_rq_segments(rq);
if (rq->nr_phys_segments > queue_max_segments(q)) {
-   printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
+   printk(KERN_ERR "%s: over max segments limit. (%u > %u)\n",
__func__, rq->nr_phys_segments, queue_max_segments(q));
return BLK_STS_IOERR;
}
-- 
2.27.0



[PATCH] mm: remove h from printk format specifier

2020-12-15 Thread trix
From: Tom Rix 

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Signed-off-by: Tom Rix 
---
 arch/x86/mm/fault.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 907b54d3b990..4bc4c9a6a8ae 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -486,13 +486,13 @@ static void show_ldttss(const struct desc_ptr *gdt, const 
char *name, u16 index)
}
 
if (offset + sizeof(struct ldttss_desc) >= gdt->size) {
-   pr_alert("%s: 0x%hx -- out of bounds\n", name, index);
+   pr_alert("%s: 0x%x -- out of bounds\n", name, index);
return;
}
 
if (copy_from_kernel_nofault(, (void *)(gdt->address + offset),
  sizeof(struct ldttss_desc))) {
-   pr_alert("%s: 0x%hx -- GDT entry is not readable\n",
+   pr_alert("%s: 0x%x -- GDT entry is not readable\n",
 name, index);
return;
}
@@ -501,7 +501,7 @@ static void show_ldttss(const struct desc_ptr *gdt, const 
char *name, u16 index)
 #ifdef CONFIG_X86_64
addr |= ((u64)desc.base3 << 32);
 #endif
-   pr_alert("%s: 0x%hx -- base=0x%lx limit=0x%x\n",
+   pr_alert("%s: 0x%x -- base=0x%lx limit=0x%x\n",
 name, index, addr, (desc.limit0 | (desc.limit1 << 16)));
 }
 
@@ -569,7 +569,7 @@ show_fault_oops(struct pt_regs *regs, unsigned long 
error_code, unsigned long ad
/* Usable even on Xen PV -- it's just slow. */
native_store_gdt();
 
-   pr_alert("IDT: 0x%lx (limit=0x%hx) GDT: 0x%lx (limit=0x%hx)\n",
+   pr_alert("IDT: 0x%lx (limit=0x%x) GDT: 0x%lx (limit=0x%x)\n",
 idt.address, idt.size, gdt.address, gdt.size);
 
store_ldt(ldtr);
-- 
2.27.0



[RFC] fpga: dfl: a prototype uio driver

2020-12-06 Thread trix
From: Tom Rix 

>From [PATCH 0/2] UIO support for dfl devices
https://lore.kernel.org/linux-fpga/1602828151-24784-1-git-send-email-yilun...@intel.com/

Here is an idea to have uio support with no driver override.

This makes UIO the primary driver interface because every feature
will have one and makes the existing platform driver interface
secondary.  There will be a new burden for locking write access when
they compete.

Example shows finding the fpga's temperture.

Signed-off-by: Tom Rix 
---
 drivers/fpga/dfl-fme-main.c |  9 +++-
 drivers/fpga/dfl-uio.c  | 96 +
 drivers/fpga/dfl.c  | 44 -
 drivers/fpga/dfl.h  |  9 
 uio.c   | 56 ++
 5 files changed, 212 insertions(+), 2 deletions(-)
 create mode 100644 drivers/fpga/dfl-uio.c
 create mode 100644 uio.c

diff --git a/drivers/fpga/dfl-fme-main.c b/drivers/fpga/dfl-fme-main.c
index 037dc4f946f0..3323e90a18c4 100644
--- a/drivers/fpga/dfl-fme-main.c
+++ b/drivers/fpga/dfl-fme-main.c
@@ -709,12 +709,18 @@ static int fme_probe(struct platform_device *pdev)
if (ret)
goto dev_destroy;
 
-   ret = dfl_fpga_dev_ops_register(pdev, _fops, THIS_MODULE);
+   ret = dfl_fpga_dev_feature_init_uio(pdev, DFH_TYPE_FIU);
if (ret)
goto feature_uinit;
 
+   ret = dfl_fpga_dev_ops_register(pdev, _fops, THIS_MODULE);
+   if (ret)
+   goto feature_uinit_uio;
+
return 0;
 
+feature_uinit_uio:
+   dfl_fpga_dev_feature_uinit_uio(pdev, DFH_TYPE_FIU);
 feature_uinit:
dfl_fpga_dev_feature_uinit(pdev);
 dev_destroy:
@@ -726,6 +732,7 @@ exit:
 static int fme_remove(struct platform_device *pdev)
 {
dfl_fpga_dev_ops_unregister(pdev);
+   dfl_fpga_dev_feature_uinit_uio(pdev, DFH_TYPE_FIU);
dfl_fpga_dev_feature_uinit(pdev);
fme_dev_destroy(pdev);
 
diff --git a/drivers/fpga/dfl-uio.c b/drivers/fpga/dfl-uio.c
new file mode 100644
index ..7610ee0b19dc
--- /dev/null
+++ b/drivers/fpga/dfl-uio.c
@@ -0,0 +1,96 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * prototype dfl uio driver
+ *
+ * Copyright Tom Rix 2020
+ */
+#include 
+#include "dfl.h"
+
+static irqreturn_t dfl_uio_handler(int irq, struct uio_info *info)
+{
+   return IRQ_HANDLED;
+}
+
+static int dfl_uio_mmap(struct uio_info *info, struct vm_area_struct *vma)
+{
+   int ret = -ENODEV;
+   return ret;
+}
+
+static int dfl_uio_open(struct uio_info *info, struct inode *inode)
+{
+   int ret = -ENODEV;
+   struct dfl_feature *feature = container_of(info, struct dfl_feature, 
uio);
+   if (feature->dev)
+   mutex_lock(>lock);
+
+   ret = 0;
+   return ret;
+}
+
+static int dfl_uio_release(struct uio_info *info, struct inode *inode)
+{
+   int ret = -ENODEV;
+   struct dfl_feature *feature = container_of(info, struct dfl_feature, 
uio);
+   if (feature->dev)
+   mutex_unlock(>lock);
+
+   ret = 0;
+   return ret;
+}
+
+static int dfl_uio_irqcontrol(struct uio_info *info, s32 irq_on)
+{
+   int ret = -ENODEV;
+   return ret;
+}
+
+int dfl_uio_add(struct dfl_feature *feature)
+{
+   struct uio_info *uio = >uio;
+   struct resource *res =
+   >dev->resource[feature->resource_index];
+   int ret = 0;
+
+   uio->name = kasprintf(GFP_KERNEL, "dfl-uio-%llx", feature->id);
+   if (!uio->name) {
+   ret = -ENOMEM;
+   goto exit;
+   }
+
+   uio->version = "0.1";
+   uio->mem[0].memtype = UIO_MEM_PHYS;
+   uio->mem[0].addr = res->start & PAGE_MASK;
+   uio->mem[0].offs = res->start & ~PAGE_MASK;
+   uio->mem[0].size = (uio->mem[0].offs + resource_size(res)
+   + PAGE_SIZE - 1) & PAGE_MASK;
+   /* How are nr_irqs > 1 handled ??? */
+   if (feature->nr_irqs == 1)
+   uio->irq = feature->irq_ctx[0].irq;
+   uio->handler = dfl_uio_handler;
+   //uio->mmap = dfl_uio_mmap;
+   uio->open = dfl_uio_open;
+   uio->release = dfl_uio_release;
+   uio->irqcontrol = dfl_uio_irqcontrol;
+
+   ret = uio_register_device(>dev->dev, uio);
+   if (ret)
+   goto err_register;
+
+exit:
+   return ret;
+err_register:
+   kfree(uio->name);
+   goto exit;
+}
+EXPORT_SYMBOL_GPL(dfl_uio_add);
+
+int dfl_uio_remove(struct dfl_feature *feature)
+{
+   uio_unregister_device(>uio);
+   kfree(feature->uio.name);
+   return 0;
+}
+EXPORT_SYMBOL_GPL(dfl_uio_remove);
+
diff --git a/drivers/fpga/dfl.c b/drivers/fpga/dfl.c
index 1305be48037d..af2cd3d1b5f6 100644
--- a/drivers/fpga/dfl.c
+++ b/drivers/fpga/dfl.c
@@ -603,6 +603,7 @@ static int dfl_feature_instance_init(struct platform_device 
*pdev,
}
 
feature->ops = drv->ops;
+   mutex_init(>lock);
 
return ret;
 }
@@ -663,10 +664,51 @@ exit:
 }
 EXPORT_SYMBOL_GPL(dfl_fpga_dev_feature_init);

[PATCH v2] bpf: remove trailing semicolon in macro definition

2020-12-02 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.
Clean up escaped newlines

Signed-off-by: Tom Rix 
---
v2: more macros fixed, escaped newlines cleaned
---
 include/trace/events/xdp.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h
index cd24e8a59529..76a97176ab81 100644
--- a/include/trace/events/xdp.h
+++ b/include/trace/events/xdp.h
@@ -145,17 +145,17 @@ DEFINE_EVENT(xdp_redirect_template, xdp_redirect_err,
TP_ARGS(dev, xdp, tgt, err, map, index)
 );
 
-#define _trace_xdp_redirect(dev, xdp, to)  \
-trace_xdp_redirect(dev, xdp, NULL, 0, NULL, to);
+#define _trace_xdp_redirect(dev, xdp, to)  \
+trace_xdp_redirect(dev, xdp, NULL, 0, NULL, to)
 
-#define _trace_xdp_redirect_err(dev, xdp, to, err) \
-trace_xdp_redirect_err(dev, xdp, NULL, err, NULL, to);
+#define _trace_xdp_redirect_err(dev, xdp, to, err) \
+trace_xdp_redirect_err(dev, xdp, NULL, err, NULL, to)
 
 #define _trace_xdp_redirect_map(dev, xdp, to, map, index)  \
-trace_xdp_redirect(dev, xdp, to, 0, map, index);
+trace_xdp_redirect(dev, xdp, to, 0, map, index)
 
 #define _trace_xdp_redirect_map_err(dev, xdp, to, map, index, err) \
-trace_xdp_redirect_err(dev, xdp, to, err, map, index);
+trace_xdp_redirect_err(dev, xdp, to, err, map, index)
 
 /* not used anymore, but kept around so as not to break old programs */
 DEFINE_EVENT(xdp_redirect_template, xdp_redirect_map,
-- 
2.18.4



[PATCH v2] net: bna: remove trailing semicolon in macro definition

2020-12-02 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.
Clean up escaped newlines.

Signed-off-by: Tom Rix 
---
v2: fix other macros, cleanup newlines
---
 drivers/net/ethernet/brocade/bna/bna_hw_defs.h | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/brocade/bna/bna_hw_defs.h 
b/drivers/net/ethernet/brocade/bna/bna_hw_defs.h
index f335b7115c1b..dc34e38f97c7 100644
--- a/drivers/net/ethernet/brocade/bna/bna_hw_defs.h
+++ b/drivers/net/ethernet/brocade/bna/bna_hw_defs.h
@@ -218,17 +218,17 @@ do {  
\
 
 /* Set the coalescing timer for the given ib */
 #define bna_ib_coalescing_timer_set(_i_dbell, _cls_timer)  \
-   ((_i_dbell)->doorbell_ack = BNA_DOORBELL_IB_INT_ACK((_cls_timer), 0));
+   ((_i_dbell)->doorbell_ack = BNA_DOORBELL_IB_INT_ACK((_cls_timer), 0))
 
 /* Acks 'events' # of events for a given ib while disabling interrupts */
 #define bna_ib_ack_disable_irq(_i_dbell, _events)  \
-   (writel(BNA_DOORBELL_IB_INT_ACK(0, (_events)), \
-   (_i_dbell)->doorbell_addr));
+   (writel(BNA_DOORBELL_IB_INT_ACK(0, (_events)),  \
+   (_i_dbell)->doorbell_addr))
 
 /* Acks 'events' # of events for a given ib */
 #define bna_ib_ack(_i_dbell, _events)  \
-   (writel(((_i_dbell)->doorbell_ack | (_events)), \
-   (_i_dbell)->doorbell_addr));
+   (writel(((_i_dbell)->doorbell_ack | (_events)), \
+   (_i_dbell)->doorbell_addr))
 
 #define bna_ib_start(_bna, _ib, _is_regular)   \
 {  \
@@ -259,12 +259,12 @@ do {  
\
 }
 
 #define bna_txq_prod_indx_doorbell(_tcb)   \
-   (writel(BNA_DOORBELL_Q_PRD_IDX((_tcb)->producer_index), \
-   (_tcb)->q_dbell));
+   (writel(BNA_DOORBELL_Q_PRD_IDX((_tcb)->producer_index), \
+   (_tcb)->q_dbell))
 
 #define bna_rxq_prod_indx_doorbell(_rcb)   \
-   (writel(BNA_DOORBELL_Q_PRD_IDX((_rcb)->producer_index), \
-   (_rcb)->q_dbell));
+   (writel(BNA_DOORBELL_Q_PRD_IDX((_rcb)->producer_index), \
+   (_rcb)->q_dbell))
 
 /* TxQ, RxQ, CQ related bits, offsets, macros */
 
-- 
2.18.4



[PATCH v2] scsi: qla2xxx: remove trailing semicolon in macro definition

2020-11-30 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.
Remove unneeded escaped newline.

Signed-off-by: Tom Rix 
---
v2: remove unneeded escaped newline
---
 drivers/scsi/qla2xxx/qla_def.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index ed9b10f8537d..6248e528efe5 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -4970,8 +4970,7 @@ struct secure_flash_update_block_pk {
 } while (0)
 
 #define QLA_QPAIR_MARK_NOT_BUSY(__qpair)   \
-   atomic_dec(&__qpair->ref_count);\
-
+   atomic_dec(&__qpair->ref_count)
 
 #define QLA_ENA_CONF(_ha) {\
 int i;\
-- 
2.18.4



[PATCH] mac80211: remove trailing semicolon in macro definition

2020-11-28 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 net/mac80211/debugfs.c| 2 +-
 net/mac80211/debugfs_key.c| 2 +-
 net/mac80211/debugfs_netdev.c | 6 +++---
 net/mac80211/debugfs_sta.c| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 90470392fdaa..48f144f107d5 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -53,7 +53,7 @@ static const struct file_operations name## _ops = {   
\
DEBUGFS_READONLY_FILE_OPS(name)
 
 #define DEBUGFS_ADD(name)  \
-   debugfs_create_file(#name, 0400, phyd, local, ## _ops);
+   debugfs_create_file(#name, 0400, phyd, local, ## _ops)
 
 #define DEBUGFS_ADD_MODE(name, mode)   \
debugfs_create_file(#name, mode, phyd, local, ## _ops);
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index 98a713475e0f..f53dec8a3d5c 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -319,7 +319,7 @@ KEY_OPS(key);
 
 #define DEBUGFS_ADD(name) \
debugfs_create_file(#name, 0400, key->debugfs.dir, \
-   key, _##name##_ops);
+   key, _##name##_ops)
 #define DEBUGFS_ADD_W(name) \
debugfs_create_file(#name, 0600, key->debugfs.dir, \
key, _##name##_ops);
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 9fc8ce214322..0ad3860852ff 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -642,7 +642,7 @@ IEEE80211_IF_FILE(dot11MeshConnectedToAuthServer,
 
 #define DEBUGFS_ADD_MODE(name, mode) \
debugfs_create_file(#name, mode, sdata->vif.debugfs_dir, \
-   sdata, ##_ops);
+   sdata, ##_ops)
 
 #define DEBUGFS_ADD(name) DEBUGFS_ADD_MODE(name, 0400)
 
@@ -711,7 +711,7 @@ static void add_mesh_stats(struct ieee80211_sub_if_data 
*sdata)
struct dentry *dir = debugfs_create_dir("mesh_stats",
sdata->vif.debugfs_dir);
 #define MESHSTATS_ADD(name)\
-   debugfs_create_file(#name, 0400, dir, sdata, ##_ops);
+   debugfs_create_file(#name, 0400, dir, sdata, ##_ops)
 
MESHSTATS_ADD(fwded_mcast);
MESHSTATS_ADD(fwded_unicast);
@@ -728,7 +728,7 @@ static void add_mesh_config(struct ieee80211_sub_if_data 
*sdata)
sdata->vif.debugfs_dir);
 
 #define MESHPARAMS_ADD(name) \
-   debugfs_create_file(#name, 0600, dir, sdata, ##_ops);
+   debugfs_create_file(#name, 0600, dir, sdata, ##_ops)
 
MESHPARAMS_ADD(dot11MeshMaxRetries);
MESHPARAMS_ADD(dot11MeshRetryTimeout);
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 6a51b8b58f9e..eb4bb79d936a 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -985,7 +985,7 @@ STA_OPS(he_capa);
 
 #define DEBUGFS_ADD(name) \
debugfs_create_file(#name, 0400, \
-   sta->debugfs_dir, sta, _ ##name## _ops);
+   sta->debugfs_dir, sta, _ ##name## _ops)
 
 #define DEBUGFS_ADD_COUNTER(name, field)   \
debugfs_create_ulong(#name, 0400, sta->debugfs_dir, >field);
-- 
2.18.4



[PATCH] NFS: remove trailing semicolon in macro definition

2020-11-28 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 net/sunrpc/auth_gss/gss_generic_token.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/auth_gss/gss_generic_token.c 
b/net/sunrpc/auth_gss/gss_generic_token.c
index fe97f3106536..9ae22d797390 100644
--- a/net/sunrpc/auth_gss/gss_generic_token.c
+++ b/net/sunrpc/auth_gss/gss_generic_token.c
@@ -46,7 +46,7 @@
 /* TWRITE_STR from gssapiP_generic.h */
 #define TWRITE_STR(ptr, str, len) \
memcpy((ptr), (char *) (str), (len)); \
-   (ptr) += (len);
+   (ptr) += (len)
 
 /*  this code currently makes the assumption that a mech oid will
never be longer than 127 bytes.  This assumption is not inherent in
-- 
2.18.4



[PATCH] jffs2: remove trailing semicolon in macro definition

2020-11-28 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 fs/jffs2/nodelist.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h
index 8ff4d1a1e774..2e98fa277dab 100644
--- a/fs/jffs2/nodelist.h
+++ b/fs/jffs2/nodelist.h
@@ -349,14 +349,14 @@ static inline struct jffs2_node_frag *frag_last(struct 
rb_root *root)
 #define frag_parent(frag) rb_entry(rb_parent(&(frag)->rb), struct 
jffs2_node_frag, rb)
 #define frag_left(frag) rb_entry((frag)->rb.rb_left, struct jffs2_node_frag, 
rb)
 #define frag_right(frag) rb_entry((frag)->rb.rb_right, struct jffs2_node_frag, 
rb)
-#define frag_erase(frag, list) rb_erase(>rb, list);
+#define frag_erase(frag, list) rb_erase(>rb, list)
 
 #define tn_next(tn) rb_entry(rb_next(&(tn)->rb), struct jffs2_tmp_dnode_info, 
rb)
 #define tn_prev(tn) rb_entry(rb_prev(&(tn)->rb), struct jffs2_tmp_dnode_info, 
rb)
 #define tn_parent(tn) rb_entry(rb_parent(&(tn)->rb), struct 
jffs2_tmp_dnode_info, rb)
 #define tn_left(tn) rb_entry((tn)->rb.rb_left, struct jffs2_tmp_dnode_info, rb)
 #define tn_right(tn) rb_entry((tn)->rb.rb_right, struct jffs2_tmp_dnode_info, 
rb)
-#define tn_erase(tn, list) rb_erase(>rb, list);
+#define tn_erase(tn, list) rb_erase(>rb, list)
 #define tn_last(list) rb_entry(rb_last(list), struct jffs2_tmp_dnode_info, rb)
 #define tn_first(list) rb_entry(rb_first(list), struct jffs2_tmp_dnode_info, 
rb)
 
-- 
2.18.4



[PATCH] keys: remove trailing semicolon in macro definition

2020-11-28 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 include/linux/key.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/key.h b/include/linux/key.h
index 0f2e24f13c2b..1b0837c975b9 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -360,7 +360,7 @@ static inline struct key *request_key(struct key_type *type,
  * completion of keys undergoing construction with a non-interruptible wait.
  */
 #define request_key_net(type, description, net, callout_info) \
-   request_key_tag(type, description, net->key_domain, callout_info);
+   request_key_tag(type, description, net->key_domain, callout_info)
 
 /**
  * request_key_net_rcu - Request a key for a net namespace under RCU conditions
@@ -372,7 +372,7 @@ static inline struct key *request_key(struct key_type *type,
  * network namespace are used.
  */
 #define request_key_net_rcu(type, description, net) \
-   request_key_rcu(type, description, net->key_domain);
+   request_key_rcu(type, description, net->key_domain)
 #endif /* CONFIG_NET */
 
 extern int wait_for_key_construction(struct key *key, bool intr);
-- 
2.18.4



[PATCH] net: flow_offload: remove trailing semicolon in macro definition

2020-11-28 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 net/core/flow_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c
index d4474c812b64..59ddfd3f3876 100644
--- a/net/core/flow_offload.c
+++ b/net/core/flow_offload.c
@@ -32,7 +32,7 @@ EXPORT_SYMBOL(flow_rule_alloc);
struct flow_dissector *__d = (__m)->dissector;  
\

\
(__out)->key = skb_flow_dissector_target(__d, __type, (__m)->key);  
\
-   (__out)->mask = skb_flow_dissector_target(__d, __type, (__m)->mask);
\
+   (__out)->mask = skb_flow_dissector_target(__d, __type, (__m)->mask) 
\
 
 void flow_rule_match_meta(const struct flow_rule *rule,
  struct flow_match_meta *out)
-- 
2.18.4



[PATCH] locking/selftest: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 lib/locking-selftest.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
index a899b3f0e2e5..69b4a1160094 100644
--- a/lib/locking-selftest.c
+++ b/lib/locking-selftest.c
@@ -935,7 +935,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock)
LOCK(B);\
UNLOCK(B);  \
UNLOCK(A);  \
-   IRQ_ENABLE();
+   IRQ_ENABLE()
 
 #define E2()   \
LOCK(B);\
@@ -995,7 +995,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_wlock)
LOCK(B);\
UNLOCK(B);  \
WU(A);  \
-   IRQ_ENABLE();
+   IRQ_ENABLE()
 
 #define E2()   \
\
@@ -1170,7 +1170,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(W1W2_R2R3_R3W1)
IRQ_DISABLE();  \
WL(A);  \
WU(A);  \
-   IRQ_ENABLE();
+   IRQ_ENABLE()
 
 #define E2()   \
\
@@ -1218,7 +1218,7 @@ 
GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft_wlock)
LOCK(A);\
UNLOCK(A);  \
U(B);   \
-   IRQ_ENABLE();
+   IRQ_ENABLE()
 
 #define E2()   \
\
@@ -1272,7 +1272,7 @@ 
GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion2_soft_wlock)
LOCK(A);\
UNLOCK(A);  \
WU(B);  \
-   IRQ_ENABLE();
+   IRQ_ENABLE()
 
 #define E2()   \
\
-- 
2.18.4



[PATCH] netfilter: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 include/net/netfilter/nf_tables_offload.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/netfilter/nf_tables_offload.h 
b/include/net/netfilter/nf_tables_offload.h
index 1d34fe154fe0..ae8160b62b10 100644
--- a/include/net/netfilter/nf_tables_offload.h
+++ b/include/net/netfilter/nf_tables_offload.h
@@ -81,7 +81,7 @@ int nft_flow_rule_offload_commit(struct net *net);
 
 #define NFT_OFFLOAD_MATCH_EXACT(__key, __base, __field, __len, __reg)  \
NFT_OFFLOAD_MATCH(__key, __base, __field, __len, __reg) \
-   memset(&(__reg)->mask, 0xff, (__reg)->len);
+   memset(&(__reg)->mask, 0xff, (__reg)->len)
 
 int nft_chain_offload_priority(struct nft_base_chain *basechain);
 
-- 
2.18.4



[PATCH] scsi: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 include/scsi/scsi_driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index 6dffa8555a39..f6221c006aa7 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -25,7 +25,7 @@ struct scsi_driver {
 
 extern int scsi_register_driver(struct device_driver *);
 #define scsi_unregister_driver(drv) \
-   driver_unregister(drv);
+   driver_unregister(drv)
 
 extern int scsi_register_interface(struct class_interface *);
 #define scsi_unregister_interface(intf) \
-- 
2.18.4



[PATCH] ALSA: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 include/sound/hda_codec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h
index 73827b7d17e0..2e8d51937acd 100644
--- a/include/sound/hda_codec.h
+++ b/include/sound/hda_codec.h
@@ -344,7 +344,7 @@ snd_hda_get_num_conns(struct hda_codec *codec, hda_nid_t 
nid)
 #define snd_hda_get_raw_connections(codec, nid, list, max_conns) \
snd_hdac_get_connections(&(codec)->core, nid, list, max_conns)
 #define snd_hda_get_num_raw_conns(codec, nid) \
-   snd_hdac_get_connections(&(codec)->core, nid, NULL, 0);
+   snd_hdac_get_connections(&(codec)->core, nid, NULL, 0)
 
 int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid,
  const hda_nid_t **listp);
-- 
2.18.4



[PATCH] MAINTAINERS add D: tag for subsystem commit prefix

2020-11-27 Thread trix
From: Tom Rix 

From
RFC MAINTAINERS tag for cleanup robot
https://lkml.org/lkml/2020/11/21/190

The prefix used by subsystems in their commit log is arbitrary.
To elimitate the time and effort to manually find a reasonable
prefix, store the preferred prefix in the MAINTAINERS file.

Populate with reasonable prefixes using this algorithm.
What did the maintainers use in their commits?
If there were no maintainers commits then what did everyone
else use in their commits.

The results were manually reviewed and about 25% were rejected.

Add 'D' tag to checkpatch.pl

Use 'D' tag by adding --subsystem_commit_prefix option
get_maintainer.pl

Signed-off-by: Tom Rix 
---
 MAINTAINERS   | 200 ++
 scripts/checkpatch.pl |   2 +-
 scripts/get_maintainer.pl |  19 +++-
 3 files changed, 217 insertions(+), 4 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1f2048b51dd3..bb765ef98493 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -135,6 +135,7 @@ Descriptions of section entries and preferred order
  matches patches or files that contain one or more of the words
  printk, pr_info or pr_err
   One regex pattern per line.  Multiple K: lines acceptable.
+   D: Subsystem commit prefix
 
 Maintainers List
 
@@ -149,6 +150,7 @@ L:  net...@vger.kernel.org
 S: Odd Fixes
 F: Documentation/networking/device_drivers/ethernet/3com/vortex.rst
 F: drivers/net/ethernet/3com/3c59x.c
+D: 3c59x:
 
 3CR990 NETWORK DRIVER
 M: David Dillow 
@@ -162,6 +164,7 @@ L:  linux-s...@vger.kernel.org
 S: Supported
 W: http://www.lsi.com
 F: drivers/scsi/3w-*
+D: [SCSI] 3w-9xxx:
 
 53C700 AND 53C700-66 SCSI DRIVER
 M: "James E.J. Bottomley" 
@@ -178,12 +181,14 @@ S:Maintained
 F: Documentation/networking/6lowpan.rst
 F: include/net/6lowpan.h
 F: net/6lowpan/
+D: 6lowpan:
 
 6PACK NETWORK DRIVER FOR AX.25
 M: Andreas Koensgen 
 L: linux-h...@vger.kernel.org
 S: Maintained
 F: drivers/net/hamradio/6pack.c
+D: 6pack:
 
 802.11 (including CFG80211/NL80211)
 M: Johannes Berg 
@@ -208,6 +213,7 @@ M:  Heiner Kallweit 
 L: net...@vger.kernel.org
 S: Maintained
 F: drivers/net/ethernet/realtek/r8169*
+D: r8169:
 
 8250/16?50 (AND CLONE UARTS) SERIAL DRIVER
 M: Greg Kroah-Hartman 
@@ -216,11 +222,13 @@ S:Maintained
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
 F: drivers/tty/serial/8250*
 F: include/linux/serial_8250.h
+D: tty:
 
 8390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
 L: net...@vger.kernel.org
 S: Orphan / Obsolete
 F: drivers/net/ethernet/8390/
+D: drivers/net:
 
 9P FILE SYSTEM
 M: Eric Van Hensbergen 
@@ -238,6 +246,7 @@ F:  include/net/9p/
 F: include/trace/events/9p.h
 F: include/uapi/linux/virtio_9p.h
 F: net/9p/
+D: 9p:
 
 A8293 MEDIA DRIVER
 M: Antti Palosaari 
@@ -248,6 +257,7 @@ W:  http://palosaari.fi/linux/
 Q: http://patchwork.linuxtv.org/project/linux-media/list/
 T: git git://linuxtv.org/anttip/media_tree.git
 F: drivers/media/dvb-frontends/a8293*
+D: [media] a8293:
 
 AACRAID SCSI RAID DRIVER
 M: Adaptec OEM Raid Solutions 
@@ -256,6 +266,7 @@ S:  Supported
 W: http://www.adaptec.com/
 F: Documentation/scsi/aacraid.rst
 F: drivers/scsi/aacraid/
+D: scsi: aacraid:
 
 ABI/API
 L: linux-...@vger.kernel.org
@@ -267,30 +278,35 @@ M:Hans de Goede 
 L: linux-hw...@vger.kernel.org
 S: Maintained
 F: drivers/hwmon/abituguru.c
+D: hwmon:
 
 ABIT UGURU 3 HARDWARE MONITOR DRIVER
 M: Alistair John Strachan 
 L: linux-hw...@vger.kernel.org
 S: Maintained
 F: drivers/hwmon/abituguru3.c
+D: hwmon:
 
 ACCES 104-DIO-48E GPIO DRIVER
 M: William Breathitt Gray 
 L: linux-g...@vger.kernel.org
 S: Maintained
 F: drivers/gpio/gpio-104-dio-48e.c
+D: gpio: 104-dio-48e:
 
 ACCES 104-IDI-48 GPIO DRIVER
 M: "William Breathitt Gray" 
 L: linux-g...@vger.kernel.org
 S: Maintained
 F: drivers/gpio/gpio-104-idi-48.c
+D: gpio: 104-idi-48:
 
 ACCES 104-IDIO-16 GPIO DRIVER
 M: "William Breathitt Gray" 
 L: linux-g...@vger.kernel.org
 S: Maintained
 F: drivers/gpio/gpio-104-idio-16.c
+D: gpio: 104-idio-16:
 
 ACCES 104-QUAD-8 DRIVER
 M: William Breathitt Gray 
@@ -300,18 +316,21 @@ S:Maintained
 F: Documentation/ABI/testing/sysfs-bus-counter-104-quad-8
 F: Documentation/ABI/testing/sysfs-bus-iio-counter-104-quad-8
 F: drivers/counter/104-quad-8.c
+D: counter: 104-quad-8:
 
 ACCES PCI-IDIO-16 GPIO DRIVER
 M: William Breathitt Gray 
 L: linux-g...@vger.kernel.org
 S: Maintained
 F: drivers/gpio/gpio-pci-idio-16.c
+D: gpio: pci-idio-16:
 
 ACCES PCIe-IDIO-24 GPIO DRIVER
 M: William Breathitt Gray 
 L: linux-g...@vger.kernel.org
 S: Maintained
 F:  

[PATCH] bpf: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 include/trace/events/xdp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h
index cd24e8a59529..65ffedf8386f 100644
--- a/include/trace/events/xdp.h
+++ b/include/trace/events/xdp.h
@@ -146,13 +146,13 @@ DEFINE_EVENT(xdp_redirect_template, xdp_redirect_err,
 );
 
 #define _trace_xdp_redirect(dev, xdp, to)  \
-trace_xdp_redirect(dev, xdp, NULL, 0, NULL, to);
+trace_xdp_redirect(dev, xdp, NULL, 0, NULL, to)
 
 #define _trace_xdp_redirect_err(dev, xdp, to, err) \
 trace_xdp_redirect_err(dev, xdp, NULL, err, NULL, to);
 
 #define _trace_xdp_redirect_map(dev, xdp, to, map, index)  \
-trace_xdp_redirect(dev, xdp, to, 0, map, index);
+trace_xdp_redirect(dev, xdp, to, 0, map, index)
 
 #define _trace_xdp_redirect_map_err(dev, xdp, to, map, index, err) \
 trace_xdp_redirect_err(dev, xdp, to, err, map, index);
-- 
2.18.4



[PATCH] omapfb: fbcon: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c | 2 +-
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c 
b/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c
index 3417618310ff..cc2ad787d493 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c
@@ -75,7 +75,7 @@ static void dispc_dump_irqs(struct seq_file *s)
 
seq_printf(s, "irqs %d\n", stats.irq_count);
 #define PIS(x) \
-   seq_printf(s, "%-20s %10d\n", #x, stats.irqs[ffs(DISPC_IRQ_##x)-1]);
+   seq_printf(s, "%-20s %10d\n", #x, stats.irqs[ffs(DISPC_IRQ_##x)-1])
 
PIS(FRAMEDONE);
PIS(VSYNC);
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c 
b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index 6f9c25fec994..101fa66f9b58 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -1554,7 +1554,7 @@ static void dsi_dump_dsidev_irqs(struct platform_device 
*dsidev,
 
seq_printf(s, "irqs %d\n", stats.irq_count);
 #define PIS(x) \
-   seq_printf(s, "%-20s %10d\n", #x, stats.dsi_irqs[ffs(DSI_IRQ_##x)-1]);
+   seq_printf(s, "%-20s %10d\n", #x, stats.dsi_irqs[ffs(DSI_IRQ_##x)-1])
 
seq_printf(s, "-- DSI%d interrupts --\n", dsi->module_id + 1);
PIS(VC0);
-- 
2.18.4



[PATCH] gfs2: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 fs/gfs2/util.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/gfs2/util.h b/fs/gfs2/util.h
index d7562981b3a0..493020393ceb 100644
--- a/fs/gfs2/util.h
+++ b/fs/gfs2/util.h
@@ -162,7 +162,7 @@ void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct 
buffer_head *bh,
 gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, true);
 
 #define gfs2_io_error_bh(sdp, bh) \
-gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, false);
+gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, false)
 
 
 extern struct kmem_cache *gfs2_glock_cachep;
-- 
2.18.4



[PATCH] locks: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 fs/fcntl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fcntl.c b/fs/fcntl.c
index 05b36b28f2e8..96a65758c498 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -526,7 +526,7 @@ SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, 
cmd,
(dst)->l_whence = (src)->l_whence;  \
(dst)->l_start = (src)->l_start;\
(dst)->l_len = (src)->l_len;\
-   (dst)->l_pid = (src)->l_pid;
+   (dst)->l_pid = (src)->l_pid
 
 static int get_compat_flock(struct flock *kfl, const struct compat_flock 
__user *ufl)
 {
-- 
2.18.4



[PATCH] USB: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/usb/host/u132-hcd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 995bc52d2d22..eb96e1e15b71 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -208,13 +208,13 @@ struct u132 {
 #define ftdi_read_pcimem(pdev, member, data) usb_ftdi_elan_read_pcimem(pdev, \
offsetof(struct ohci_regs, member), 0, data);
 #define ftdi_write_pcimem(pdev, member, data) usb_ftdi_elan_write_pcimem(pdev, 
\
-   offsetof(struct ohci_regs, member), 0, data);
+   offsetof(struct ohci_regs, member), 0, data)
 #define u132_read_pcimem(u132, member, data) \
usb_ftdi_elan_read_pcimem(u132->platform_dev, offsetof(struct \
-   ohci_regs, member), 0, data);
+   ohci_regs, member), 0, data)
 #define u132_write_pcimem(u132, member, data) \
usb_ftdi_elan_write_pcimem(u132->platform_dev, offsetof(struct \
-   ohci_regs, member), 0, data);
+   ohci_regs, member), 0, data)
 static inline struct u132 *udev_to_u132(struct u132_udev *udev)
 {
u8 udev_number = udev->udev_number;
-- 
2.18.4



[PATCH] [SCSI] sym53c8xx: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/scsi/sym53c8xx_2/sym_glue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c 
b/drivers/scsi/sym53c8xx_2/sym_glue.c
index d9a045f9858c..f3b3345c1766 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -1001,12 +1001,12 @@ static int is_keyword(char *ptr, int len, char *verb)
 #define SKIP_SPACES(ptr, len)  \
if ((arg_len = sym_skip_spaces(ptr, len)) < 1)  \
return -EINVAL; \
-   ptr += arg_len; len -= arg_len;
+   ptr += arg_len; len -= arg_len
 
 #define GET_INT_ARG(ptr, len, v)   \
if (!(arg_len = get_int_arg(ptr, len, &(v   \
return -EINVAL; \
-   ptr += arg_len; len -= arg_len;
+   ptr += arg_len; len -= arg_len
 
 
 /*
-- 
2.18.4



[PATCH] scsi: qla2xxx: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/scsi/qla2xxx/qla_def.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index ed9b10f8537d..86d249551b2d 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -4970,7 +4970,7 @@ struct secure_flash_update_block_pk {
 } while (0)
 
 #define QLA_QPAIR_MARK_NOT_BUSY(__qpair)   \
-   atomic_dec(&__qpair->ref_count);\
+   atomic_dec(&__qpair->ref_count) \
 
 
 #define QLA_ENA_CONF(_ha) {\
-- 
2.18.4



[PATCH] scsi: aic7xxx: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/scsi/aic7xxx/aic79xx_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c 
b/drivers/scsi/aic7xxx/aic79xx_core.c
index 98b02e7d38bb..ce8604d730d1 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -319,7 +319,7 @@ ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode,
 }
 
 #define AHD_ASSERT_MODES(ahd, source, dest) \
-   ahd_assert_modes(ahd, source, dest, __FILE__, __LINE__);
+   ahd_assert_modes(ahd, source, dest, __FILE__, __LINE__)
 
 ahd_mode_state
 ahd_save_modes(struct ahd_softc *ahd)
-- 
2.18.4



[PATCH] platform/x86: thinkpad_acpi: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/platform/x86/thinkpad_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c 
b/drivers/platform/x86/thinkpad_acpi.c
index 36d9594bca7f..5bbb378d1a37 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1025,7 +1025,7 @@ static struct attribute_set *create_attr_set(unsigned int 
max_members,
 }
 
 #define destroy_attr_set(_set) \
-   kfree(_set);
+   kfree(_set)
 
 /* not multi-threaded safe, use it in a single thread per set */
 static int add_to_attr_set(struct attribute_set *s, struct attribute *attr)
-- 
2.18.4



[PATCH] net: wl1251: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/net/wireless/ti/wl1251/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wl1251/debugfs.c 
b/drivers/net/wireless/ti/wl1251/debugfs.c
index d48746e640cc..a1b778a0fda0 100644
--- a/drivers/net/wireless/ti/wl1251/debugfs.c
+++ b/drivers/net/wireless/ti/wl1251/debugfs.c
@@ -39,7 +39,7 @@ static const struct file_operations name## _ops = {   
\
 
 #define DEBUGFS_ADD(name, parent)  \
wl->debugfs.name = debugfs_create_file(#name, 0400, parent, \
-  wl, ## _ops);   \
+  wl, ## _ops)\
 
 #define DEBUGFS_DEL(name)  \
do {\
-- 
2.18.4



[PATCH] net: iwlwifi: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/net/wireless/intel/iwlwifi/dvm/rx.c  | 2 +-
 drivers/net/wireless/intel/iwlwifi/fw/api/coex.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/rx.c 
b/drivers/net/wireless/intel/iwlwifi/dvm/rx.c
index 9d55ece05020..7b2f71e48c97 100644
--- a/drivers/net/wireless/intel/iwlwifi/dvm/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/rx.c
@@ -318,7 +318,7 @@ iwlagn_accumulative_statistics(struct iwl_priv *priv,
(__le32 *)>delta_stats._name, \
(__le32 *)>max_delta_stats._name, \
(__le32 *)>accum_stats._name, \
-   sizeof(*_name));
+   sizeof(*_name))
 
ACCUM(common);
ACCUM(rx_non_phy);
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/coex.h 
b/drivers/net/wireless/intel/iwlwifi/fw/api/coex.h
index 68060085010f..8f7c9b7eeeac 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/coex.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/coex.h
@@ -199,7 +199,7 @@ enum iwl_bt_mxbox_dw3 {
 "\t%s: %d%s",  \
 #_field,   \
 BT_MBOX_MSG(notif, _num, _field),  \
-true ? "\n" : ", ");
+true ? "\n" : ", ")
 enum iwl_bt_activity_grading {
BT_OFF  = 0,
BT_ON_NO_CONNECTION = 1,
-- 
2.18.4



[PATCH] net: cisco: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/net/wireless/cisco/airo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/cisco/airo.c 
b/drivers/net/wireless/cisco/airo.c
index 74acf9af2adb..ba62bb2995d9 100644
--- a/drivers/net/wireless/cisco/airo.c
+++ b/drivers/net/wireless/cisco/airo.c
@@ -5785,7 +5785,7 @@ static int airo_get_quality (StatusRid *status_rid, 
CapabilityRid *cap_rid)
 }
 
 #define airo_get_max_quality(cap_rid) (memcmp((cap_rid)->prodName, "350", 3) ? 
0x20 : 0xa0)
-#define airo_get_avg_quality(cap_rid) (memcmp((cap_rid)->prodName, "350", 3) ? 
0x10 : 0x50);
+#define airo_get_avg_quality(cap_rid) (memcmp((cap_rid)->prodName, "350", 3) ? 
0x10 : 0x50)
 
 /*--*/
 /*
-- 
2.18.4



[PATCH] net: carl9170: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/net/wireless/ath/carl9170/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/carl9170/debug.c 
b/drivers/net/wireless/ath/carl9170/debug.c
index 19009aafc4e1..bb40889d7c72 100644
--- a/drivers/net/wireless/ath/carl9170/debug.c
+++ b/drivers/net/wireless/ath/carl9170/debug.c
@@ -45,7 +45,7 @@
 #include "cmd.h"
 
 #define ADD(buf, off, max, fmt, args...)   \
-   off += scnprintf([off], max - off, fmt, ##args);
+   off += scnprintf([off], max - off, fmt, ##args)
 
 
 struct carl9170_debugfs_fops {
@@ -818,7 +818,7 @@ void carl9170_debugfs_register(struct ar9170 *ar)
 #define DEBUGFS_ADD(name)  \
debugfs_create_file(#name, carl_debugfs_##name ##_ops.attr, \
ar->debug_dir, ar,  \
-   _debugfs_##name ## _ops.fops);
+   _debugfs_##name ## _ops.fops)
 
DEBUGFS_ADD(usb_tx_anch_urbs);
DEBUGFS_ADD(usb_rx_pool_urbs);
-- 
2.18.4



[PATCH] net: ath9k: remove trailing semicolon in macro definition

2020-11-27 Thread trix
From: Tom Rix 

The macro use will already have a semicolon.

Signed-off-by: Tom Rix 
---
 drivers/net/wireless/ath/ath9k/common-debug.c | 2 +-
 drivers/net/wireless/ath/ath9k/dfs_debug.c| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/common-debug.c 
b/drivers/net/wireless/ath/ath9k/common-debug.c
index 53ca4b063eb9..7aefb79f6bed 100644
--- a/drivers/net/wireless/ath/ath9k/common-debug.c
+++ b/drivers/net/wireless/ath/ath9k/common-debug.c
@@ -189,7 +189,7 @@ static ssize_t read_file_phy_err(struct file *file, char 
__user *user_buf,
 {
 #define PHY_ERR(s, p) \
len += scnprintf(buf + len, size - len, "%22s : %10u\n", s, \
-rxstats->phy_err_stats[p]);
+rxstats->phy_err_stats[p])
 
struct ath_rx_stats *rxstats = file->private_data;
char *buf;
diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c 
b/drivers/net/wireless/ath/ath9k/dfs_debug.c
index 3251c9abe270..2a79c2fa8415 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_debug.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c
@@ -26,7 +26,7 @@ static struct ath_dfs_pool_stats dfs_pool_stats = { 0 };
 
 #define ATH9K_DFS_STAT(s, p) \
len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
-sc->debug.stats.dfs_stats.p);
+sc->debug.stats.dfs_stats.p)
 #define ATH9K_DFS_POOL_STAT(s, p) \
len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
 dfs_pool_stats.p);
-- 
2.18.4



  1   2   3   4   >