public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: John Keeping <john@metanate.com>
To: u-boot@lists.denx.de
Cc: Simon Glass <sjg@chromium.org>, John Keeping <john@metanate.com>
Subject: [PATCH] misc: mark write buffer const
Date: Tue, 11 Jan 2022 17:04:49 +0000	[thread overview]
Message-ID: <20220111170449.2514811-1-john@metanate.com> (raw)

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


             reply	other threads:[~2022-01-11 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 17:04 John Keeping [this message]
2022-01-12 20:03 ` [PATCH] misc: mark write buffer const Simon Glass
2022-01-24 16:53 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220111170449.2514811-1-john@metanate.com \
    --to=john@metanate.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox