From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>,
Dmitry Fleytman <dmitry.fleytman@gmail.com>,
qemu-trivial@nongnu.org, Jason Wang <jasowang@redhat.com>,
Christian Schoenebeck <qemu_oss@crudebyte.com>,
Greg Kurz <groug@kaod.org>,
qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH v2 2/9] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss
Date: Thu, 5 Mar 2020 13:54:34 +0000 [thread overview]
Message-ID: <20200305135434.GC2112347@redhat.com> (raw)
In-Reply-To: <b534a8ed-82dd-040f-a48e-9ba8c8c31db0@redhat.com>
On Thu, Mar 05, 2020 at 02:49:37PM +0100, Philippe Mathieu-Daudé wrote:
> On 3/5/20 2:44 PM, Stefano Garzarella wrote:
> > On Thu, Mar 05, 2020 at 01:45:18PM +0100, Philippe Mathieu-Daudé wrote:
> > > This buffer is only used by the adlib audio device. Move it to
> > > the .heap to release 32KiB of .bss (size reported on x86_64 host).
> > >
> > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > > ---
> > > hw/audio/fmopl.c | 4 +++-
> > > 1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c
> > > index 173a7521f2..356d4dfbca 100644
> > > --- a/hw/audio/fmopl.c
> > > +++ b/hw/audio/fmopl.c
> > > @@ -186,7 +186,7 @@ static int32_t *VIB_TABLE;
> > > /* envelope output curve table */
> > > /* attack + decay + OFF */
> > > -static int32_t ENV_CURVE[2*EG_ENT+1];
> > > +static int32_t *ENV_CURVE;
> > > /* multiple table */
> > > #define ML 2
> > > @@ -1090,6 +1090,7 @@ FM_OPL *OPLCreate(int clock, int rate)
> > > OPL->clock = clock;
> > > OPL->rate = rate;
> > > OPL->max_ch = max_ch;
> > > + ENV_CURVE = g_new(int32_t, 2 * EG_ENT + 1);
> > > /* init grobal tables */
> > > OPL_initialize(OPL);
> > > /* reset chip */
> > > @@ -1127,6 +1128,7 @@ void OPLDestroy(FM_OPL *OPL)
> > > #endif
> > > OPL_UnLockTable();
> > > free(OPL);
> > > + g_free(ENV_CURVE);
> >
> > Just for curiosity, here the entire fmopl.c is indented with tabs.
> >
> > In this case, is it better to continue with the tabs or use spaces
> > for new changes?
>
> checkpatch.pl doesn't allow us to use spaces.
ITYM 'tabs' here.
IMHO this is a case where the cure is worse than the disease.
In priority order I think we generally rank:
* Exclusive use of space indent (best)
* Exclusive use of tab indent (bad)
* Mixture of space & tab indent (terrible)
IOW, this is a case where I would suggest either:
- Have a cleanup commit first that eliminates all tabs
or
- Continue to use tabs consistently & ignore checkpatch
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
WARNING: multiple messages have this Message-ID (diff)
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Dmitry Fleytman <dmitry.fleytman@gmail.com>,
qemu-trivial@nongnu.org, Jason Wang <jasowang@redhat.com>,
Christian Schoenebeck <qemu_oss@crudebyte.com>,
Greg Kurz <groug@kaod.org>,
qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [PATCH v2 2/9] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss
Date: Thu, 5 Mar 2020 13:54:34 +0000 [thread overview]
Message-ID: <20200305135434.GC2112347@redhat.com> (raw)
In-Reply-To: <b534a8ed-82dd-040f-a48e-9ba8c8c31db0@redhat.com>
On Thu, Mar 05, 2020 at 02:49:37PM +0100, Philippe Mathieu-Daudé wrote:
> On 3/5/20 2:44 PM, Stefano Garzarella wrote:
> > On Thu, Mar 05, 2020 at 01:45:18PM +0100, Philippe Mathieu-Daudé wrote:
> > > This buffer is only used by the adlib audio device. Move it to
> > > the .heap to release 32KiB of .bss (size reported on x86_64 host).
> > >
> > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > > ---
> > > hw/audio/fmopl.c | 4 +++-
> > > 1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c
> > > index 173a7521f2..356d4dfbca 100644
> > > --- a/hw/audio/fmopl.c
> > > +++ b/hw/audio/fmopl.c
> > > @@ -186,7 +186,7 @@ static int32_t *VIB_TABLE;
> > > /* envelope output curve table */
> > > /* attack + decay + OFF */
> > > -static int32_t ENV_CURVE[2*EG_ENT+1];
> > > +static int32_t *ENV_CURVE;
> > > /* multiple table */
> > > #define ML 2
> > > @@ -1090,6 +1090,7 @@ FM_OPL *OPLCreate(int clock, int rate)
> > > OPL->clock = clock;
> > > OPL->rate = rate;
> > > OPL->max_ch = max_ch;
> > > + ENV_CURVE = g_new(int32_t, 2 * EG_ENT + 1);
> > > /* init grobal tables */
> > > OPL_initialize(OPL);
> > > /* reset chip */
> > > @@ -1127,6 +1128,7 @@ void OPLDestroy(FM_OPL *OPL)
> > > #endif
> > > OPL_UnLockTable();
> > > free(OPL);
> > > + g_free(ENV_CURVE);
> >
> > Just for curiosity, here the entire fmopl.c is indented with tabs.
> >
> > In this case, is it better to continue with the tabs or use spaces
> > for new changes?
>
> checkpatch.pl doesn't allow us to use spaces.
ITYM 'tabs' here.
IMHO this is a case where the cure is worse than the disease.
In priority order I think we generally rank:
* Exclusive use of space indent (best)
* Exclusive use of tab indent (bad)
* Mixture of space & tab indent (terrible)
IOW, this is a case where I would suggest either:
- Have a cleanup commit first that eliminates all tabs
or
- Continue to use tabs consistently & ignore checkpatch
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2020-03-05 13:54 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 12:45 [PATCH v2 0/9] hw, ui, virtfs-proxy-helper: Reduce QEMU .data/.rodata/.bss footprint Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 12:45 ` [PATCH v2 1/9] hw/audio/fmopl: Fix a typo twice Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 13:38 ` Stefano Garzarella
2020-03-05 13:38 ` Stefano Garzarella
2020-03-09 11:36 ` Laurent Vivier
2020-03-05 12:45 ` [PATCH v2 2/9] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 13:44 ` Stefano Garzarella
2020-03-05 13:44 ` Stefano Garzarella
2020-03-05 13:48 ` Stefano Garzarella
2020-03-05 13:48 ` Stefano Garzarella
2020-03-05 13:50 ` Philippe Mathieu-Daudé
2020-03-05 13:50 ` Philippe Mathieu-Daudé
2020-03-05 13:59 ` Stefano Garzarella
2020-03-05 13:59 ` Stefano Garzarella
2020-03-05 13:49 ` Philippe Mathieu-Daudé
2020-03-05 13:49 ` Philippe Mathieu-Daudé
2020-03-05 13:54 ` Daniel P. Berrangé [this message]
2020-03-05 13:54 ` Daniel P. Berrangé
2020-03-05 12:45 ` [PATCH v2 3/9] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 12:45 ` [PATCH v2 4/9] hw/net/e1000: Add readops/writeops typedefs Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 12:45 ` [PATCH v2 5/9] hw/net/e1000: Move macreg[] arrays to .rodata to save 1MiB of .data Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 12:45 ` [PATCH v2 6/9] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 12:45 ` [PATCH v2 7/9] ui/curses: Make control_characters[] array const Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 13:46 ` Stefano Garzarella
2020-03-05 13:46 ` Stefano Garzarella
2020-03-05 12:45 ` [PATCH v2 8/9] ui/curses: Move arrays to .heap to save 74KiB of .bss Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 12:45 ` [PATCH v2 9/9] virtfs-proxy-helper: Make the helper_opts[] array const Philippe Mathieu-Daudé
2020-03-05 12:45 ` Philippe Mathieu-Daudé
2020-03-05 13:15 ` [PATCH v2 0/9] hw, ui, virtfs-proxy-helper: Reduce QEMU .data/.rodata/.bss footprint no-reply
2020-03-05 13:15 ` no-reply
2020-03-05 13:25 ` no-reply
2020-03-05 13:25 ` no-reply
2020-03-05 13:42 ` Daniel P. Berrangé
2020-03-05 13:42 ` Daniel P. Berrangé
2020-03-05 13:56 ` Philippe Mathieu-Daudé
2020-03-05 13:56 ` Philippe Mathieu-Daudé
2020-03-05 14:34 ` Eric Blake
2020-03-05 14:32 ` Eric Blake
2020-03-05 13:48 ` no-reply
2020-03-05 13:48 ` no-reply
2020-03-05 14:21 ` Eric Blake
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=20200305135434.GC2112347@redhat.com \
--to=berrange@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=groug@kaod.org \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=qemu_oss@crudebyte.com \
--cc=sgarzare@redhat.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.