Skip to content

Commit e6174e9

Browse files
committed
Merge tag 'acpi-7.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI support fixes from Rafael Wysocki: "These fix a coding mistake in the ACPI TAD (Time and Alarm Device) driver introduced by one of its previous updates and get rid of the ugly #ifdef __KERNEL__ conditional compilation in acpi_ut_safe_strncpy() by redefining that function as an alias for strscpy_pad(): - Add a missing ACPI_TAD_AC_WAKE capability check omitted by mistake to the ACPI TAD driver (Xu Rao) - Define acpi_ut_safe_strncpy() as an alias for strscpy_pad() which is viable because that function is only called from kernel code (Rafael Wysocki)" * tag 'acpi-7.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPICA: Define acpi_ut_safe_strncpy() as strscpy_pad() alias ACPI: TAD: Check AC wake capability before enabling wakeup
2 parents 590cae7 + 973772c commit e6174e9

4 files changed

Lines changed: 2 additions & 19 deletions

File tree

drivers/acpi/acpi_tad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ static int acpi_tad_probe(struct platform_device *pdev)
856856
* runtime suspend. Everything else should be taken care of by the ACPI
857857
* PM domain callbacks.
858858
*/
859-
if (ACPI_TAD_AC_WAKE) {
859+
if (caps & ACPI_TAD_AC_WAKE) {
860860
device_init_wakeup(dev, true);
861861
dev_pm_set_driver_flags(dev, DPM_FLAG_SMART_SUSPEND |
862862
DPM_FLAG_MAY_SKIP_RESUME);

drivers/acpi/acpica/acutils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,6 @@ void acpi_ut_repair_name(char *name);
626626
#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) || defined (ACPI_DEBUG_OUTPUT)
627627
u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source);
628628

629-
void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size);
630-
631629
u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source);
632630

633631
u8

drivers/acpi/acpica/utnonansi.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,4 @@ acpi_ut_safe_strncat(char *dest,
164164
return (FALSE);
165165
}
166166

167-
void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size)
168-
{
169-
/* Always terminate destination string */
170-
171-
#ifdef __KERNEL__
172-
strscpy_pad(dest, source, dest_size);
173-
#else
174-
/*
175-
* strscpy_pad() is not defined in ACPICA tools builds, so use strncpy()
176-
* and directly NUL-terminate the destination string in that case.
177-
*/
178-
strncpy(dest, source, dest_size);
179-
dest[dest_size - 1] = 0;
180-
#endif
181-
}
182-
183167
#endif

include/acpi/platform/aclinuxex.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ static inline void acpi_os_terminate_debugger(void)
134134
/*
135135
* OSL interfaces added by Linux
136136
*/
137+
#define acpi_ut_safe_strncpy strscpy_pad
137138

138139
#endif /* __KERNEL__ */
139140

0 commit comments

Comments
 (0)