qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: blauwirbel@gmail.com, "Stefan Weil" <sw@weilnetz.de>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	anthony@codemonkey.ws,
	"KONRAD Frédéric" <fred.konrad@greensocs.com>
Subject: Re: [Qemu-devel] [PATCH] Make all static TypeInfos const
Date: Thu, 10 Jan 2013 16:47:13 +0100	[thread overview]
Message-ID: <50EEE281.8000200@suse.de> (raw)
In-Reply-To: <1357831148-17624-1-git-send-email-afaerber@suse.de>

Am 10.01.2013 16:19, schrieb Andreas Färber:
> Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all
> types natively through QEMU Object Model), TypeInfo as used in
> the common, non-iterative pattern is no longer amended with information
> and should therefore be const.
> 
> Fix the documented QOM examples:
> 
>  sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h
> 
> Since frequently the wrong examples are being copied by contributors of
> new devices, fix all types in the tree:
> 
>  sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c
>  sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c
> 
> This also avoids to piggy-back these changes onto real functional
> changes or other refactorings.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---

Note that I have compile-tested this, which should've caught any attempt
to modify a const TypeInfo. And I have reviewed the patch to not do any
accidental refactoring.

While this is close to a touch-all patch, those lines are rarely
touched, so mainly QOM'ification patches touching .name would be
affected, i.e. at this time Fred's and mine.
Previous art are patches by Stefan W. to make MemoryRegionOps const.

After this patch, two occurrences of non-const static TypeInfo remain,
inside qom/object.c for Object and Interface respectively.
Plus non-static, non-const TypeInfos in eepro100, EHCI, UHCI and CPUs.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2013-01-10 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 15:19 [Qemu-devel] [PATCH] Make all static TypeInfos const Andreas Färber
2013-01-10 15:47 ` Andreas Färber [this message]
2013-01-11 16:46 ` Anthony Liguori

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=50EEE281.8000200@suse.de \
    --to=afaerber@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=blauwirbel@gmail.com \
    --cc=fred.konrad@greensocs.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).