All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tyler Hicks <tyhicks@canonical.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: ecryptfs@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ecryptfs: remove check for if an array is NULL
Date: Fri, 6 Sep 2013 17:30:39 -0700	[thread overview]
Message-ID: <20130907003039.GO3853@boyd> (raw)
In-Reply-To: <20130731091010.GA2131@elgon.mountain>

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

On 2013-07-31 12:10:10, Dan Carpenter wrote:
> It doesn't make sense to check if an array is NULL.  The compiler just
> removes the check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, Dan!

I've pushed this to my next branch and it will be part of a pull request
that should go out early next week.

Tyler

> ---
> Or perhaps "if (!strlen(crypt_stat->cipher))" was intended?  I'm not
> very familiar with this code.
> 
> diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
> index d107576..3bd35e2 100644
> --- a/fs/ecryptfs/crypto.c
> +++ b/fs/ecryptfs/crypto.c
> @@ -609,10 +609,6 @@ int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat)
>  	char *full_alg_name;
>  	int rc = -EINVAL;
>  
> -	if (!crypt_stat->cipher) {
> -		ecryptfs_printk(KERN_ERR, "No cipher specified\n");
> -		goto out;
> -	}
>  	ecryptfs_printk(KERN_DEBUG,
>  			"Initializing cipher [%s]; strlen = [%d]; "
>  			"key_size_bits = [%zd]\n",

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Tyler Hicks <tyhicks@canonical.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] ecryptfs: remove check for if an array is NULL
Date: Sat, 07 Sep 2013 00:30:39 +0000	[thread overview]
Message-ID: <20130907003039.GO3853@boyd> (raw)

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

On 2013-07-31 12:10:10, Dan Carpenter wrote:
> It doesn't make sense to check if an array is NULL.  The compiler just
> removes the check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, Dan!

I've pushed this to my next branch and it will be part of a pull request
that should go out early next week.

Tyler

> ---
> Or perhaps "if (!strlen(crypt_stat->cipher))" was intended?  I'm not
> very familiar with this code.
> 
> diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
> index d107576..3bd35e2 100644
> --- a/fs/ecryptfs/crypto.c
> +++ b/fs/ecryptfs/crypto.c
> @@ -609,10 +609,6 @@ int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat)
>  	char *full_alg_name;
>  	int rc = -EINVAL;
>  
> -	if (!crypt_stat->cipher) {
> -		ecryptfs_printk(KERN_ERR, "No cipher specified\n");
> -		goto out;
> -	}
>  	ecryptfs_printk(KERN_DEBUG,
>  			"Initializing cipher [%s]; strlen = [%d]; "
>  			"key_size_bits = [%zd]\n",

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-09-07  0:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31  9:10 [patch] ecryptfs: remove check for if an array is NULL Dan Carpenter
2013-07-31  9:10 ` Dan Carpenter
2013-09-07  0:30 ` Tyler Hicks [this message]
2013-09-07  0:30   ` Tyler Hicks

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=20130907003039.GO3853@boyd \
    --to=tyhicks@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=ecryptfs@vger.kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.