100 Commits
Author SHA1 Message Date
Wang Qing f44cf716e4 powerpc/5xx: Drop unnecessary cast
do_div() does a 64-by-32 division, the 2nd parameter is a u32.

gbp->ipb_freq is already a u32, there's no need to transform it to u64
before passing it to do_div().

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Christophe Leroy <[email protected]>
[mpe: Add some detail to change log]
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-05-04 19:37:46 +10:00
Qing Wang cc4639989e macintosh/ams: Replace snprintf in show functions with sysfs_emit
show() must not use snprintf() when formatting the value to be returned
to user space.

Fix the following coccicheck warning:
  drivers/macintosh/ams/ams-core.c:53: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-05-04 19:37:45 +10:00
Wang Qing 883f464c1d ARM: OMAP2+: add missing of_node_put before break and return
Fix following coccicheck warning:
WARNING: Function "for_each_matching_node_and_match"
should have of_node_put() before return.

Early exits from for_each_matching_node_and_match should decrement the
node reference counter.

Signed-off-by: Wang Qing <[email protected]>
Message-Id: <[email protected]>
[[email protected]: updated for omap_hwmod.c that was already patched]
Signed-off-by: Tony Lindgren <[email protected]>
2022-04-21 14:47:15 +03:00
Wang Qing 1dc9f1a66e arch_topology: Do not set llc_sibling if llc_id is invalid
When ACPI is not enabled, cpuid_topo->llc_id = cpu_topo->llc_id = -1, which
will set llc_sibling 0xff(...), this is misleading.

Don't set llc_sibling(default 0) if we don't know the cache topology.

Reviewed-by: Sudeep Holla <[email protected]>
Signed-off-by: Wang Qing <[email protected]>
Fixes: 37c3ec2d81 ("arm64: topology: divorce MC scheduling domain from core_siblings")
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-04-20 18:57:59 +02:00
Wang Qing 207d924dcf net: usb: remove duplicate assignment
netdev_alloc_skb() has assigned ssi->netdev to skb->dev if successed,
no need to repeat assignment.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2022-04-06 15:19:53 +01:00
Wang Qing be8d9d0527 net: ethernet: xilinx: use of_property_read_bool() instead of of_get_property
"little-endian" has no specific content, use more helper function
of_property_read_bool() instead of of_get_property()

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2022-04-06 15:18:03 +01:00
Wang Qing b23e868d35 video: fbdev: pxafb: use if else instead
use if and else instead of consequent if(A) and if (!A)

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Helge Deller <[email protected]>
2022-04-04 08:55:23 +02:00
Wang Qing 58cafef9ec staging: r8188eu: remove duplicate assignment
netdev_alloc_skb() has assigned ssi->netdev to skb->dev if successed,
no need to repeat assignment.

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-04-04 07:33:48 +02:00
Wang Qing 8cbc3d51b4 cw1200: use time_is_after_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-03-10 18:17:10 +02:00
Wang Qing b537bf429a xen: use time_is_before_eq_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Reviewed-by: Boris Ostrovsky <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Boris Ostrovsky <[email protected]>
2022-03-10 09:27:55 -06:00
Wang Qing a861fb9fa5 ext4: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
2022-03-02 23:50:02 -05:00
Wang Qing a577223a97 net: hamradio: fix compliation error
add missing ")" which caused by previous commit.

