Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754322AbbFWJ5g (ORCPT ); Tue, 23 Jun 2015 05:57:36 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:46522 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752310AbbFWJ52 (ORCPT ); Tue, 23 Jun 2015 05:57:28 -0400 Date: Tue, 23 Jun 2015 12:57:04 +0300 From: Dan Carpenter To: Julia Lawall Cc: "devel@driverdev.osuosl.org" , "Dilger, Andreas" , Greg Kroah-Hartman , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Drokin, Oleg" , "lustre-devel@lists.lustre.org" Subject: Re: [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure Message-ID: <20150623095704.GO28762@mwanda> References: <1434819550-3193-1-git-send-email-Julia.Lawall@lip6.fr> <1434819550-3193-2-git-send-email-Julia.Lawall@lip6.fr> <20150623092303.GN28762@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1072 Lines: 25 Yes. I know Al's thoughts and kernel style. But Alan Cox and Andreas have both said they think (x == NULL) can help you avoid some kind of boolean vs pointer bugs. I've had co-workers who did massive seds changing !foo to foo == NULL on our code base. But I've never seen a real life example of a bug this fixes. To be honest, I've never seen a real life proof that (!foo) code is less buggy. I should look through the kbuild mailbox... Hm... But my other idea of setting up code style readability testing website is also a good one. Linux kernel style is based on Joe Perches finding that 80% of the code prefers one way or the other. That's a valid method for determining code style. I bet it normally picks the more readable style but it would be interesting to measure it more formally. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/