Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932347AbbFEC6U (ORCPT ); Thu, 4 Jun 2015 22:58:20 -0400 Received: from ozlabs.org ([103.22.144.67]:51869 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754087AbbFEC6Q (ORCPT ); Thu, 4 Jun 2015 22:58:16 -0400 From: Rusty Russell To: Tejun Heo Cc: Louis Langholtz , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: kernel/params.c: 'err' variable "set but not used" and perhaps should be? In-Reply-To: <20150604203034.GS20091@mtj.duckdns.org> References: <87vbf628uy.fsf@rustcorp.com.au> <7E8FFE0D-B9F7-4816-8ECF-2AA5980F3890@me.com> <20150603202237.GI20091@mtj.duckdns.org> <87eglsuujn.fsf@rustcorp.com.au> <20150604021935.GN20091@mtj.duckdns.org> <878ubzuuhe.fsf@rustcorp.com.au> <20150604203034.GS20091@mtj.duckdns.org> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Fri, 05 Jun 2015 10:09:29 +0930 Message-ID: <87oakvt2da.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1068 Lines: 28 Tejun Heo writes: > On Fri, Jun 05, 2015 at 05:16:53AM +0930, Rusty Russell wrote: >> Tejun Heo writes: >> > On Thu, Jun 04, 2015 at 11:03:16AM +0930, Rusty Russell wrote: >> >> Please describe the circumstances under which this function can fail. >> > >> > Allocation failure obviously >> >> Won't happen here, this is a boot-time function. version_sysfs_builtin. >> The __init is the clue. > > Yes, that's this one callsite. There are whole others which can fail. > Just add WARN_ON here. What are you arguing? What will a second warning which is never triggered achieve? A bit of code bloat and confusion, when I really do want to ignore the value. I've asked (again) for gcc to allow cast to void: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 Thanks, Rusty. -- 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/