From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH] kvm tool: rewrite kvm__init Date: Thu, 09 Feb 2012 23:53:08 -0500 Message-ID: <1328849588.3876.1.camel@lappy> References: <1328766016-2644-1-git-send-email-hamo.by@gmail.com> <20120209130741.GG5709@moon> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Cyrill Gorcunov , Pekka Enberg , kvm@vger.kernel.org, Asias He , Ingo Molnar To: Yang Bai Return-path: Received: from mail-tul01m020-f174.google.com ([209.85.214.174]:61178 "EHLO mail-tul01m020-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932341Ab2BJCyE (ORCPT ); Thu, 9 Feb 2012 21:54:04 -0500 Received: by obcva7 with SMTP id va7so3222280obc.19 for ; Thu, 09 Feb 2012 18:54:04 -0800 (PST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2012-02-10 at 10:34 +0800, Yang Bai wrote: > On Thu, Feb 9, 2012 at 9:07 PM, Cyrill Gorcunov wrote: > > On Thu, Feb 09, 2012 at 03:01:26PM +0200, Pekka Enberg wrote: > >> On Thu, Feb 9, 2012 at 7:40 AM, Yang Bai wrote: > >> > Since the different issues have been handled in the > >> > internal of kvm__init, it can only return NULL if error > >> > happened. > >> > > >> > Signed-off-by: Yang Bai > >> > >> Sorry, I don't understand what this patch is attempting to fix? Why do > >> you think it's better to drop the explicit error codes and always > >> return NULL upon error? > >> > > Ok. Since the different issues have been handled in the internal of > this function and the caller does not care about the real error > reasons. So just return NULL if error will simplify the error handle > of the caller. Um... why doesn't the caller care about the real error? It's whats being sent back to userspace and can help the caller determine whats going on. -- Sasha.