lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1011042357380.16015@swampdragon.chaosbits.net>
Date:	Fri, 5 Nov 2010 00:01:07 +0100 (CET)
From:	Jesper Juhl <jj@...osbits.net>
To:	Charles Manning <cdhmanning@...il.com>
cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 2/9] Add yaffs allocator, bitmap and attrib source

On Thu, 4 Nov 2010, cdhmanning@...il.com wrote:
[snip]
> +void yaffs_free_raw_obj(struct yaffs_dev *dev, struct yaffs_obj *obj)
> +{
> +      
> +     struct yaffs_allocator *allocator = dev->allocator;
> +     
> +     if (!allocator)
> +             YBUG();
> +     else {
> +             /* Link into the free list. */
> +             obj->siblings.next = (struct list_head *)(allocator->free_objs);
> +             allocator->free_objs = obj;
> +             allocator->n_free_objects++;
> +     }
> +}
> +             
> +void yaffs_deinit_raw_tnodes_and_objs(struct yaffs_dev *dev)
> +{
> +     if (dev->allocator) {
> +             yaffs_deinit_raw_tnodes(dev);
> +             yaffs_deinit_raw_objs(dev);
> +     
> +             YFREE(dev->allocator);
> +             dev->allocator = NULL;
> +     } else
> +             YBUG();
> +}
> +             
> +void yaffs_init_raw_tnodes_and_objs(struct yaffs_dev *dev)
> +{
> +     struct yaffs_allocator *allocator;  
> +      
> +     if (!dev->allocator) {
> +             allocator = YMALLOC(sizeof(struct yaffs_allocator));
> +             if (allocator) {
> +                     dev->allocator = allocator;
> +                     yaffs_init_raw_tnodes(dev);
> +                     yaffs_init_raw_objs(dev);
> +             }
> +     } else
> +             YBUG();
> +}

Tiny style issue; Documentation/CodingStyle says:

"Do not unnecessarily use braces where a single statement will do.

if (condition)
        action();

This does not apply if one branch of a conditional statement is a single
statement. Use braces in both branches.

if (condition) {
        do_this();
        do_that();
} else {
        otherwise();
}
"

So, in the above, you should have curly braces around both the 'if' and 
'else' parts since one of them is more than one statement.



-- 
Jesper Juhl <jj@...osbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