summaryrefslogtreecommitdiff
path: root/serial.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2014-05-09 21:16:21 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2014-05-09 21:16:21 +0000
commite5775748c3035131b8291eaf69ca9c9e4ccfb93e (patch)
tree6324be451385c9f9cea27381f35f300fbaa7f454 /serial.c
parent54ea35f68b4dcf3d2fc191e30914ce2195117baa (diff)
downloadflashrom-e5775748c3035131b8291eaf69ca9c9e4ccfb93e.tar.gz
Add 'const' keyword to chip write and other function prototypes.
Inspired by and mostly based on a patch Signed-off-by: Mark Marshall <mark.marshall@omicron.at> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1789 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/serial.c b/serial.c
index 126079a..f7d8e5e 100644
--- a/serial.c
+++ b/serial.c
@@ -335,7 +335,7 @@ int serialport_shutdown(void *data)
return 0;
}
-int serialport_write(unsigned char *buf, unsigned int writecnt)
+int serialport_write(const unsigned char *buf, unsigned int writecnt)
{
#ifdef _WIN32
DWORD tmp = 0;
@@ -470,7 +470,7 @@ int serialport_read_nonblock(unsigned char *c, unsigned int readcnt, unsigned in
/* Tries up to timeout ms to write writecnt characters from the array starting at buf. Returns
* 0 on success, positive values on temporary errors (e.g. timeouts) and negative ones on permanent errors.
* If really_wrote is not NULL, this function sets its contents to the number of bytes written successfully. */
-int serialport_write_nonblock(unsigned char *buf, unsigned int writecnt, unsigned int timeout, unsigned int *really_wrote)
+int serialport_write_nonblock(const unsigned char *buf, unsigned int writecnt, unsigned int timeout, unsigned int *really_wrote)
{
int ret = 1;
/* disable blocked i/o and declare platform-specific variables */