From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757803AbYBDXnc (ORCPT ); Mon, 4 Feb 2008 18:43:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755831AbYBDXnZ (ORCPT ); Mon, 4 Feb 2008 18:43:25 -0500 Received: from gprs189-60.eurotel.cz ([160.218.189.60]:51232 "EHLO amd.ucw.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755143AbYBDXnY (ORCPT ); Mon, 4 Feb 2008 18:43:24 -0500 Date: Tue, 5 Feb 2008 00:43:43 +0100 From: Pavel Machek To: Andrew Morton , kernel list Subject: CodingStyle: provide good example Message-ID: <20080204234343.GA1901@elf.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org if (!buffer) is actually prefered style, so lets use it in example. Pavel Signed-off-by: Pavel Machek diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 6caa146..9bb2d8a 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle @@ -406,7 +415,7 @@ int fun(int a) int result = 0; char *buffer = kmalloc(SIZE); - if (buffer == NULL) + if (!buffer) return -ENOMEM; if (condition1) { -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html