From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: [PATCH net-next 0/2] rtnetlink: avoid a warning in rtnl_newlink() Date: Tue, 27 Nov 2018 22:32:29 -0800 Message-ID: <20181128063231.12907-1-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: dsahern@gmail.com, jiri@resnulli.us, roopa@cumulusnetworks.com, christian.brauner@ubuntu.com, netdev@vger.kernel.org, oss-drivers@netronome.com, Jakub Kicinski To: davem@davemloft.net Return-path: Received: from mail-pf1-f172.google.com ([209.85.210.172]:46636 "EHLO mail-pf1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbeK1Rel (ORCPT ); Wed, 28 Nov 2018 12:34:41 -0500 Received: by mail-pf1-f172.google.com with SMTP id c73so9660062pfe.13 for ; Tue, 27 Nov 2018 22:34:09 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: Hi! I've been hoping for some time that someone more competent would fix the stack frame size warning in rtnl_newlink(), but looks like I'll have to take a stab at it myself :) That's the only warning I see in most of my builds. First patch refactors away a somewhat surprising if (1) code block. Reindentation will most likely cause cherry-pick problems but OTOH rtnl_newlink() doesn't seem to be changed often, so perhaps we can risk it in the name of cleaner code? Second patch fixes the warning in simplest possible way. I was pondering if there is any more clever solution, but I can't see it.. rtnl_newlink() is quite long with a lot of possible execution paths so doing memory allocations half way through leads to very ugly results. Jakub Kicinski (2): rtnetlink: remove a level of indentation in rtnl_newlink() rtnetlink: avoid frame size warning in rtnl_newlink() net/core/rtnetlink.c | 331 ++++++++++++++++++++++--------------------- 1 file changed, 170 insertions(+), 161 deletions(-) -- 2.17.1