diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-11-06 22:53:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-11-06 22:53:47 +0000 |
commit | 4cd65612ac80800caf9a2ff74bbb1fd93a80bbd8 (patch) | |
tree | d5eb1489f25fce1c3ac0a0b56542dd55dd67f196 /nuttx | |
parent | 47d03716ef1707fa8ef27df64ffa3d971239997b (diff) | |
download | px4-nuttx-4cd65612ac80800caf9a2ff74bbb1fd93a80bbd8.tar.gz px4-nuttx-4cd65612ac80800caf9a2ff74bbb1fd93a80bbd8.tar.bz2 px4-nuttx-4cd65612ac80800caf9a2ff74bbb1fd93a80bbd8.zip |
Fix errors/warnings reported by eZ80 compiler
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2239 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/drivers/bch/bchdev_driver.c | 2 | ||||
-rw-r--r-- | nuttx/drivers/bch/bchdev_unregister.c | 8 | ||||
-rw-r--r-- | nuttx/drivers/mmcsd/mmcsd.c | 16 | ||||
-rw-r--r-- | nuttx/drivers/mtd/m25px.c | 16 | ||||
-rw-r--r-- | nuttx/include/nuttx/mmcsd.h | 2 | ||||
-rw-r--r-- | nuttx/include/nuttx/mtd.h | 12 |
6 files changed, 33 insertions, 23 deletions
diff --git a/nuttx/drivers/bch/bchdev_driver.c b/nuttx/drivers/bch/bchdev_driver.c index 1258fec23..3ca97bd72 100644 --- a/nuttx/drivers/bch/bchdev_driver.c +++ b/nuttx/drivers/bch/bchdev_driver.c @@ -137,7 +137,7 @@ static int bch_close(FAR struct file *filp) { FAR struct inode *inode = filp->f_inode; FAR struct bchlib_s *bch; - int ret; + int ret = OK; DEBUGASSERT(inode && inode->i_private); bch = (FAR struct bchlib_s *)inode->i_private; diff --git a/nuttx/drivers/bch/bchdev_unregister.c b/nuttx/drivers/bch/bchdev_unregister.c index 7008824a7..6f25a2330 100644 --- a/nuttx/drivers/bch/bchdev_unregister.c +++ b/nuttx/drivers/bch/bchdev_unregister.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/bch/bchdev_unregister.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -105,10 +105,10 @@ int bchdev_unregister(const char *chardev) /* Open the character driver associated with chardev */ fd = open(chardev, O_RDONLY); - if (ret < 0) + if (fd < 0) { - dbg("Failed to open %s: %d\n", chardev, -ret); - return ret; + dbg("Failed to open %s: %d\n", chardev, errno); + return -errno; } /* Get a reference to the internal data structure. On success, we diff --git a/nuttx/drivers/mmcsd/mmcsd.c b/nuttx/drivers/mmcsd/mmcsd.c index a84a46741..bb97168cd 100644 --- a/nuttx/drivers/mmcsd/mmcsd.c +++ b/nuttx/drivers/mmcsd/mmcsd.c @@ -153,7 +153,9 @@ static ssize_t mmcsd_doread(FAR void *dev, FAR ubyte *buffer, off_t startblock, size_t nblocks) { struct mmcsd_state_s *priv = (struct mmcsd_state_s *)dev; +#ifdef CONFIG_CPP_HAVE_WARNING # warning "Not implemented" +#endif return -ENOSYS; } @@ -169,7 +171,9 @@ static ssize_t mmcsd_dowrite(FAR void *dev, FAR const ubyte *buffer, off_t startblock, size_t nblocks) { struct mmcsd_state_s *priv = (struct mmcsd_state_s *)dev; +#ifdef CONFIG_CPP_HAVE_WARNING # warning "Not implemented" +#endif return -ENOSYS; } #endif @@ -289,7 +293,9 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry) if (geometry) { priv = (struct mmcsd_state_s *)inode->i_private; -#warning "Not implemented" +#ifdef CONFIG_CPP_HAVE_WARNING +# warning "Not implemented" +#endif return -ENOSYS; } return -EINVAL; @@ -310,7 +316,9 @@ static int mmcsd_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) DEBUGASSERT(inode && inode->i_private); priv = (struct mmcsd_state_s *)inode->i_private; -#warning "Not implemented" +#ifdef CONFIG_CPP_HAVE_WARNING +# warning "Not implemented" +#endif return -ENOTTY; } @@ -326,7 +334,9 @@ static int mmcsd_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) static int mmcsd_hwinitialize(struct mmcsd_state_s *priv) { -#warning "Not implemented" +#ifdef CONFIG_CPP_HAVE_WARNING +# warning "Not implemented" +#endif return -ENODEV; } diff --git a/nuttx/drivers/mtd/m25px.c b/nuttx/drivers/mtd/m25px.c index f41b49e4b..bdb0341a0 100644 --- a/nuttx/drivers/mtd/m25px.c +++ b/nuttx/drivers/mtd/m25px.c @@ -152,12 +152,12 @@ static inline void m25p_pagewrite(struct m25p_dev_s *priv, FAR const ubyte *buff /* MTD driver methods */ static int m25p_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks); -static int m25p_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, - FAR ubyte *buf); -static int m25p_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, - FAR const ubyte *buf); -static int m25p_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, - FAR ubyte *buffer); +static ssize_t m25p_bread(FAR struct mtd_dev_s *dev, off_t startblock, + size_t nblocks, FAR ubyte *buf); +static ssize_t m25p_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, + size_t nblocks, FAR const ubyte *buf); +static ssize_t m25p_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, + FAR ubyte *buffer); static int m25p_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg); /************************************************************************************ @@ -477,7 +477,7 @@ static ssize_t m25p_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nb FAR ubyte *buffer) { FAR struct m25p_dev_s *priv = (FAR struct m25p_dev_s *)dev; - off_t nbytes; + ssize_t nbytes; fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks); @@ -488,7 +488,7 @@ static ssize_t m25p_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nb { return nbytes >> priv->pageshift; } - return nbytes; + return (int)nbytes; } /************************************************************************************ diff --git a/nuttx/include/nuttx/mmcsd.h b/nuttx/include/nuttx/mmcsd.h index 7f794ea1a..623252ed8 100644 --- a/nuttx/include/nuttx/mmcsd.h +++ b/nuttx/include/nuttx/mmcsd.h @@ -464,7 +464,7 @@ enum mmcsd_clock_e CLOCK_MMC_SLOW, /* MMC initialization clocking */ CLOCK_SD_SLOW, /* SD initialization clocking */ CLOCK_MMC_FAST, /* MMC normal operation clocking */ - CLOCK_SD_FAST, /* SD normal operation clocking */ + CLOCK_SD_FAST /* SD normal operation clocking */ }; /* This structure defines the interface between the NuttX MMC/SD diff --git a/nuttx/include/nuttx/mtd.h b/nuttx/include/nuttx/mtd.h index 975d89ca3..494baec67 100644 --- a/nuttx/include/nuttx/mtd.h +++ b/nuttx/include/nuttx/mtd.h @@ -89,10 +89,10 @@ struct mtd_dev_s /* Read/write from the specified read/write blocks */ - int (*bread)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, - FAR ubyte *buffer); - int (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, - FAR const ubyte *buffer); + ssize_t (*bread)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, + FAR ubyte *buffer); + ssize_t (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, + FAR const ubyte *buffer); /* Some devices may support byte oriented read (optional). Byte-oriented * writing is inherently block oriented on most MTD devices and is not supported. @@ -100,8 +100,8 @@ struct mtd_dev_s * buffering. */ - int (*read)(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, - FAR ubyte *buffer); + ssize_t (*read)(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, + FAR ubyte *buffer); /* Support other, less frequently used commands: * - MTDIOC_GEOMETRY: Get MTD geometry |