[PATCH 2/3] doc: harmonize some sentences about the return value of functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let sentences about the return value all have the same structure, and
disambiguate between "error code" (the value) and "failure" (the event)
when appropriate.

Signed-off-by: Antonio Ospite <ao2@xxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: Jonathan Corbet <corbet@xxxxxxx>
Cc: linux-doc@xxxxxxxxxxxxxxx
---
 drivers/base/transport_class.c                |  2 +-
 drivers/pcmcia/pcmcia_cis.c                   | 12 +++++++++---
 drivers/s390/scsi/zfcp_erp.c                  |  2 +-
 drivers/staging/lustre/lustre/ptlrpc/client.c |  9 ++++++---
 drivers/staging/lustre/lustre/ptlrpc/import.c |  3 ++-
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 12 ++++++++----
 drivers/staging/media/dt3155v4l/dt3155v4l.c   |  6 +++---
 fs/gfs2/inode.c                               |  4 ++--
 fs/gfs2/super.c                               |  4 ++--
 include/linux/ipack.h                         |  4 ++--
 include/linux/virtio_config.h                 |  2 +-
 include/linux/vringh.h                        |  2 +-
 12 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/drivers/base/transport_class.c b/drivers/base/transport_class.c
index f6c453c..5a95992 100644
--- a/drivers/base/transport_class.c
+++ b/drivers/base/transport_class.c
@@ -43,7 +43,7 @@
  * DECLARE_TRANSPORT_CLASS() to do this (declared classes still must
  * be registered).
  *
