Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751912Ab3J1EiK (ORCPT ); Mon, 28 Oct 2013 00:38:10 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:56299 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998Ab3J1EiJ (ORCPT ); Mon, 28 Oct 2013 00:38:09 -0400 Date: Mon, 28 Oct 2013 00:38:07 -0400 (EDT) Message-Id: <20131028.003807.1591686723281776238.davem@davemloft.net> To: stephen@networkplumber.org Cc: zwu.kernel@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, wuzhy@linux.vnet.ibm.com Subject: Re: [PATCH 1/3] vxlan: silence one build warning From: David Miller In-Reply-To: <20131025084134.6cfa153a@samsung-9> References: <1382687360-27794-1-git-send-email-zwu.kernel@gmail.com> <20131025084134.6cfa153a@samsung-9> X-Mailer: Mew version 6.5 on Emacs 24.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.1 (shards.monkeyblade.net [0.0.0.0]); Sun, 27 Oct 2013 21:38:08 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 751 Lines: 20 From: Stephen Hemminger Date: Fri, 25 Oct 2013 08:41:34 -0700 > I would rather not fix the warning this way since it risks masking > later bugs if this code ever changes. But this is suboptimally coded, and is asking for the warning. Anything returning a pointer by reference is asking for trouble in my opinion. The correct thing to do is to make create_v{4,6}_sock() return the "struct socket *" as an error pointer. No more ambiguous initializations, no more warnings. -- 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/