Fixes: 61c4fb9c4d ("net: hamradio: use time_is_after_jiffies() instead of open coding it")
Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-02 09:47:38 -08:00
Wang Qing 98fffd72f9 net: decnet: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2022-02-28 13:21:32 +00:00
Wang Qing b7eb7f67eb net: wan: lmc: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2022-02-28 13:21:31 +00:00
Wang Qing 61c4fb9c4d net: hamradio: use time_is_after_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2022-02-28 13:21:31 +00:00
Wang Qing e0e8028cc0 net: ethernet: sun: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2022-02-28 13:21:31 +00:00
Wang Qing 3b6cab7b5a net: qlcnic: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2022-02-28 13:21:31 +00:00
Wang Qing 882edc0621 net: ethernet: use time_is_before_eq_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2022-02-28 13:21:31 +00:00
Wang Qing 2e8ecb4bbc Bluetooth: assign len after null check
len should be assigned after a null check

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
2022-02-24 21:05:21 +01:00
Wang Qing 4d986ffa03 spi: add missing pci_dev_put() before return
pci_get_slot() increases its reference count, the caller must
decrement the reference count by calling pci_dev_put()

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2022-02-23 02:04:17 +00:00
Wang Qing 8ca8b1e147 dm thin: use time_is_before_jiffies instead of open coding it
Use time_is_before_jiffies() to improve code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
2022-02-22 11:30:50 -05:00
Wang Qing 84db51f56f media: vivid: use time_is_after_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2022-02-22 09:41:13 +01:00
Wang Qing d613750ea3 media: wl128x: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2022-02-22 09:41:12 +01:00
Wang Qing 39878a5959 media: tda8083: use time_is_after_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2022-02-22 09:41:12 +01:00
Wang Qing 0ce32a2ce3 media: stv0299: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2022-02-22 09:41:12 +01:00
Wang Qing 1bcf233f1b media: si21xx: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2022-02-22 09:41:12 +01:00
Wang Qing b191fe39a5 clk: mvebu: use time_is_before_eq_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Stephen Boyd <[email protected]>
2022-02-17 14:06:12 -08:00
Wang Qing 038fcdaf04 net: ethernet: cavium: use div64_u64() instead of do_div()
do_div() does a 64-by-32 division.
When the divisor is u64, do_div() truncates it to 32 bits, this means it
can test non-zero and be truncated to zero for division.

fix do_div.cocci warning:
do_div() does a 64-by-32 division, please consider using div64_u64 instead.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2022-02-09 13:27:17 +00:00
Qing Wang 982c595375 clk-si5341: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the following coccicheck warning:
drivers/clk/clk-si5341.c:1471: WARNING: use scnprintf or sprintf.
drivers/clk/clk-si5341.c:1486: WARNING: use scnprintf or sprintf.
drivers/clk/clk-si5341.c:1501: WARNING: use scnprintf or sprintf.
drivers/clk/clk-si5341.c:1516: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Robert Hancock <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
2022-01-24 16:51:47 -08:00
Wang Qing af8d0f6d22 mailbox: mtk: add missing of_node_put before return
Fix following coccicheck warning:
WARNING: Function "for_each_child_of_node"
should have of_node_put() before return.

Early exits from for_each_child_of_node should decrement the
node reference counter.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
2022-01-11 23:47:33 -06:00
Wang Qing 2453128847 mailbox: zynq: add missing of_node_put before return
Fix following coccicheck warning:
WARNING: Function "for_each_available_child_of_node"
should have of_node_put() before return.

Early exits from for_each_available_child_of_node should decrement the
node reference counter.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
2022-01-11 23:47:32 -06:00
Qing Wang dfac1a1670 ext4: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the coccicheck warning:
WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
2022-01-10 13:25:55 -05:00
Wang Qing eb66fb03a7 platform/x86: apple-gmux: use resource_size() with res
This should be (res->end - res->start + 1) here actually,
use resource_size() derectly.

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
2021-12-21 19:35:33 +01:00
Wang Qing 855045873b platform/x86: apple-gmux: use resource_size() with res
This should be (res->end - res->start + 1) here actually,
use resource_size() derectly.

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
2021-12-21 18:53:03 +01:00
Wang Qing 405db98b89 mips: ralink: add missing of_node_put() call in ill_acc_of_setup()
of_find_compatible_node() takes a reference to the device_node
which needs to be dropped when done.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
2021-12-14 10:05:12 +01:00
Wang Qing be565ec71d net: ethernet: ti: add missing of_node_put before return
Fix following coccicheck warning:
WARNING: Function "for_each_child_of_node"
should have of_node_put() before return.

Early exits from for_each_child_of_node should decrement the
node reference counter.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-12-13 14:54:54 +00:00
Qing Wang 4b9e04367a s390: replace snprintf in show functions with sysfs_emit
show() must not use snprintf() when formatting the value to be
returned to user space.

