Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

misc: ad525x_dpot: Use str_enabled_disabled() in sysfs_show_reg()

Remove hard-coded strings by using the str_enabled_disabled() helper
function and silence the following Coccinelle/coccicheck warning
reported by string_choices.cocci:

opportunity for str_enabled_disabled(..)

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250820102734.760844-2-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thorsten Blum and committed by
Greg Kroah-Hartman
2828c318 d8959245

+3 -4
+3 -4
drivers/misc/ad525x_dpot.c
··· 73 73 #include <linux/kernel.h> 74 74 #include <linux/delay.h> 75 75 #include <linux/slab.h> 76 + #include <linux/string_choices.h> 76 77 77 78 #include "ad525x_dpot.h" 78 79 ··· 419 418 s32 value; 420 419 421 420 if (reg & DPOT_ADDR_OTP_EN) 422 - return sprintf(buf, "%s\n", 423 - test_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask) ? 424 - "enabled" : "disabled"); 425 - 421 + return sprintf(buf, "%s\n", str_enabled_disabled( 422 + test_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask))); 426 423 427 424 mutex_lock(&data->update_lock); 428 425 value = dpot_read(data, reg);