All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix various format string mismatches.
@ 2013-10-31 17:57 Alex Sharp
  2013-10-31 18:01 ` Andrew Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Sharp @ 2013-10-31 17:57 UTC (permalink / raw)
  To: xen-devel; +Cc: Alex Sharp

Signed-off-by: Alex Sharp <alex.sharp@orionvm.com>
---
 extras/mini-os/fbfront.c       | 4 ++--
 extras/mini-os/pcifront.c      | 2 +-
 extras/mini-os/xenbus/xenbus.c | 5 +++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/extras/mini-os/fbfront.c b/extras/mini-os/fbfront.c
index a276193..3c618b0 100644
--- a/extras/mini-os/fbfront.c
+++ b/extras/mini-os/fbfront.c
@@ -105,7 +105,7 @@ again:
         free(err);
     }
 
-    err = xenbus_printf(xbt, nodename, "page-ref","%u", virt_to_mfn(s));
+    err = xenbus_printf(xbt, nodename, "page-ref","%lu", virt_to_mfn(s));
     if (err) {
         message = "writing page-ref";
         goto abort_transaction;
@@ -468,7 +468,7 @@ again:
         free(err);
     }
 
-    err = xenbus_printf(xbt, nodename, "page-ref","%u", virt_to_mfn(s));
+    err = xenbus_printf(xbt, nodename, "page-ref","%lu", virt_to_mfn(s));
     if (err) {
         message = "writing page-ref";
         goto abort_transaction;
diff --git a/extras/mini-os/pcifront.c b/extras/mini-os/pcifront.c
index 7838021..c3d833e 100644
--- a/extras/mini-os/pcifront.c
+++ b/extras/mini-os/pcifront.c
@@ -424,7 +424,7 @@ int pcifront_physical_to_virtual (struct pcifront_dev *dev,
                 continue;
             }
 
-            if (sscanf(s, "%x:%x:%x.%x", dom, bus, slot, fun) != 4) {
+            if (sscanf(s, "%x:%x:%x.%lx", dom, bus, slot, fun) != 4) {
                 printk("\"%s\" does not look like a PCI device address\n", s);
                 free(s);
                 continue;
diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
index ee1691b..717bba9 100644
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -27,6 +27,7 @@
 #include <xen/io/xs_wire.h>
 #include <mini-os/spinlock.h>
 #include <mini-os/xmalloc.h>
+#include <inttypes.h>
 
 #define min(x,y) ({                       \
         typeof(x) tmpx = (x);                 \
@@ -672,7 +673,7 @@ char *xenbus_transaction_start(xenbus_transaction_t *xbt)
     err = errmsg(rep);
     if (err)
 	return err;
-    sscanf((char *)(rep + 1), "%u", xbt);
+    sscanf((char *)(rep + 1), "%lu", xbt);
     free(rep);
     return NULL;
 }
@@ -769,7 +770,7 @@ domid_t xenbus_get_self_id(void)
     domid_t ret;
 
     BUG_ON(xenbus_read(XBT_NIL, "domid", &dom_id));
-    sscanf(dom_id, "%d", &ret);
+    sscanf(dom_id, "%"SCNd16, &ret);
 
     return ret;
 }
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix various format string mismatches.
  2013-10-31 17:57 [PATCH] Fix various format string mismatches Alex Sharp
@ 2013-10-31 18:01 ` Andrew Cooper
  2013-10-31 18:05   ` Andrew Cooper
  2013-10-31 18:14   ` Alex Sharp
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Cooper @ 2013-10-31 18:01 UTC (permalink / raw)
  To: Alex Sharp; +Cc: xen-devel

On 31/10/13 17:57, Alex Sharp wrote:
> Signed-off-by: Alex Sharp <alex.sharp@orionvm.com>

Are you sure this patch is against the staging branch of xen.git?

Your changes to pcifront would appear to conflict.

~Andrew