Fix the coccicheck warnings:
WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Acked-by: Vineeth Vijayan <[email protected]>
Acked-by: Stefan Haberland <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[[email protected]: fix indentation]
Signed-off-by: Heiko Carstens <[email protected]>
2021-11-16 12:29:19 +01:00
Qing Wang 2a99839240 media: i2c: ccs: replace snprintf in show functions with sysfs_emit
show() should not use snprintf() when formatting the value to be
returned to user space.

Fix the following coccicheck warning:
drivers/media/i2c/ccs/ccs-core.c:3761: WARNING: use scnprintf or sprintf.

Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2021-11-15 08:11:34 +00:00
Qing Wang 3bcd6c5bd4 nilfs2: replace snprintf in show functions with sysfs_emit
Patch series "nilfs2 updates".

This patch (of 2):

coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the coccicheck warning:

  WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Ryusuke Konishi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2021-11-09 10:02:51 -08:00
Qing Wang 6ae210f1b5 mfd: janz-cmoio: Replace snprintf in show functions with sysfs_emit
show() must not use snprintf() when formatting the value to be
returned to user space.

Fix the following coccicheck warning:
drivers/mfd/janz-cmodio.c:157: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2021-11-05 14:40:27 +00:00
Qing Wang 1b86db5f4e bcache: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the following coccicheck warning:
drivers/md/bcache/sysfs.h:54:12-20: WARNING: use scnprintf or sprintf.

Implement sysfs_print() by sysfs_emit() and remove snprint() since no one
uses it any more.

Suggested-by: Coly Li <[email protected]>
Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Coly Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
2021-10-29 06:43:21 -06:00
Qing Wang 84eab2a899 f2fs: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the following coccicheck warning:
fs/f2fs/sysfs.c:198:12-20: WARNING: use scnprintf or sprintf.
fs/f2fs/sysfs.c:247:8-16: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
2021-10-26 14:04:30 -07:00
Qing Wang c726c62db8 dmaengine: switch from 'pci_' to 'dma_' API
The wrappers in include/linux/pci-dma-compat.h should go away.

pci_set_dma_mask()/pci_set_consistent_dma_mask() should be
replaced with dma_set_mask()/dma_set_coherent_mask(),
and use dma_set_mask_and_coherent() for both.

Signed-off-by: Qing Wang <[email protected]>
Reviewed-by: Logan Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2021-10-26 10:54:57 +05:30
Qing Wang 0c5afef7bf dmaengine: ioat: switch from 'pci_' to 'dma_' API
The wrappers in include/linux/pci-dma-compat.h should go away.

pci_set_dma_mask()/pci_set_consistent_dma_mask() should be
replaced with dma_set_mask()/dma_set_coherent_mask(),
and use dma_set_mask_and_coherent() for both.

Signed-off-by: Qing Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2021-10-26 10:54:53 +05:30
Qing Wang bec897e0a7 dmaengine: hsu: switch from 'pci_' to 'dma_' API
The wrappers in include/linux/pci-dma-compat.h should go away.

pci_set_dma_mask()/pci_set_consistent_dma_mask() should be
replaced with dma_set_mask()/dma_set_coherent_mask(),
and use dma_set_mask_and_coherent() for both.

Signed-off-by: Qing Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2021-10-26 10:54:47 +05:30
Qing Wang d77143dd24 dmaengine: hisi_dma: switch from 'pci_' to 'dma_' API
The wrappers in include/linux/pci-dma-compat.h should go away.

pci_set_dma_mask()/pci_set_consistent_dma_mask() should be
replaced with dma_set_mask()/dma_set_coherent_mask(),
and use dma_set_mask_and_coherent() for both.

Signed-off-by: Qing Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2021-10-26 10:54:40 +05:30
Qing Wang 1365e117bf dmaengine: dw: switch from 'pci_' to 'dma_' API
The wrappers in include/linux/pci-dma-compat.h should go away.

pci_set_dma_mask()/pci_set_consistent_dma_mask() should be
replaced with dma_set_mask()/dma_set_coherent_mask(),
and use dma_set_mask_and_coherent() for both.

Signed-off-by: Qing Wang <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2021-10-26 10:54:32 +05:30
Wang Qing ecb8c88bd3 dmaengine: dw-edma-pcie: switch from 'pci_' to 'dma_' API
The wrappers in include/linux/pci-dma-compat.h should go away.

