Received: by 10.213.65.68 with SMTP id h4csp296137imn; Fri, 16 Mar 2018 03:29:42 -0700 (PDT) X-Google-Smtp-Source: AG47ELtFiI8eeuTE83XD+dZdGu22NeqpGRs8Z8+EMJsjLfw8IZV8edz0SLbXFm8F/cG+1lCm84Is X-Received: by 2002:a17:902:8603:: with SMTP id f3-v6mr1580070plo.37.1521196182076; Fri, 16 Mar 2018 03:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521196182; cv=none; d=google.com; s=arc-20160816; b=iY7L3mpb4Gg76rzRqPZN0hn5XN3MPwNb/dFKbt4D/8md2Kp1jDr+JiQbM8ZZ2oDepV waEjkzIpKWNXzHi9PXHhS6OvZlYPc+zb/qWOwLMMreugUzC+pzF1wFdPF5tbbmWetb+p h0iJYj9GVO9MhWv+1uVcnuNnHaVoXIXX1/Ov77IqMbo+2sEBxDRCjJjtkQExVDKQnHNp 33zZVrG12yawyWm5flzLFyUmcwMGeeyGQrDxyyoajHXx3EE2yf6vU7wJ0RIsTh2mHIld fuX7OD6Zd8uOo58M/nBCG5tzQ4cgSGncfs43vURUrzXZbOWIhUselRtHO4VCJVQhPRvz huEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=4S9Ky2uFBgtlT5n1kP2u8NY+lkfAKTdxv64wHsBHq08=; b=r5/EeD2vbNoUlD28eG9uUjvYpKvJu99cUt9kl6TJspEDyS4FYwI+FONQmAERxdggDH NWKFz2YL97+x7T4pkcfetmmU3HSf5pyUTYoHRLtHuHP8UKy2OER9Zrp9aHOzsqNGvbtk s6153qN+MngwJ+Uo8APFQvSGbzBS6XRV3sc3Pnee0L+00ydJEVpMqOSQTzFcSlzSdtn6 absKc5AaoiOARfkVNbGLrdRbj2ElmAR24eV/Cdb99A4HNlNMN740DVpzuR+mIWaW9nJv gLOOUZ6LUHF5stXnkgm9W0MujBwv3ozBlzBLRm5C+m7eIsCaH+ZclIi3x1n5WpjnbRYn iBlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si4847053pgt.246.2018.03.16.03.29.27; Fri, 16 Mar 2018 03:29:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225AbeCPK1A (ORCPT + 99 others); Fri, 16 Mar 2018 06:27:00 -0400 Received: from ozlabs.org ([103.22.144.67]:34451 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbeCPK06 (ORCPT ); Fri, 16 Mar 2018 06:26:58 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 402hTV6Ltrz9s8y; Fri, 16 Mar 2018 21:26:54 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Dan Carpenter , Thiago Jung Bauermann Cc: SF Markus Elfring , linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Borislav Petkov , Brijesh Singh , Josh Sklar , Kees Cook , Paul Mackerras , Thomas Gleixner , Tom Lendacky , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH] powerpc: Use common error handling code in setup_new_fdt() In-Reply-To: <20180315115753.rjejlkrp3fhdxbyk@mwanda> References: <0dd9d938-8d89-f0e0-f05f-9a3e5dc42a57@users.sourceforge.net> <87fu52jqtc.fsf@morokweng.localdomain> <20180315115753.rjejlkrp3fhdxbyk@mwanda> Date: Fri, 16 Mar 2018 21:26:53 +1100 Message-ID: <87bmfofh8y.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dan Carpenter writes: > On Wed, Mar 14, 2018 at 06:22:07PM -0300, Thiago Jung Bauermann wrote: >> SF Markus Elfring writes: >> > From: Markus Elfring >> > Date: Sun, 11 Mar 2018 09:03:42 +0100 >> > >> > Add a jump target so that a bit of exception handling can be better reused >> > at the end of this function. >> > >> > This issue was detected by using the Coccinelle software. >> > >> > Signed-off-by: Markus Elfring >> > --- >> > arch/powerpc/kernel/machine_kexec_file_64.c | 28 ++++++++++++---------------- >> > 1 file changed, 12 insertions(+), 16 deletions(-) >> >> I liked it. Thanks! >> >> Reviewed-by: Thiago Jung Bauermann > > You know that compilers already re-use string constants so this doesn't > actually save memory? Sure, but it's still clearer to only have the string appear once in the code. > Also we should be preserving the error codes > instead of always returning -EINVAL. The error codes come from libfdt code, so they don't necessarily make sense in the kernel. eg. FDT_ERR_NOSPACE == 3 == ESRCH. Perhaps we should be trying harder to convert them, but that's a criticism of the original code not this patch. cheers