From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751759AbdJXOmi (ORCPT ); Tue, 24 Oct 2017 10:42:38 -0400 Received: from smtprelay0177.hostedemail.com ([216.40.44.177]:49686 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751318AbdJXOmc (ORCPT ); Tue, 24 Oct 2017 10:42:32 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:973:981:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3871:3872:3874:4321:5007:7903:8660:9010:9707:10004:10400:10848:11232:11658:11914:12114:12740:12760:12895:13069:13148:13230:13255:13311:13357:13439:14096:14097:14659:21080:21433:21434:21627:30012:30054:30055:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: actor69_15c49cc3ccc31 X-Filterd-Recvd-Size: 2227 Message-ID: <1508856148.1955.12.camel@perches.com> Subject: Re: drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer() From: Joe Perches To: Dan Carpenter , Garry Hurley Cc: SF Markus Elfring , Jani Nikula , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, Joonas Lahtinen , kernel-janitors@vger.kernel.org, LKML , Rodrigo Vivi , Zhi Wang Date: Tue, 24 Oct 2017 07:42:28 -0700 In-Reply-To: <20171024142615.t3y5atz6nulkq55h@mwanda> References: <87efpsiu7r.fsf@intel.com> <636f6272-9074-53dc-2c90-cbb4a7cd0901@users.sourceforge.net> <1A433E6A-DE06-4407-9E33-3CBBA4ADF01B@gmail.com> <20171024142615.t3y5atz6nulkq55h@mwanda> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-10-24 at 17:26 +0300, Dan Carpenter wrote: > The point of unwind code is to undo what was done earlier. If a > function allocates a list of things, using standard unwind style makes > it simpler, safer and more readable. > > This isn't the case here. Instead of making the code more readable, > we're making it more convoluted. It's just that two out of three error > messages happened to be the same and Markus wants to save a bit of > memory by using the same string. The memory savings is not so big that > it's worth making the code less readable. I agree with Dan. It doesn't save any real memory either as the compiler/linker reuses the repeated string. It might, depending on the compiler, save a few bytes of object code as the compiler may not optimize the repeated call away though. But a good compiler could do that too.