From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Garry Hurley <garry.hurley.jr@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
dri-devel@lists.freedesktop.org,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
intel-gvt-dev@lists.freedesktop.org,
SF Markus Elfring <elfring@users.sourceforge.net>
Subject: Re: drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer()
Date: Tue, 24 Oct 2017 14:42:28 +0000 [thread overview]
Message-ID: <1508856148.1955.12.camel@perches.com> (raw)
In-Reply-To: <20171024142615.t3y5atz6nulkq55h@mwanda>
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.
WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Garry Hurley <garry.hurley.jr@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
dri-devel@lists.freedesktop.org,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
intel-gvt-dev@lists.freedesktop.org,
SF Markus Elfring <elfring@users.sourceforge.net>
Subject: Re: drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer()
Date: Tue, 24 Oct 2017 07:42:28 -0700 [thread overview]
Message-ID: <1508856148.1955.12.camel@perches.com> (raw)
In-Reply-To: <20171024142615.t3y5atz6nulkq55h@mwanda>
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.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Garry Hurley <garry.hurley.jr@gmail.com>
Cc: SF Markus Elfring <elfring@users.sourceforge.net>,
Jani Nikula <jani.nikula@linux.intel.com>,
dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
intel-gvt-dev@lists.freedesktop.org,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Zhi Wang <zhi.a.wang@intel.com>
Subject: Re: drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer()
Date: Tue, 24 Oct 2017 07:42:28 -0700 [thread overview]
Message-ID: <1508856148.1955.12.camel@perches.com> (raw)
In-Reply-To: <20171024142615.t3y5atz6nulkq55h@mwanda>
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.
next prev parent reply other threads:[~2017-10-24 14:42 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 12:25 [PATCH] drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer() SF Markus Elfring
2017-10-24 12:25 ` SF Markus Elfring
2017-10-24 12:25 ` SF Markus Elfring
2017-10-24 12:52 ` Jani Nikula
2017-10-24 12:52 ` Jani Nikula
2017-10-24 12:52 ` Jani Nikula
2017-10-24 13:17 ` SF Markus Elfring
2017-10-24 13:17 ` SF Markus Elfring
2017-10-24 13:54 ` Garry Hurley
2017-10-24 13:54 ` Garry Hurley
2017-10-24 13:54 ` Garry Hurley
2017-10-24 14:26 ` Dan Carpenter
2017-10-24 14:26 ` Dan Carpenter
2017-10-24 14:26 ` Dan Carpenter
2017-10-24 14:40 ` SF Markus Elfring
2017-10-24 14:40 ` SF Markus Elfring
2017-10-24 14:40 ` SF Markus Elfring
2017-10-24 14:42 ` Joe Perches [this message]
2017-10-24 14:42 ` Joe Perches
2017-10-24 14:42 ` Joe Perches
2017-10-24 14:51 ` SF Markus Elfring
2017-10-24 14:51 ` SF Markus Elfring
2017-10-24 14:51 ` SF Markus Elfring
2017-10-24 14:56 ` Joe Perches
2017-10-24 14:56 ` Joe Perches
2017-10-24 14:56 ` Joe Perches
2017-10-24 15:01 ` SF Markus Elfring
2017-10-24 15:01 ` SF Markus Elfring
2017-10-24 15:01 ` SF Markus Elfring
2017-10-24 15:14 ` Daniele Nicolodi
2017-10-24 15:14 ` Daniele Nicolodi
2017-10-24 18:56 ` [PATCH] " Wang, Zhi A
2017-10-24 18:56 ` Wang, Zhi A
2017-10-24 18:56 ` Wang, Zhi A
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508856148.1955.12.camel@perches.com \
--to=joe@perches.com \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=elfring@users.sourceforge.net \
--cc=garry.hurley.jr@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.