* [PATCH] misc: mark write buffer const
@ 2022-01-11 17:04 John Keeping
2022-01-12 20:03 ` Simon Glass
2022-01-24 16:53 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: John Keeping @ 2022-01-11 17:04 UTC (permalink / raw)
To: u-boot; +Cc: Simon Glass, John Keeping
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 <john@metanate.com>
---
drivers/misc/misc-uclass.c | 2 +-
include/misc.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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.
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] misc: mark write buffer const
2022-01-11 17:04 [PATCH] misc: mark write buffer const John Keeping
@ 2022-01-12 20:03 ` Simon Glass
2022-01-24 16:53 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2022-01-12 20:03 UTC (permalink / raw)
To: John Keeping; +Cc: U-Boot Mailing List
On Tue, 11 Jan 2022 at 10:04, John Keeping <john@metanate.com> wrote:
>
> 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 <john@metanate.com>
> ---
> drivers/misc/misc-uclass.c | 2 +-
> include/misc.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] misc: mark write buffer const
2022-01-11 17:04 [PATCH] misc: mark write buffer const John Keeping
2022-01-12 20:03 ` Simon Glass
@ 2022-01-24 16:53 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2022-01-24 16:53 UTC (permalink / raw)
To: John Keeping; +Cc: u-boot, Simon Glass
[-- Attachment #1: Type: text/plain, Size: 437 bytes --]
On Tue, Jan 11, 2022 at 05:04:49PM +0000, John Keeping wrote:
> 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 <john@metanate.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-24 16:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 17:04 [PATCH] misc: mark write buffer const John Keeping
2022-01-12 20:03 ` Simon Glass
2022-01-24 16:53 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.