[Spice-devel,xf86-video-qxl,v2,cleanup,1/6] qxl_driver: cleanup: fix const cast warnings

Submitted by Alon Levy on April 24, 2012, 9:21 a.m.

Details

Message ID 1335259287-23125-1-git-send-email-alevy@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Alon Levy April 24, 2012, 9:21 a.m.
---
 src/qxl_driver.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 6e06174..af5bfca 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1619,6 +1619,8 @@  static PciChipsets qxlPciChips[] =
 #endif
 #endif /* !XSPICE */
 
+static char qxl_driver_name[] = QXL_DRIVER_NAME;
+
 static void
 qxl_identify(int flags)
 {
@@ -1631,7 +1633,7 @@  static void
 qxl_init_scrn(ScrnInfoPtr pScrn)
 {
     pScrn->driverVersion    = 0;
-    pScrn->driverName	    = pScrn->name = QXL_DRIVER_NAME;
+    pScrn->driverName	    = pScrn->name = qxl_driver_name;
     pScrn->PreInit	    = qxl_pre_init;
     pScrn->ScreenInit	    = qxl_screen_init;
     pScrn->SwitchMode	    = qxl_switch_mode;
@@ -1743,7 +1745,7 @@  qxl_pci_probe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t match)
 
 static DriverRec qxl_driver = {
     0,
-    QXL_DRIVER_NAME,
+    qxl_driver_name,
     qxl_identify,
     qxl_probe,
     qxl_available_options,

Comments

I'm still not a big fan of these, but I could not find satisfying fixes in
the Xorg drivers I looked at, so let's get these in, we can always revert
if we come with a better solution.
Have you tried adding -Wno-cast-qual instead of these patches?

Christophe

On Tue, Apr 24, 2012 at 12:21:22PM +0300, Alon Levy wrote:
> ---
>  src/qxl_driver.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qxl_driver.c b/src/qxl_driver.c
> index 6e06174..af5bfca 100644
> --- a/src/qxl_driver.c
> +++ b/src/qxl_driver.c
> @@ -1619,6 +1619,8 @@ static PciChipsets qxlPciChips[] =
>  #endif
>  #endif /* !XSPICE */
>  
> +static char qxl_driver_name[] = QXL_DRIVER_NAME;
> +
>  static void
>  qxl_identify(int flags)
>  {
> @@ -1631,7 +1633,7 @@ static void
>  qxl_init_scrn(ScrnInfoPtr pScrn)
>  {
>      pScrn->driverVersion    = 0;
> -    pScrn->driverName	    = pScrn->name = QXL_DRIVER_NAME;
> +    pScrn->driverName	    = pScrn->name = qxl_driver_name;
>      pScrn->PreInit	    = qxl_pre_init;
>      pScrn->ScreenInit	    = qxl_screen_init;
>      pScrn->SwitchMode	    = qxl_switch_mode;
> @@ -1743,7 +1745,7 @@ qxl_pci_probe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t match)
>  
>  static DriverRec qxl_driver = {
>      0,
> -    QXL_DRIVER_NAME,
> +    qxl_driver_name,
>      qxl_identify,
>      qxl_probe,
>      qxl_available_options,
> -- 
> 1.7.10
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
On Thu, May 03, 2012 at 04:28:26PM +0200, Christophe Fergeau wrote:
> I'm still not a big fan of these, but I could not find satisfying fixes in
> the Xorg drivers I looked at, so let's get these in, we can always revert
> if we come with a better solution.
> Have you tried adding -Wno-cast-qual instead of these patches?

I haven't. I mean I started and got distracted. I know it's considered a
too verbose. If you can do a patch for that I'm fine with it. As it is
the warnings are obscuring any really interesting output (actual errors).

> 
> Christophe
> 
> On Tue, Apr 24, 2012 at 12:21:22PM +0300, Alon Levy wrote:
> > ---
> >  src/qxl_driver.c |    6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/qxl_driver.c b/src/qxl_driver.c
> > index 6e06174..af5bfca 100644
> > --- a/src/qxl_driver.c
> > +++ b/src/qxl_driver.c
> > @@ -1619,6 +1619,8 @@ static PciChipsets qxlPciChips[] =
> >  #endif
> >  #endif /* !XSPICE */
> >  
> > +static char qxl_driver_name[] = QXL_DRIVER_NAME;
> > +
> >  static void
> >  qxl_identify(int flags)
> >  {
> > @@ -1631,7 +1633,7 @@ static void
> >  qxl_init_scrn(ScrnInfoPtr pScrn)
> >  {
> >      pScrn->driverVersion    = 0;
> > -    pScrn->driverName	    = pScrn->name = QXL_DRIVER_NAME;
> > +    pScrn->driverName	    = pScrn->name = qxl_driver_name;
> >      pScrn->PreInit	    = qxl_pre_init;
> >      pScrn->ScreenInit	    = qxl_screen_init;
> >      pScrn->SwitchMode	    = qxl_switch_mode;
> > @@ -1743,7 +1745,7 @@ qxl_pci_probe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t match)
> >  
> >  static DriverRec qxl_driver = {
> >      0,
> > -    QXL_DRIVER_NAME,
> > +    qxl_driver_name,
> >      qxl_identify,
> >      qxl_probe,
> >      qxl_available_options,
> > -- 
> > 1.7.10
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
On Thu, May 03, 2012 at 05:36:05PM +0300, Alon Levy wrote:
> On Thu, May 03, 2012 at 04:28:26PM +0200, Christophe Fergeau wrote:
> > I'm still not a big fan of these, but I could not find satisfying fixes in
> > the Xorg drivers I looked at, so let's get these in, we can always revert
> > if we come with a better solution.
> > Have you tried adding -Wno-cast-qual instead of these patches?
> 
> I haven't. I mean I started and got distracted. I know it's considered a
> too verbose. If you can do a patch for that I'm fine with it. As it is
> the warnings are obscuring any really interesting output (actual errors).

I've just tested this and sent a patch for it. It also gets rid of the
volatile warning.

Christophe