pci_set_dma_mask()/pci_set_consistent_dma_mask() should be
replaced with dma_set_mask()/dma_set_coherent_mask(),
and use dma_set_mask_and_coherent() for both.

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2021-10-26 10:54:23 +05:30
Qing Wang 7bc9ab0f42 can: at91/janz-ican3: replace snprintf() in show functions with sysfs_emit()
The sysfs show() functions must not use snprintf() when formatting the
value to be returned to user space.

Fix the following coccicheck warning:
| drivers/net/can/at91_can.c:1185: WARNING: use scnprintf or sprintf.
| drivers/net/can/janz-ican3.c:1834: WARNING: use scnprintf or sprintf.
|
| Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Link: https://lore.kernel.org/all/[email protected]
Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
2021-10-24 16:25:42 +02:00
Qing Wang 7e75c33756 hwrng: s390 - replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the following coccicheck warning:
drivers/char/hw_random/s390-trng.c:114:8-16: WARNING: use scnprintf or sprintf.
drivers/char/hw_random/s390-trng.c:122:8-16: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
2021-10-22 20:24:12 +08:00
Qing Wang db5b6a46f4 net: bpf: Switch over to memdup_user()
This patch fixes the following Coccinelle warning:

net/bpf/test_run.c:361:8-15: WARNING opportunity for memdup_user
net/bpf/test_run.c:1055:8-15: WARNING opportunity for memdup_user

Use memdup_user rather than duplicating its implementation
This is a little bit restricted to reduce false positives

Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: John Fastabend <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
2021-10-20 18:43:15 -07:00
Qing Wang 40320159f0 drm/amdgpu: replace snprintf in show functions with sysfs_emit
show() must not use snprintf() when formatting the value to be
returned to user space.

Fix the following coccicheck warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c:427:
WARNING: use scnprintf or sprintf.

Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2021-10-20 11:43:56 -04:00
Qing Wang 53eb47b491 xfs: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the coccicheck warning:
WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
2021-10-19 11:45:12 -07:00
Qing Wang 2d5b0755b7 platform/x86: panasonic-laptop: Replace snprintf in show functions with sysfs_emit
show() must not use snprintf() when formatting the value to be
returned to user space.

Fix the coccicheck warnings:
WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
2021-10-19 16:59:44 +02:00
Qing Wang 65b4b8aa0f ath5k: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the coccicheck warning:
WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2021-10-18 15:33:42 +03:00
Qing Wang cc83ff247b video: omapfb: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the coccicheck warning:
WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2021-10-15 22:52:10 +02:00
Qing Wang 4701a0dd41 video: fbdev: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.

Fix the coccicheck warning:
WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2021-10-15 22:46:16 +02:00
Wang Qing 39b14bb591 drm: Use IS_ERR() instead of IS_ERR_OR_NULL()
dev_pm_opp_find_freq_exact never return null but ERR_PTR(),so we
should use IS_ERR() to clarify and avoid compilation warnings.

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
2021-10-15 13:26:34 -07:00
Qing Wang 5f9741f53a drm/panel: dsi-cm: replace snprintf in show functions with sysfs_emit
show() must not use snprintf() when formatting the value to be
returned to user space.

Fix the following coccicheck warning:
drivers/gpu/drm/panel/panel-dsi-cm.c:251: WARNING: use scnprintf or sprintf.
drivers/gpu/drm/panel/panel-dsi-cm.c:271: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2021-10-15 20:14:31 +02:00
Qing Wang 08411e3461 spi: replace snprintf in show functions with sysfs_emit
show() must not use snprintf() when formatting the value to be
returned to user space.

Fix the following coccicheck warning:
drivers/spi/spi-tle62x0.c:144: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2021-10-15 16:11:01 +01:00
Qing Wang d47e983e4f ACPI: replace snprintf() in "show" functions with sysfs_emit()
coccicheck complains about the use of snprintf() in sysfs "show"
functions:

Fix the coccicheck warning:
WARNING: use scnprintf or sprintf.

so use sysfs_emit() instead of it where applicable.

Signed-off-by: Qing Wang <[email protected]>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
2021-10-13 20:02:18 +02:00
Wang Qing 16ad3db3b2 nbd: fix order of cleaning up the queue and freeing the tagset
We must release the queue before freeing the tagset.

