From: Jan Kara <jack@suse.cz>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
David Howells <dhowells@redhat.com>,
Ingo Molnar <mingo@kernel.org>, Jan Kara <jack@suse.cz>,
kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] isofs: Adjust four checks for null pointers
Date: Mon, 21 Aug 2017 14:06:31 +0000 [thread overview]
Message-ID: <20170821140631.GC31870@quack2.suse.cz> (raw)
In-Reply-To: <b2d3ec4f-065a-84b8-c85d-8d7f9741d458@users.sourceforge.net>
On Sat 19-08-17 09:17:28, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 18 Aug 2017 21:47:14 +0200
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> The script “checkpatch.pl” pointed information out like the following.
>
> Comparison to NULL could be written !…
>
> Thus fix the affected source code places.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Thanks. Applied to my tree.
Honza
> ---
> fs/isofs/inode.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
> index 2d3f090944df..db43f52f2268 100644
> --- a/fs/isofs/inode.c
> +++ b/fs/isofs/inode.c
> @@ -96,7 +96,7 @@ static int __init init_inodecache(void)
> 0, (SLAB_RECLAIM_ACCOUNT|
> SLAB_MEM_SPREAD|SLAB_ACCOUNT),
> init_once);
> - if (isofs_inode_cachep = NULL)
> + if (!isofs_inode_cachep)
> return -ENOMEM;
> return 0;
> }
> @@ -678,7 +678,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
> if (isonum_711(vdp->type) = ISO_VD_END)
> break;
> if (isonum_711(vdp->type) = ISO_VD_PRIMARY) {
> - if (pri = NULL) {
> + if (!pri) {
> pri = (struct iso_primary_descriptor *)vdp;
> /* Save the buffer in case we need it ... */
> pri_bh = bh;
> @@ -742,7 +742,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
> goto out_freebh;
> }
>
> - if (joliet_level && (pri = NULL || !opt.rock)) {
> + if (joliet_level && (!pri || !opt.rock)) {
> /* This is the case of Joliet with the norock mount flag.
> * A disc with both Joliet and Rock Ridge is handled later
> */
> @@ -1320,5 +1320,5 @@ static int isofs_read_inode(struct inode *inode, int relocated)
> int frag1 = bufsize - offset;
>
> tmpde = kmalloc(de_len, GFP_KERNEL);
> - if (tmpde = NULL) {
> + if (!tmpde) {
> ret = -ENOMEM;
> --
> 2.14.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2017-08-21 14:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-19 7:14 [PATCH 0/4] ISOFS: Adjustments for three function implementations SF Markus Elfring
2017-08-19 7:15 ` [PATCH 1/4] isofs: Delete an error message for a failed memory allocation in isofs_read_inode() SF Markus Elfring
2017-08-21 14:06 ` Jan Kara
2017-08-19 7:17 ` [PATCH 2/4] isofs: Adjust four checks for null pointers SF Markus Elfring
2017-08-21 14:06 ` Jan Kara [this message]
2017-08-19 7:18 ` [PATCH 3/4] isofs: One check less in isofs_read_inode() after error detection SF Markus Elfring
2017-08-21 14:11 ` Jan Kara
2017-08-21 14:18 ` SF Markus Elfring
2017-08-22 10:48 ` Jan Kara
2017-08-19 7:19 ` [PATCH 4/4] isofs: Delete an unnecessary variable initialisation in isofs_read_inode() SF Markus Elfring
2017-08-21 14:12 ` Jan Kara
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=20170821140631.GC31870@quack2.suse.cz \
--to=jack@suse.cz \
--cc=dhowells@redhat.com \
--cc=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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