linux/drivers
Guenter Roeck ca538531c0 hwmon: (sl28cpld-hwmon) Use HWMON_CHANNEL_INFO macro
The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood
of errors, and makes the code easier to read.

The conversion was done automatically with coccinelle. The semantic patch
used to make this change is as follows.

@s@
identifier i,j,ty;
@@

-struct hwmon_channel_info j = {
-       .type = ty,
-       .config = i,
-};

@r@
initializer list elements;
identifier s.i;
@@

-u32 i[] = {
-  elements,
-  0
-};

@script:ocaml t@
ty << s.ty;
elements << r.elements;
shorter;
elems;
@@

shorter :=
   make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty)));
elems :=
   make_ident
    (String.concat ","
     (List.map (fun x -> Printf.sprintf "\n\t\t\t   %s" x)
       (Str.split (Str.regexp " , ") elements)))

@@
identifier s.j,t.shorter;
identifier t.elems;
@@

- &j
+ HWMON_CHANNEL_INFO(shorter,elems)

This patch does not introduce functional changes. Many thanks to
Julia Lawall for providing the coccinelle script.

Cc: Michael Walle <michael@walle.cc>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-05-22 11:32:32 -07:00
..
accessibility
acpi Revert "ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40" 2022-04-21 19:58:14 +02:00
amba
android binder: Gracefully handle BINDER_TYPE_FDA objects with num_fds=0 2022-04-22 17:22:51 +02:00
ata ata: pata_marvell: Check the 'bmdma_addr' beforing reading 2022-04-22 08:45:06 +09:00
atm
auxdisplay
base firmware_loader: use kernel credentials when reading firmware 2022-05-06 10:00:03 +02:00
bcma
block ataflop: use a statically allocated error counters 2022-05-08 10:01:48 -07:00
bluetooth
bus - Fix locking when accessing device MSI descriptors 2022-05-01 09:30:47 -07:00
cdrom
char Fix some issues that were reported 2022-05-04 11:01:31 -07:00
clk Add missing sentinel, check return value and mark rtc-32k as critical 2022-04-25 16:47:24 -07:00
clocksource
comedi
connector
counter
cpufreq cpufreq: qcom-cpufreq-hw: Clear dcvs interrupts 2022-04-26 12:08:31 +05:30
cpuidle cpuidle: riscv: support non-SMP config 2022-04-19 17:42:08 -07:00
crypto
cxl cxl/pci: Drop shadowed variable 2022-04-08 12:59:43 -07:00
dax
dca
devfreq
dio
dma dmaengine: idxd: skip clearing device context when device is read-only 2022-04-20 17:24:43 +05:30
dma-buf dma-buf: call dma_buf_stats_setup after dmabuf is in valid list 2022-05-10 11:30:51 +02:00
edac EDAC/synopsys: Read the error count from the correct register 2022-04-14 14:44:49 +02:00
eisa
extcon
firewire firewire: core: extend card->lock in fw_core_handle_bus_reset 2022-04-25 08:01:09 +02:00
firmware sound fixes for 5.18-rc4 2022-04-22 13:11:38 -07:00
fpga
fsi
gnss
gpio gpio: pca953x: fix irq_stat not updated when irq is disabled (irq_mask not set) 2022-05-06 16:59:29 +02:00
gpu Multiple fixes to fbdev to address a regression at unregistration, an 2022-05-14 08:34:07 +10:00
greybus
hid
hsi
hv hyperv-fixes for 5.18-rc2 2022-04-07 06:35:34 -10:00
hwmon hwmon: (sl28cpld-hwmon) Use HWMON_CHANNEL_INFO macro 2022-05-22 11:32:32 -07:00
hwspinlock
hwtracing
i2c i2c: ismt: Fix undefined behavior due to shift overflowing the constant 2022-04-15 23:49:02 +02:00
i3c
idle intel_idle: Fix SPR C6 optimization 2022-04-27 20:36:47 +02:00
iio iio: imu: inv_icm42600: Fix I2C init possible nack 2022-04-16 15:03:58 +01:00
infiniband RDMA/rxe: Change mcg_lock to a _bh lock 2022-05-04 21:29:25 -03:00
input Input updates for v5.18-rc3 2022-04-23 09:52:07 -07:00
interconnect interconnect: Restore sync state by ignoring ipa-virt in provider count 2022-05-03 22:24:21 +03:00
iommu iommu: Make sysfs robust for non-API groups 2022-05-04 15:13:39 +02:00
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md block-5.18-2022-04-22 2022-04-23 09:46:44 -07:00
media media: si2157: unknown chip version Si2147-A30 ROM 0x50 2022-04-09 17:45:49 +02:00
memory memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual Mode 2022-04-21 17:00:24 +02:00
memstick
message scsi: message: fusion: Remove redundant variable dmp 2022-04-06 22:28:07 -04:00
mfd
misc eeprom: at25: Use DMA safe buffers 2022-04-24 17:25:10 +02:00
mmc mmc: sdhci-msm: Reset GCC_SDCC_BCR register for SDHC 2022-05-04 12:31:55 +02:00
most
mtd mtd: rawnand: qcom: fix memory corruption that causes panic 2022-04-21 09:29:07 +02:00
mux
net net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe() 2022-05-12 10:01:36 -07:00
nfc nfc: nfcmrvl: main: reorder destructive operations in nfcmrvl_nci_unregister_dev to avoid bugs 2022-05-01 13:26:05 +01:00
ntb
nubus
nvdimm
nvme nvme-pci: disable namespace identifiers for Qemu controllers 2022-04-15 06:56:17 +02:00
nvmem
of
opp
parisc
parport
pci hyperv-fixes for 5.18-rc2 2022-04-07 06:35:34 -10:00
pcmcia
peci
perf arm_pmu: Validate single/group leader events 2022-04-13 11:48:45 +01:00
phy phy: amlogic: fix error path in phy_g12a_usb3_pcie_probe() 2022-04-20 14:42:44 +05:30
pinctrl pinctrl: pistachio: fix use of irq_of_parse_and_map() 2022-04-24 16:24:09 +02:00
platform platform/surface: aggregator: Fix initialization order when compiling as builtin module 2022-05-06 13:05:57 +02:00
pnp
power power: supply: Reset err after not finding static battery 2022-04-13 12:05:22 +02:00
powercap
pps
ps3
ptp ptp: ocp: Use DIV64_U64_ROUND_UP for rounding. 2022-05-09 17:18:41 -07:00
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 Networking fixes for 5.18-rc7, including fixes from wireless, 2022-05-12 11:51:45 -07:00
sbus
scsi scsi: lpfc: Correct BDE DMA address assignment for GEN_REQ_WQE 2022-05-10 21:44:04 -04:00
sh
siox
slimbus slimbus: qcom: Fix IRQ check in qcom_slim_probe 2022-05-09 16:00:20 +02:00
soc soc: imx: imx8m-blk-ctrl: Fix IMX8MN_DISPBLK_PD_ISI hang 2022-04-10 09:32:08 +08:00
soundwire
spi spi: Fixes for v5.18 2022-04-19 10:30:43 -07:00
spmi
ssb
staging
target scsi: target: pscsi: Set SCF_TREAT_READ_AS_NORMAL flag only if there is valid data 2022-04-27 22:40:09 -04:00
tc
tee
thermal thermal/drivers/thermal_hwmon: Use hwmon_device_register_for_thermal() 2022-05-22 11:32:31 -07:00
thunderbolt
tty fsl_lpuart: Don't enable interrupts too early 2022-05-05 23:00:21 +02:00
uio
usb USB-serial fixes for 5.18-rc7 2022-05-13 08:29:40 +02:00
vdpa
vfio vfio/pci: Fix vf_token mechanism when device-specific VF drivers are used 2022-04-13 11:37:44 -06:00
vhost
video Merge remote-tracking branch 'drm/drm-fixes' into drm-misc-fixes 2022-05-11 20:22:22 +02:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen xen: Convert kmap() to kmap_local_page() 2022-04-20 15:22:18 -05:00
zorro
Kconfig
Makefile