Fixes: 4af5f2e030 ("nbd: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-and-tested-by: [email protected]
Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Guoqing Jiang <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
2021-07-15 09:30:15 -06:00
Wang Qing 256f7a6791 doc: watchdog: modify the doc related to "watchdog/%u"
"watchdog/%u" threads has be replaced by cpu_stop_work.  The current
description is extremely misleading.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Wang Qing <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Cc: "Guilherme G. Piccoli" <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Qais Yousef <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Santosh Sivaraj <[email protected]>
Cc: Stephen Kitt <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2021-06-29 10:53:46 -07:00
Wang Qing e55fda8cdc doc: watchdog: modify the explanation related to watchdog thread
"watchdog/%u" threads has be replaced by cpu_stop_work.  The current
description is extremely misleading.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Wang Qing <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Cc: "Guilherme G. Piccoli" <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Qais Yousef <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Santosh Sivaraj <[email protected]>
Cc: Stephen Kitt <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2021-06-29 10:53:46 -07:00
Wang Qing b124ac45bd kernel: watchdog: modify the explanation related to watchdog thread
The watchdog thread has been replaced by cpu_stop_work, modify the
explanation related.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Wang Qing <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Stephen Kitt <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: "Guilherme G. Piccoli" <[email protected]>
Cc: Qais Yousef <[email protected]>
Cc: Santosh Sivaraj <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2021-06-29 10:53:46 -07:00
Wang Qing 5f8ebd4766 doc: mtk-wdt: support pre-timeout when the bark irq is available
Add description of pre-timeout in mtk-wdt.

Signed-off-by: Wang Qing <[email protected]>
Acked-by: Rob Herring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
2021-06-21 08:49:10 +02:00
Wang Qing 1bbce7792b watchdog: mtk: support pre-timeout when the bark irq is available
Use the bark interrupt as the pretimeout notifier if available.

When the watchdog timer expires in dual mode, an interrupt will be
triggered first, then the timing restarts. The reset signal will be
initiated when the timer expires again.

The pretimeout notification shall occur at timeout-sec/2.

V2:
- panic() by default if WATCHDOG_PRETIMEOUT_GOV is not enabled.

V3:
- Modify the pretimeout behavior, manually reset after the pretimeout
- is processed and wait until timeout.

V4:
- Remove pretimeout related processing.
- Add dual mode control separately.

V5:
- Fix some formatting and printing problems.

V6:
- Realize pretimeout processing through dualmode.

V7:
- Add set_pretimeout().

V8/V9:
- Fix some formatting problems.

Signed-off-by: Wang Qing <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
2021-06-21 08:49:10 +02:00
Wang Qing b75a44de44 media: staging: media: zoran: fix some formatting issues
fixing WARNING: Possible repeated word: 'in' as "in in a VIDIOCSFBUF ioctl",
limit the number of words per line.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2021-06-02 13:36:32 +02:00
Wang Qing 946c945301 staging: rtl8192e: delete extra blank lines
fixing CHECK:Blank lines aren't necessary before a close brace '}'

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-05-19 17:59:39 +02:00
Wang Qing 9b0644fc43 staging: iio: fix some formatting issues
fixing:
CHECK: Alignment should match open parenthesis
#1351: FILE: drivers/staging/iio/addac/adt7316.c:1351:

CHECK: Alignment should match open parenthesis
#1378: FILE: drivers/staging/iio/addac/adt7316.c:1378:

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-05-19 17:59:29 +02:00
Wang Qing b8cf202779 lib: fix inconsistent indenting in process_bit1()
Smatch gives the warning:
	lib/decompress_unlzma.c:395 process_bit1() warn: inconsistent indenting

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2021-05-06 19:24:12 -07:00
Wang Qing bf90ac198e mm/memory.c: do_numa_page(): delete bool "migrated"
Smatch gives the warning:

  do_numa_page() warn: assigning (-11) to unsigned variable 'migrated'

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Wang Qing <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2021-04-30 11:20:38 -07:00
Wang Qing 8079ebf5ff usb: cdns3: delete repeated clear operations
dma_alloc_coherent already zeroes out memory, so memset is not needed.

