From: John Keeping Date: Tue, 11 Jan 2022 17:04:49 +0000 (+0000) Subject: misc: mark write buffer const X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=e44d2f5df9baa9b604df4eaa4d42f89657170598;p=u-boot.git misc: mark write buffer const The write operation in misc_ops already takes a "const void *" buffer, but misc_write() takes a mutable "void *". There's no reason for this, so make misc_write() consistent with the standard write() prototype. Signed-off-by: John Keeping Reviewed-by: Simon Glass --- diff --git a/drivers/misc/misc-uclass.c b/drivers/misc/misc-uclass.c index cbfacc3801..cfe9d562fa 100644 --- a/drivers/misc/misc-uclass.c +++ b/drivers/misc/misc-uclass.c @@ -26,7 +26,7 @@ int misc_read(struct udevice *dev, int offset, void *buf, int size) return ops->read(dev, offset, buf, size); } -int misc_write(struct udevice *dev, int offset, void *buf, int size) +int misc_write(struct udevice *dev, int offset, const void *buf, int size) { const struct misc_ops *ops = device_get_ops(dev); diff --git a/include/misc.h b/include/misc.h index 82ec2ce793..6f042625c9 100644 --- a/include/misc.h +++ b/include/misc.h @@ -28,7 +28,7 @@ int misc_read(struct udevice *dev, int offset, void *buf, int size); * * Return: number of bytes written if OK (may be < @size), -ve on error */ -int misc_write(struct udevice *dev, int offset, void *buf, int size); +int misc_write(struct udevice *dev, int offset, const void *buf, int size); /** * misc_ioctl() - Assert command to the device, optional.