Re: [PATCH 2/4] am: convert "resume" variable to a struct

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

 



pbonzini@xxxxxxxxxx writes:

> From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
>
> This will allow stashing the submode of --show-current-patch.  Using
> a struct will allow accessing both fields from outside cmd_am (through
> container_of).
>
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> ---
>  builtin/am.c | 32 ++++++++++++++++++--------------
>  1 file changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/builtin/am.c b/builtin/am.c
> index 8181c2aef3..a89e1a96ed 100644
> --- a/builtin/am.c
> +++ b/builtin/am.c
> @@ -2118,7 +2118,7 @@ static int parse_opt_patchformat(const struct option *opt, const char *arg, int
>  	return 0;
>  }
>  
> -enum resume_mode {
> +enum resume_type {
>  	RESUME_FALSE = 0,
>  	RESUME_APPLY,
>  	RESUME_RESOLVED,
> @@ -2128,6 +2128,10 @@ enum resume_mode {
>  	RESUME_SHOW_PATCH
>  };
>  
> +struct resume_mode {
> +	enum resume_type mode;
> +};
> +
>  static int git_am_config(const char *k, const char *v, void *cb)
>  {
>  	int status;
> @@ -2145,7 +2149,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
>  	int binary = -1;
>  	int keep_cr = -1;
>  	int patch_format = PATCH_FORMAT_UNKNOWN;
> -	enum resume_mode resume = RESUME_FALSE;
> +	struct resume_mode resume = { . mode = RESUME_FALSE };

I do not think it makes a difference to compilers, but it seems that
existing code spells this without SP between dot and the field name.

> +	struct resume_mode resume = { .mode = RESUME_FALSE };

The rest of the patch is quite straight-forward update that looks
correct.

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux