[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 05/14] tools/libs: guest: Use const whenever we point to literal strings


  • To: Julien Grall <julien@xxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 11 May 2021 15:58:54 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 11 May 2021 14:59:08 +0000
  • Ironport-hdrordr: A9a23:fq4U7altiTet/eAGhrxlP6ZM+ZTpDfIr3DAbv31ZSRFFG/GwvM ql9c5rsSMc6Qx8ZJhEo7u90ca7Lk80maQa3WByB9eftXjd2VdARbsKheGO/9SKIVycygcy79 YET4FOTPH2EFhmnYLbzWCDYrEdKQC8gcKVuds=
  • Ironport-sdr: yjN3speGgGhHmE6x3mNoRBzKCJuVBWWgRhEmEBfNgdMjYdrmYr+mmjPe8870KyDN4q1keMFjy0 mQPytvfjCJCKKAY/nRbLOdQJN74RqmbPdqBUiZMK7ivxDu8DiCFUEYoe+jLeSz9YND4kWqxggo 3QvWF4K+uTmNcKzlWnz0t3HKA9MhxiVWYdK422FumHo9X4f+TwZl3c6P2OM6D2z3LFdWMCSCfp egkF61aNgKQIXQUcw1tnTCjr7peB1SD0wQ3aTxUZUQOtNh1Sef5qquMWtKQc4v6aWbDMSpS0SI zfQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Apr 05, 2021 at 04:57:04PM +0100, Julien Grall wrote:
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> literal strings are not meant to be modified. So we should use const
> *char rather than char * when we want to store a pointer to them.
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
> ---
> diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
> index 2953aeb90b35..e379b07f9945 100644
> --- a/tools/libs/guest/xg_dom_x86.c
> +++ b/tools/libs/guest/xg_dom_x86.c
> @@ -1148,11 +1148,12 @@ static int vcpu_hvm(struct xc_dom_image *dom)
>  
>  /* ------------------------------------------------------------------------ 
> */
>  
> -static int x86_compat(xc_interface *xch, uint32_t domid, char *guest_type)
> +static int x86_compat(xc_interface *xch, uint32_t domid,
> +                      const char *guest_type)
>  {
>      static const struct {
> -        char           *guest;
> -        uint32_t        size;
> +        const char      *guest;
> +        uint32_t       size;

It seems that one space have been removed by mistake just before "size".

The rest looks good:
Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks,

-- 
Anthony PERARD



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.