Signed-off-by: Wang Qing <[email protected]>
Reviewed-by: Pawel Laszczak <[email protected]>
Acked-by: Pawel Laszczak <[email protected]>
Signed-off-by: Peter Chen <[email protected]>
2021-04-12 20:19:22 +08:00
Wang Qing 89e28ce60c workqueue/watchdog: Make unbound workqueues aware of touch_softlockup_watchdog()
84;0;0c84;0;0c
There are two workqueue-specific watchdog timestamps:

    + @wq_watchdog_touched_cpu (per-CPU) updated by
      touch_softlockup_watchdog()

    + @wq_watchdog_touched (global) updated by
      touch_all_softlockup_watchdogs()

watchdog_timer_fn() checks only the global @wq_watchdog_touched for
unbound workqueues. As a result, unbound workqueues are not aware
of touch_softlockup_watchdog(). The watchdog might report a stall
even when the unbound workqueues are blocked by a known slow code.

Solution:
touch_softlockup_watchdog() must touch also the global @wq_watchdog_touched
timestamp.

The global timestamp can no longer be used for bound workqueues because
it is now updated from all CPUs. Instead, bound workqueues have to check
only @wq_watchdog_touched_cpu and these timestamps have to be updated for
all CPUs in touch_all_softlockup_watchdogs().

Beware:
The change might cause the opposite problem. An unbound workqueue
might get blocked on CPU A because of a real softlockup. The workqueue
watchdog would miss it when the timestamp got touched on CPU B.

It is acceptable because softlockups are detected by softlockup
watchdog. The workqueue watchdog is there to detect stalls where
a work never finishes, for example, because of dependencies of works
queued into the same workqueue.

V3:
- Modify the commit message clearly according to Petr's suggestion.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
2021-04-04 13:26:49 -04:00
Wang Qing c5c1c700e2 doc: admin-guide: remove explanation of "watchdog/%u"
"watchdog/%u" threads has be replaced by cpu_stop_work,
which will mislead the reader.

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Corbet <[email protected]>
2021-03-31 14:32:02 -06:00
Wang Qing b9aa074b89 net/decnet: Delete obsolete TODO file
The TODO file here has not been updated from 2005, and the function
development described in the file have been implemented or abandoned.

Its existence will mislead developers seeking to view outdated information.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-03-30 16:54:50 -07:00
Wang Qing 8d9e5bbf5c net/ax25: Delete obsolete TODO file
The TODO file here has not been updated for 13 years, and the function
development described in the file have been implemented or abandoned.

Its existence will mislead developers seeking to view outdated information.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-03-30 16:54:50 -07:00
Wang Qing ab36ba4f3a fs/jffs2: Delete obsolete TODO file
The TODO file here has not been updated for 14 years, and the function
development described in the file have been implemented or abandoned.

Its existence will mislead developers seeking to view outdated information.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-03-30 16:54:49 -07:00
Wang Qing 22612b4e60 fs/befs: Delete obsolete TODO file
The TODO file here has not been updated from 2005, and the function
development described in the file have been implemented or abandoned.

Its existence will mislead developers seeking to view outdated information.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-03-30 16:54:49 -07:00
Wang Qing ef843f261b scsi/aacraid: Delete obsolete TODO file
The TODO file here has not been updated from 2.6.12 for more than 15 years.
Its existence will mislead developers seeking to view outdated information.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-03-30 16:54:49 -07:00
Wang Qing 0f1b2a4912 mips/sgi-ip27: Delete obsolete TODO file
The TODO file here has not been updated for 15 years, and the function
development described in the file have been implemented or abandoned.

Its existence will mislead developers seeking to view outdated information.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-03-30 16:54:49 -07:00
Wang Qing f681c11bae mips/sgi-ip27: Delete obsolete TODO file
The TODO file here has not been updated for 15 years, and the function
development described in the file have been implemented or abandoned.