- * Returns 0 on success or error on failure.
+ * Returns 0 on success or error code on failure.
  */
 int transport_class_register(struct transport_class *tclass)
 {
diff --git a/drivers/pcmcia/pcmcia_cis.c b/drivers/pcmcia/pcmcia_cis.c
index e2c9241..3c30116 100644
--- a/drivers/pcmcia/pcmcia_cis.c
+++ b/drivers/pcmcia/pcmcia_cis.c
@@ -80,7 +80,9 @@ done:
  *
  * pccard_loop_tuple() loops over all CIS entries of type @function, and
  * calls the @loop_tuple function for each entry. If the call to @loop_tuple
- * returns 0, the loop exits. Returns 0 on success or errorcode otherwise.
+ * returns 0, the loop exits.
+ *
+ * Returns 0 on success or error code on failure.
  */
 int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
 		      cisdata_t code, cisparse_t *parse, void *priv_data,
@@ -257,7 +259,9 @@ static int pcmcia_do_loop_config(tuple_t *tuple, cisparse_t *parse, void *priv)
  *
  * pcmcia_loop_config() loops over all configuration options, and calls
  * the driver-specific conf_check() for each one, checking whether
- * it is a valid one. Returns 0 on success or errorcode otherwise.
+ * it is a valid one.
+ *
+ * Returns 0 on success or error code on failure.
  */
 int pcmcia_loop_config(struct pcmcia_device *p_dev,
 		       int	(*conf_check)	(struct pcmcia_device *p_dev,
@@ -317,7 +321,9 @@ static int pcmcia_do_loop_tuple(tuple_t *tuple, cisparse_t *parse, void *priv)
  *
  * pcmcia_loop_tuple() loops over all CIS entries of type @function, and
  * calls the @loop_tuple function for each entry. If the call to @loop_tuple
- * returns 0, the loop exits. Returns 0 on success or errorcode otherwise.
+ * returns 0, the loop exits.
+ *
+ * Returns 0 on success or error code on failure.
  */
 int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
 		      int (*loop_tuple) (struct pcmcia_device *p_dev,
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index acde3f5..4c5d0c1 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -1362,7 +1362,7 @@ static int zfcp_erp_thread(void *data)
  * zfcp_erp_thread_setup - Start ERP thread for adapter
  * @adapter: Adapter to start the ERP thread for
  *
- * Returns 0 on success or error code from kernel_thread()
+ * Returns 0 on success or error code from kernel_thread() on failure.
  */
 int zfcp_erp_thread_setup(struct zfcp_adapter *adapter)
 {
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 0357f1d..0dfcacc 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -1196,10 +1196,11 @@ static void ptlrpc_save_versions(struct ptlrpc_request *req)
 
 /**
  * Callback function called when client receives RPC reply for \a req.
- * Returns 0 on success or error code.
  * The return value would be assigned to req->rq_status by the caller
  * as request processing status.
  * This function also decides if the request needs to be saved for later replay.
+ *
+ * Returns 0 on success or error code on failure.
  */
 static int after_reply(struct ptlrpc_request *req)
 {
@@ -1396,7 +1397,8 @@ static int after_reply(struct ptlrpc_request *req)
 /**
  * Helper function to send request \a req over the network for the first time
  * Also adjusts request phase.
- * Returns 0 on success or error code.
+ *
+ * Returns 0 on success or error code on failure.
  */
 static int ptlrpc_send_new_req(struct ptlrpc_request *req)
 {
@@ -2101,7 +2103,8 @@ EXPORT_SYMBOL(ptlrpc_set_next_timeout);
  * Send all unset request from the set and then wait until all
  * requests in the set complete (either get a reply, timeout, get an
  * error or otherwise be interrupted).
- * Returns 0 on success or error code otherwise.
+ *
+ * Returns 0 on success or error code on failure.
  */
 int ptlrpc_set_wait(struct ptlrpc_request_set *set)
 {
diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c
index d5fc689..fd9eb47 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/import.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/import.c
@@ -627,7 +627,8 @@ static int ptlrpc_first_transno(struct obd_import *imp, __u64 *transno)
  * Attempt to (re)connect import \a imp. This includes all preparations,
  * initializing CONNECT RPC request and passing it to ptlrpcd for
  * actual sending.
- * Returns 0 on success or error code.
+ *
+ * Returns 0 on success or error code on failure.
  */
 int ptlrpc_connect_import(struct obd_import *imp)
 {
diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c
index 2fa2585..9c33da9 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c
@@ -45,7 +45,8 @@
 /**
  * Helper function. Sends \a len bytes from \a base at offset \a offset
  * over \a conn connection to portal \a portal.
- * Returns 0 on success or error code.
+ *
+ * Returns 0 on success or error code on failure.
  */
 static int ptl_send_buf(lnet_handle_md_t *mdh, void *base, int len,
 			lnet_ack_req_t ack, struct ptlrpc_cb_id *cbid,
@@ -109,7 +110,8 @@ static void mdunlink_iterate_helper(lnet_handle_md_t *bd_mds, int count)
 
 /**
  * Register bulk at the sender for later transfer.
- * Returns 0 on success or error code.
+ *
+ * Returns 0 on success or error code on failure.
  */
 int ptlrpc_register_bulk(struct ptlrpc_request *req)
 {
@@ -348,7 +350,8 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags)
 /**
  * Send request reply from request \a req reply buffer.
  * \a flags defines reply types
- * Returns 0 on success or error code
+ *
+ * Returns 0 on success or error code on failure.
  */
 int ptlrpc_send_reply(struct ptlrpc_request *req, int flags)
 {
@@ -483,7 +486,8 @@ EXPORT_SYMBOL(ptlrpc_error);
  * Send request \a request.
  * if \a noreply is set, don't expect any reply back and don't set up
  * reply buffers.
- * Returns 0 on success or error code.
+ *
+ * Returns 0 on success or error code on failure.
  */
 int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 {
diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c
index 52a8ffe..c8f196a 100644
--- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
+++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
@@ -90,7 +90,7 @@ static u8 config_init = ACQ_MODE_EVEN;
  * @index:	index (internal address) of register to read
  * @data:	pointer to byte the read data will be placed in
  *
- * returns:	zero on success or error code
+ * returns:	0 on success or error code on failure
  *
  * This function starts reading the specified (by index) register
  * and busy waits for the process to finish. The result is placed
@@ -123,7 +123,7 @@ read_i2c_reg(void __iomem *addr, u8 index, u8 *data)
  * @index:	index (internal address) of register to read
  * @data:	data to be written
  *
- * returns:	zero on success or error code
+ * returns:	0 on success or error code on failure
  *
  * This function starts writting the specified (by index) register
  * and busy waits for the process to finish.
@@ -169,7 +169,7 @@ static void write_i2c_reg_nowait(void __iomem *addr, u8 index, u8 data)
  *
  * @addr:	dt3155 mmio base address
  *
- * returns:	zero on success or error code
+ * returns:	0 on success or error code on failure
  *
  * This function waits reading/writting to finish.
  */
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 1b3ca7a..972fc35 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -578,7 +578,7 @@ static int gfs2_initxattrs(struct inode *inode, const struct xattr *xattr_array,
  * @symname: For symlinks, this is the link destination
  * @size: The initial size of the inode (ignored for directories)
  *
- * Returns: 0 on success, or error code
+ * Returns: 0 on success or error code on failure.
  */
 
 static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
@@ -1545,7 +1545,7 @@ out:
  *
  * This can handle symlinks of any size.
  *
- * Returns: 0 on success or error code
+ * Returns: 0 on success or error code on failure.
  */
 
 static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 859c6ed..e031b52 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1166,7 +1166,7 @@ static int gfs2_statfs_i(struct gfs2_sbd *sdp, struct gfs2_statfs_change_host *s
  * @sb: The superblock
  * @statfsbuf: The buffer
  *
- * Returns: 0 on success or error code
+ * Returns: 0 on success or error code on failure.
  */
 
 static int gfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
@@ -1322,7 +1322,7 @@ static int is_ancestor(const struct dentry *d1, const struct dentry *d2)
  * @s: seq_file structure
  * @root: root of this (sub)tree
  *
- * Returns: 0 on success or error code
+ * Returns: 0 on success or error code on failure.
  */
 
 static int gfs2_show_options(struct seq_file *s, struct dentry *root)
diff --git a/include/linux/ipack.h b/include/linux/ipack.h
index 8bddc3f..dcd131a 100644
--- a/include/linux/ipack.h
+++ b/include/linux/ipack.h
@@ -218,7 +218,7 @@ void ipack_driver_unregister(struct ipack_driver *edrv);
  * function.  The rest of the fields will be allocated and populated
  * during initalization.
  *
- * Return zero on success or error code on failure.
+ * Return 0 on success or error code on failure.
  *
  * NOTE: _Never_ directly free @dev after calling this function, even
  * if it returned an error! Always use ipack_put_device() to give up the
@@ -233,7 +233,7 @@ int ipack_device_init(struct ipack_device *dev);
  * Add a new IPack device. The call is done by the carrier driver
  * after calling ipack_device_init().
  *
- * Return zero on success or error code on failure.
+ * Return 0 on success or error code on failure.
  *
  * NOTE: _Never_ directly free @dev after calling this function, even
  * if it returned an error! Always use ipack_put_device() to give up the
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 1e306f7..fa0d52f 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -41,7 +41,7 @@
  *		include a NULL entry for vqs that do not need a callback
  *	names: array of virtqueue names (mainly for debugging)
  *		include a NULL entry for vqs unused by driver
- *	Returns 0 on success or error status
+ *	Returns 0 on success or error code on failure.
  * @del_vqs: free virtqueues found by find_vqs().
  * @get_features: get the array of feature bits for this device.
  *	vdev: the virtio_device
diff --git a/include/linux/vringh.h b/include/linux/vringh.h
index a3fa537..db6b4c1 100644
--- a/include/linux/vringh.h
+++ b/include/linux/vringh.h
@@ -64,7 +64,7 @@ struct vringh {
  *	hvrs: on success, includes new host vrings
  *	callbacks: array of driver callbacks, for each host vring
  *		include a NULL entry for vqs that do not need a callback
- *	Returns 0 on success or error status
+ *	Returns 0 on success or error code on failure.
  * @del_vrhs: free the host vrings found by find_vrhs().
  */
 struct virtio_device;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux