mfd: macsmc: Make SMC write buffers const

Mark the write buffer arguments in apple_smc_write(), apple_smc_rw(),
and apple_smc_write_atomic() as const. These functions do not modify
the data provided by the caller, so the parameters should be const
qualified.

Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
Reviewed-by: Sven Peter <sven@kernel.org>
Signed-off-by: Lee Jones <lee@kernel.org>
pull/1354/merge
Atharva Tiwari 2025-10-07 18:35:10 +05:30 committed by Lee Jones
parent dbecccac97
commit d306cbbc34
2 changed files with 6 additions and 6 deletions

View File

@ -173,7 +173,7 @@ int apple_smc_read(struct apple_smc *smc, smc_key key, void *buf, size_t size)
}
EXPORT_SYMBOL(apple_smc_read);
int apple_smc_write(struct apple_smc *smc, smc_key key, void *buf, size_t size)
int apple_smc_write(struct apple_smc *smc, smc_key key, const void *buf, size_t size)
{
guard(mutex)(&smc->mutex);
@ -181,7 +181,7 @@ int apple_smc_write(struct apple_smc *smc, smc_key key, void *buf, size_t size)
}
EXPORT_SYMBOL(apple_smc_write);
int apple_smc_rw(struct apple_smc *smc, smc_key key, void *wbuf, size_t wsize,
int apple_smc_rw(struct apple_smc *smc, smc_key key, const void *wbuf, size_t wsize,
void *rbuf, size_t rsize)
{
guard(mutex)(&smc->mutex);
@ -239,7 +239,7 @@ int apple_smc_enter_atomic(struct apple_smc *smc)
}
EXPORT_SYMBOL(apple_smc_enter_atomic);
int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, void *buf, size_t size)
int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, const void *buf, size_t size)
{
guard(spinlock_irqsave)(&smc->lock);
u8 result;

View File

@ -150,7 +150,7 @@ int apple_smc_read(struct apple_smc *smc, smc_key key, void *buf, size_t size);
*
* Return: Zero on success, negative errno on error
*/
int apple_smc_write(struct apple_smc *smc, smc_key key, void *buf, size_t size);
int apple_smc_write(struct apple_smc *smc, smc_key key, const void *buf, size_t size);
/**
* apple_smc_enter_atomic - Enter atomic mode to be able to use apple_smc_write_atomic
@ -177,7 +177,7 @@ int apple_smc_enter_atomic(struct apple_smc *smc);
*
* Return: Zero on success, negative errno on error
*/
int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, void *buf, size_t size);
int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, const void *buf, size_t size);
/**
* apple_smc_rw - Write and then read using the given SMC key
@ -190,7 +190,7 @@ int apple_smc_write_atomic(struct apple_smc *smc, smc_key key, void *buf, size_t
*
* Return: Zero on success, negative errno on error
*/
int apple_smc_rw(struct apple_smc *smc, smc_key key, void *wbuf, size_t wsize,
int apple_smc_rw(struct apple_smc *smc, smc_key key, const void *wbuf, size_t wsize,
void *rbuf, size_t rsize);
/**