Its existence will mislead developers seeking to view outdated information.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
2021-03-30 15:06:37 +02:00
Wang Qing 0d556a21a9 scsi: ibmvscsi: Remove unnecessary cast
Fix the following coccicheck warning:
WARNING: casting value returned by memory allocation function is useless.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24 22:33:37 -04:00
Wang Qing 3ba9f38ed4 scsi: fnic: Remove unnecessary cast
Fix the following coccicheck warning:
WARNING: casting value returned by memory allocation function is useless.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24 22:33:37 -04:00
Wang Qing 690209d5eb scsi: message: fusion: Remove unnecessary cast
Fix the following coccicheck warning:
WARNING: casting value returned by memory allocation function is useless.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24 22:33:31 -04:00
Wang Qing 77124a4277 drivers: tty: serial: sh-sci: fix spelling typo of 'wheter'
wheter -> whether

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-03-23 10:24:59 +01:00
Wang Qing b9edc6823d tty: serial: 8250: delete redundant printing of return value
platform_get_irq() has already checked and printed the return value,
the printing here is nothing special, it is not necessary at all.

Signed-off-by: Wang Qing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-03-23 10:21:06 +01:00
Wang Qing 46e152186c arc: kernel: Return -EFAULT if copy_to_user() fails
The copy_to_user() function returns the number of bytes remaining to be
copied, but we want to return -EFAULT if the copy doesn't complete.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Vineet Gupta <[email protected]>
2021-03-22 10:05:43 -07:00
Wang Qing 84fcfbdadb dma-mapping: remove a pointless empty line in dma_alloc_coherent
Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
2021-03-19 14:13:14 +01:00
Wang Qing befb1ddaec hwrng: cctrng - delete redundant printing of return value
platform_get_irq() has already checked and printed the return value,
the printing here is nothing special, it is not necessary at all.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
2021-03-19 21:59:47 +11:00
Wang Qing 4accca4399 drm/mediatek: dpi: Delete redundant printing of return value
platform_get_irq() has already checked and printed the return value,
the printing here is nothing special, it is not necessary at all.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Chun-Kuang Hu <[email protected]>
2021-03-18 08:06:47 +08:00
Wang Qing 720efdd23f scsi: qla2xxx: Use dma_pool_zalloc()
Use dma_pool_zalloc() instead of dma_pool_alloc() and memset().

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-15 22:52:30 -04:00
Wang Qing 63d6c98168 mips: kernel: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
debugfs_create_file_unsafe does not protect the fops handed to it
against file removal. DEFINE_DEBUGFS_ATTRIBUTE makes the fops aware of
the file lifetime and thus protects it against removal.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
2021-03-14 14:09:49 +01:00
Wang Qing 4b18d5d1b2 net: ethernet: chelsiofix: spelling typo of 'rewriteing'
rewriteing -> rewriting

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-03-10 12:45:14 -08:00
Wang Qing 67a580aad1 drivers: isdn: mISDN: fix spelling typo of 'wheter'
wheter -> whether

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-03-10 12:45:14 -08:00
Wang Qing 942df4be7a s390/crypto: return -EFAULT if copy_to_user() fails
The copy_to_user() function returns the number of bytes remaining to be
copied, but we want to return -EFAULT if the copy doesn't complete.

Fixes: e06670c5fe ("s390: vfio-ap: implement VFIO_DEVICE_GET_INFO ioctl")
Signed-off-by: Wang Qing <[email protected]>
Reviewed-by: Tony Krowiak <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Heiko Carstens <[email protected]>
2021-03-08 10:46:29 +01:00
Wang Qing 51c44babdc s390/cio: return -EFAULT if copy_to_user() fails
The copy_to_user() function returns the number of bytes remaining to be
copied, but we want to return -EFAULT if the copy doesn't complete.

Fixes: e01bcdd613 ("vfio: ccw: realize VFIO_DEVICE_GET_REGION_INFO ioctl")
Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Heiko Carstens <[email protected]>
2021-03-08 10:46:29 +01:00
Wang Qing 320f6f90cb ARM: OMAP2+: fix spellint typo
Change the comment typo: "ununsed" -> "unused".

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
2021-01-26 13:43:17 +02:00
Wang Qing a118584e7e sh: mach-sh03: remove duplicate include
Remove duplicate header which is included twice.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Rich Felker <[email protected]>
2021-01-06 19:55:28 -05:00
Wang Qing 7a202ec74c arch: sh: remove duplicate include
Remove duplicate header which is included twice.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Rich Felker <[email protected]>
2021-01-06 19:55:27 -05:00