Patchwork [13/21] libcacard: fix reported ATR length

login
register
mail settings
Submitter Gerd Hoffmann
Date Feb. 28, 2012, 10:20 a.m.
Message ID <1330424430-23015-14-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/143395/
State New
Headers show

Comments

Gerd Hoffmann - Feb. 28, 2012, 10:20 a.m.
From: Alon Levy <alevy@redhat.com>

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 libcacard/vcardt.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Wen Congyang - March 8, 2012, 7:12 a.m.
At 02/28/2012 06:20 PM, Gerd Hoffmann Wrote:
> From: Alon Levy <alevy@redhat.com>
> 
> Signed-off-by: Alon Levy <alevy@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  libcacard/vcardt.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> index 538bdde..d4d8e2e 100644
> --- a/libcacard/vcardt.h
> +++ b/libcacard/vcardt.h
> @@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
>  #define MAX_CHANNEL 4
>  
>  /* create an ATR with appropriate historical bytes */
> -#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
> -                               'V', 'C', 'A', 'R', 'D', '_'
> +#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
> +                               'V', 'C', 'A', 'R', 'D', '_')
>  
>  
>  typedef enum {

qemu build faile with this patch:

  CC    libcacard/vcard_emul_nss.o
cc1: warnings being treated as errors
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: initializer element is not constant
vcard_emul_nss.c:528: error: (near initialization for ‘nss_atr[0]’)
make[1]: *** [vcard_emul_nss.o] Error 1
make: *** [subdir-libcacard] Error 2

I donot know this patch's purpose, so I donot know how to fix it. I guess this
patch is unnecessary.

Thanks
Wen Congyang
Alon Levy - March 8, 2012, 8:15 a.m.
On Thu, Mar 08, 2012 at 03:12:03PM +0800, Wen Congyang wrote:
> At 02/28/2012 06:20 PM, Gerd Hoffmann Wrote:
> > From: Alon Levy <alevy@redhat.com>
> > 
> > Signed-off-by: Alon Levy <alevy@redhat.com>
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >  libcacard/vcardt.h |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> > index 538bdde..d4d8e2e 100644
> > --- a/libcacard/vcardt.h
> > +++ b/libcacard/vcardt.h
> > @@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
> >  #define MAX_CHANNEL 4
> >  
> >  /* create an ATR with appropriate historical bytes */
> > -#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
> > -                               'V', 'C', 'A', 'R', 'D', '_'
> > +#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
> > +                               'V', 'C', 'A', 'R', 'D', '_')
> >  
> >  
> >  typedef enum {
> 
> qemu build faile with this patch:

This is fixed by a patch on the list:
 http://patchwork.ozlabs.org/patch/144276/

Anthony, could you please apply that patch, or should I send a pull request with it?

Alon

> 
>   CC    libcacard/vcard_emul_nss.o
> cc1: warnings being treated as errors
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: initializer element is not constant
> vcard_emul_nss.c:528: error: (near initialization for ‘nss_atr[0]’)
> make[1]: *** [vcard_emul_nss.o] Error 1
> make: *** [subdir-libcacard] Error 2
> 
> I donot know this patch's purpose, so I donot know how to fix it. I guess this
> patch is unnecessary.
> 
> Thanks
> Wen Congyang

Patch

diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
index 538bdde..d4d8e2e 100644
--- a/libcacard/vcardt.h
+++ b/libcacard/vcardt.h
@@ -26,8 +26,8 @@  typedef struct VCardEmulStruct VCardEmul;
 #define MAX_CHANNEL 4
 
 /* create an ATR with appropriate historical bytes */
-#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
-                               'V', 'C', 'A', 'R', 'D', '_'
+#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
+                               'V', 'C', 'A', 'R', 'D', '_')
 
 
 typedef enum {