driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: linux-fsdevel@vger.kernel.org, gregkh@linuxfoundation.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 8/9] staging: exfat: Collapse redundant return code translations
Date: Wed, 13 Nov 2019 21:19:04 +0300	[thread overview]
Message-ID: <20191113181904.GD3284@kadam> (raw)
In-Reply-To: <20191112021000.42091-9-Valdis.Kletnieks@vt.edu>

On Mon, Nov 11, 2019 at 09:09:56PM -0500, Valdis Kletnieks wrote:
> Now that we no longer use odd internal return codes, we can
> heave the translation code over the side, and just pass the
> error code back up the call chain.
> 
> Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
> ---
>  drivers/staging/exfat/exfat_super.c | 92 +++++------------------------
>  1 file changed, 14 insertions(+), 78 deletions(-)
> 
> diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c
> index 5d538593b5f6..a97a61a60517 100644
> --- a/drivers/staging/exfat/exfat_super.c
> +++ b/drivers/staging/exfat/exfat_super.c
> @@ -650,7 +650,7 @@ static int ffsCreateFile(struct inode *inode, char *path, u8 mode,
>  	struct uni_name_t uni_name;
>  	struct super_block *sb = inode->i_sb;
>  	struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
> -	int ret;
> +	int ret = 0;

Why are you adding this initializer?  It just disables static analysis
warnings about uninitialized variables and it creates a static analysis
warning about unused assignments.

>  
>  	/* check the validity of pointer parameters */
>  	if (!fid || !path || (*path == '\0'))

[ snip ]

> @@ -3161,12 +3102,7 @@ static int exfat_bmap(struct inode *inode, sector_t sector, sector_t *phys,
>  
>  	err = ffsMapCluster(inode, clu_offset, &cluster);
>  
> -	if (err) {
> -		if (err == -ENOSPC)
> -			return -ENOSPC;
> -		else
> -			return -EIO;
> -	} else if (cluster != CLUSTER_32(~0)) {
> +	if (!err && (cluster != CLUSTER_32(~0))) {
>  		*phys = START_SECTOR(cluster) + sec_offset;
>  		*mapped_blocks = p_fs->sectors_per_clu - sec_offset;
>  	}


If ffsMapCluster() fails then we return success now.  Is that
intentional?

regards,
dan carpener

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2019-11-13 18:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191112021000.42091-1-Valdis.Kletnieks@vt.edu>
2019-11-12  2:09 ` [PATCH v3 1/9] staging: exfat: Clean up return codes - FFS_FORMATERR Valdis Kletnieks
2019-11-12  2:09 ` [PATCH v3 2/9] staging: exfat: Clean up return codes - FFS_MEDIAERR Valdis Kletnieks
2019-11-12  2:09 ` [PATCH v3 3/9] staging: exfat: Clean up return codes - FFS_EOF Valdis Kletnieks
2019-11-12  2:09 ` [PATCH v3 4/9] staging: exfat: Clean up return codes - FFS_INVALIDFID Valdis Kletnieks
2019-11-12  2:09 ` [PATCH v3 5/9] staging: exfat: Clean up return codes - FFS_ERROR Valdis Kletnieks
2019-11-12  2:09 ` [PATCH v3 6/9] staging: exfat: Clean up return codes - remove unused codes Valdis Kletnieks
2019-11-12  2:09 ` [PATCH v3 7/9] staging: exfat: Clean up return codes - FFS_SUCCESS Valdis Kletnieks
2019-11-12  2:09 ` [PATCH v3 8/9] staging: exfat: Collapse redundant return code translations Valdis Kletnieks
2019-11-13 18:19   ` Dan Carpenter [this message]
2019-11-12  2:09 ` [PATCH v3 9/9] staging: exfat: Correct return code Valdis Kletnieks

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=20191113181904.GD3284@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=valdis.kletnieks@vt.edu \
    /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;
as well as URLs for NNTP newsgroup(s).