> ---
>  extras/mini-os/fbfront.c       | 4 ++--
>  extras/mini-os/pcifront.c      | 2 +-
>  extras/mini-os/xenbus/xenbus.c | 5 +++--
>  3 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/extras/mini-os/fbfront.c b/extras/mini-os/fbfront.c
> index a276193..3c618b0 100644
> --- a/extras/mini-os/fbfront.c
> +++ b/extras/mini-os/fbfront.c
> @@ -105,7 +105,7 @@ again:
>          free(err);
>      }
>  
> -    err = xenbus_printf(xbt, nodename, "page-ref","%u", virt_to_mfn(s));
> +    err = xenbus_printf(xbt, nodename, "page-ref","%lu", virt_to_mfn(s));
>      if (err) {
>          message = "writing page-ref";
>          goto abort_transaction;
> @@ -468,7 +468,7 @@ again:
>          free(err);
>      }
>  
> -    err = xenbus_printf(xbt, nodename, "page-ref","%u", virt_to_mfn(s));
> +    err = xenbus_printf(xbt, nodename, "page-ref","%lu", virt_to_mfn(s));
>      if (err) {
>          message = "writing page-ref";
>          goto abort_transaction;
> diff --git a/extras/mini-os/pcifront.c b/extras/mini-os/pcifront.c
> index 7838021..c3d833e 100644
> --- a/extras/mini-os/pcifront.c
> +++ b/extras/mini-os/pcifront.c
> @@ -424,7 +424,7 @@ int pcifront_physical_to_virtual (struct pcifront_dev *dev,
>                  continue;
>              }
>  
> -            if (sscanf(s, "%x:%x:%x.%x", dom, bus, slot, fun) != 4) {
> +            if (sscanf(s, "%x:%x:%x.%lx", dom, bus, slot, fun) != 4) {
>                  printk("\"%s\" does not look like a PCI device address\n", s);
>                  free(s);
>                  continue;
> diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
> index ee1691b..717bba9 100644
> --- a/extras/mini-os/xenbus/xenbus.c
> +++ b/extras/mini-os/xenbus/xenbus.c
> @@ -27,6 +27,7 @@
>  #include <xen/io/xs_wire.h>
>  #include <mini-os/spinlock.h>
>  #include <mini-os/xmalloc.h>
> +#include <inttypes.h>
>  
>  #define min(x,y) ({                       \
>          typeof(x) tmpx = (x);                 \
> @@ -672,7 +673,7 @@ char *xenbus_transaction_start(xenbus_transaction_t *xbt)
>      err = errmsg(rep);
>      if (err)
>  	return err;
> -    sscanf((char *)(rep + 1), "%u", xbt);
> +    sscanf((char *)(rep + 1), "%lu", xbt);
>      free(rep);
>      return NULL;
>  }
> @@ -769,7 +770,7 @@ domid_t xenbus_get_self_id(void)
>      domid_t ret;
>  
>      BUG_ON(xenbus_read(XBT_NIL, "domid", &dom_id));
> -    sscanf(dom_id, "%d", &ret);
> +    sscanf(dom_id, "%"SCNd16, &ret);
>  
>      return ret;
>  }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix various format string mismatches.
  2013-10-31 18:01 ` Andrew Cooper
@ 2013-10-31 18:05   ` Andrew Cooper
  2013-10-31 18:14   ` Alex Sharp
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Cooper @ 2013-10-31 18:05 UTC (permalink / raw)
  To: Alex Sharp; +Cc: xen-devel

On 31/10/13 18:01, Andrew Cooper wrote:
> On 31/10/13 17:57, Alex Sharp wrote:
>> Signed-off-by: Alex Sharp <alex.sharp@orionvm.com>
> Are you sure this patch is against the staging branch of xen.git?
>
> Your changes to pcifront would appear to conflict.
>
> ~Andrew

Wait sorry - I was looking at the wrong bit.  My mistake

I would however agree with Samuel that the correct fix would be to
change unsigned long *fun to unsigned int *fun.

~Andrew

>
>> ---
>>  extras/mini-os/fbfront.c       | 4 ++--
>>  extras/mini-os/pcifront.c      | 2 +-
>>  extras/mini-os/xenbus/xenbus.c | 5 +++--
>>  3 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/extras/mini-os/fbfront.c b/extras/mini-os/fbfront.c
>> index a276193..3c618b0 100644
>> --- a/extras/mini-os/fbfront.c
>> +++ b/extras/mini-os/fbfront.c
>> @@ -105,7 +105,7 @@ again:
>>          free(err);
>>      }
>>  
>> -    err = xenbus_printf(xbt, nodename, "page-ref","%u", virt_to_mfn(s));
>> +    err = xenbus_printf(xbt, nodename, "page-ref","%lu", virt_to_mfn(s));
>>      if (err) {
>>          message = "writing page-ref";
>>          goto abort_transaction;
>> @@ -468,7 +468,7 @@ again:
>>          free(err);
>>      }
>>  
>> -    err = xenbus_printf(xbt, nodename, "page-ref","%u", virt_to_mfn(s));
>> +    err = xenbus_printf(xbt, nodename, "page-ref","%lu", virt_to_mfn(s));
>>      if (err) {
>>          message = "writing page-ref";
>>          goto abort_transaction;
>> diff --git a/extras/mini-os/pcifront.c b/extras/mini-os/pcifront.c
>> index 7838021..c3d833e 100644
>> --- a/extras/mini-os/pcifront.c
>> +++ b/extras/mini-os/pcifront.c
>> @@ -424,7 +424,7 @@ int pcifront_physical_to_virtual (struct pcifront_dev *dev,
>>                  continue;
>>              }
>>  
>> -            if (sscanf(s, "%x:%x:%x.%x", dom, bus, slot, fun) != 4) {
>> +            if (sscanf(s, "%x:%x:%x.%lx", dom, bus, slot, fun) != 4) {
>>                  printk("\"%s\" does not look like a PCI device address\n", s);
>>                  free(s);
>>                  continue;
>> diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
>> index ee1691b..717bba9 100644
>> --- a/extras/mini-os/xenbus/xenbus.c
>> +++ b/extras/mini-os/xenbus/xenbus.c
>> @@ -27,6 +27,7 @@
>>  #include <xen/io/xs_wire.h>
>>  #include <mini-os/spinlock.h>
>>  #include <mini-os/xmalloc.h>
>> +#include <inttypes.h>
>>  
>>  #define min(x,y) ({                       \
>>          typeof(x) tmpx = (x);                 \
>> @@ -672,7 +673,7 @@ char *xenbus_transaction_start(xenbus_transaction_t *xbt)
>>      err = errmsg(rep);
>>      if (err)
>>  	return err;
>> -    sscanf((char *)(rep + 1), "%u", xbt);
>> +    sscanf((char *)(rep + 1), "%lu", xbt);
>>      free(rep);
>>      return NULL;
>>  }
>> @@ -769,7 +770,7 @@ domid_t xenbus_get_self_id(void)
>>      domid_t ret;
>>  
>>      BUG_ON(xenbus_read(XBT_NIL, "domid", &dom_id));
>> -    sscanf(dom_id, "%d", &ret);
>> +    sscanf(dom_id, "%"SCNd16, &ret);
>>  
>>      return ret;
>>  }
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix various format string mismatches.
  2013-10-31 18:01 ` Andrew Cooper
  2013-10-31 18:05   ` Andrew Cooper
@ 2013-10-31 18:14   ` Alex Sharp
  2013-10-31 18:19     ` Andrew Cooper
  1 sibling, 1 reply; 6+ messages in thread
From: Alex Sharp @ 2013-10-31 18:14 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel

Just to double check, am I basing this patch off branch staging on git://xenbits.xen.org/xen.git ?  (Last commit 1e2bf05ec37cf04b0e01585eae524509179f165e) or branch staging-4.3?

________________________________________
From: Andrew Cooper [andrew.cooper3@citrix.com]
Sent: Thursday, October 31, 2013 11:01 AM
To: Alex Sharp
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] Fix various format string mismatches.

On 31/10/13 17:57, Alex Sharp wrote:
> Signed-off-by: Alex Sharp <alex.sharp@orionvm.com>

Are you sure this patch is against the staging branch of xen.git?

Your changes to pcifront would appear to conflict.

~Andrew

> ---
>  extras/mini-os/fbfront.c       | 4 ++--
>  extras/mini-os/pcifront.c      | 2 +-
>  extras/mini-os/xenbus/xenbus.c | 5 +++--
>  3 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/extras/mini-os/fbfront.c b/extras/mini-os/fbfront.c
> index a276193..3c618b0 100644
> --- a/extras/mini-os/fbfront.c
> +++ b/extras/mini-os/fbfront.c
> @@ -105,7 +105,7 @@ again:
>          free(err);
>      }
>
> -    err = xenbus_printf(xbt, nodename, "page-ref","%u", virt_to_mfn(s));
> +    err = xenbus_printf(xbt, nodename, "page-ref","%lu", virt_to_mfn(s));
>      if (err) {
>          message = "writing page-ref";
>          goto abort_transaction;
> @@ -468,7 +468,7 @@ again:
>          free(err);
>      }
>
> -    err = xenbus_printf(xbt, nodename, "page-ref","%u", virt_to_mfn(s));
> +    err = xenbus_printf(xbt, nodename, "page-ref","%lu", virt_to_mfn(s));
>      if (err) {
>          message = "writing page-ref";
>          goto abort_transaction;
> diff --git a/extras/mini-os/pcifront.c b/extras/mini-os/pcifront.c
> index 7838021..c3d833e 100644
> --- a/extras/mini-os/pcifront.c
> +++ b/extras/mini-os/pcifront.c
> @@ -424,7 +424,7 @@ int pcifront_physical_to_virtual (struct pcifront_dev *dev,
>                  continue;
>              }
>
> -            if (sscanf(s, "%x:%x:%x.%x", dom, bus, slot, fun) != 4) {
> +            if (sscanf(s, "%x:%x:%x.%lx", dom, bus, slot, fun) != 4) {
>                  printk("\"%s\" does not look like a PCI device address\n", s);
>                  free(s);
>                  continue;
> diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
> index ee1691b..717bba9 100644
> --- a/extras/mini-os/xenbus/xenbus.c
> +++ b/extras/mini-os/xenbus/xenbus.c
> @@ -27,6 +27,7 @@
>  #include <xen/io/xs_wire.h>
>  #include <mini-os/spinlock.h>
>  #include <mini-os/xmalloc.h>
> +#include <inttypes.h>
>
>  #define min(x,y) ({                       \
>          typeof(x) tmpx = (x);                 \
> @@ -672,7 +673,7 @@ char *xenbus_transaction_start(xenbus_transaction_t *xbt)
>      err = errmsg(rep);
>      if (err)
>       return err;
> -    sscanf((char *)(rep + 1), "%u", xbt);
> +    sscanf((char *)(rep + 1), "%lu", xbt);
>      free(rep);
>      return NULL;
>  }
> @@ -769,7 +770,7 @@ domid_t xenbus_get_self_id(void)
>      domid_t ret;
>
>      BUG_ON(xenbus_read(XBT_NIL, "domid", &dom_id));
> -    sscanf(dom_id, "%d", &ret);
> +    sscanf(dom_id, "%"SCNd16, &ret);
>
>      return ret;
>  }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix various format string mismatches.
  2013-10-31 18:14   ` Alex Sharp
@ 2013-10-31 18:19     ` Andrew Cooper
  2013-11-19 12:27       ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2013-10-31 18:19 UTC (permalink / raw)
  To: Alex Sharp; +Cc: xen-devel

On 31/10/13 18:14, Alex Sharp wrote:
> Just to double check, am I basing this patch off branch staging on git://xenbits.xen.org/xen.git ?  (Last commit 1e2bf05ec37cf04b0e01585eae524509179f165e) or branch staging-4.3?

All development happens against staging, even work like this.

It will then be backported by a stable tree maintainer.  Strictly
speaking the maintainer gets final say on whether something justifies
backporting (subject to persuasive arguments one way or another), but
this hopefully uncontentious and obviously a GoodThing.

~Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix various format string mismatches.
  2013-10-31 18:19     ` Andrew Cooper
@ 2013-11-19 12:27       ` Ian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2013-11-19 12:27 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Alex Sharp, xen-devel

On Thu, 2013-10-31 at 18:19 +0000, Andrew Cooper wrote:
> On 31/10/13 18:14, Alex Sharp wrote:
> > Just to double check, am I basing this patch off branch staging on git://xenbits.xen.org/xen.git ?  (Last commit 1e2bf05ec37cf04b0e01585eae524509179f165e) or branch staging-4.3?
> 
> All development happens against staging, even work like this.

Alex, was there ever an update to this patch? If so then I'm afraid I
must have missed it. Sorry.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-19 12:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-31 17:57 [PATCH] Fix various format string mismatches Alex Sharp
2013-10-31 18:01 ` Andrew Cooper
2013-10-31 18:05   ` Andrew Cooper
2013-10-31 18:14   ` Alex Sharp
2013-10-31 18:19     ` Andrew Cooper
2013-11-19 12:27       ` Ian Campbell

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.