All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Marius Kittler <mkittler@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] Extend ioctl02 to test termio and termios
Date: Fri, 3 Nov 2023 16:47:00 +0100	[thread overview]
Message-ID: <ZUUV9MiVadNA75WY@yuki> (raw)
In-Reply-To: <20231103105339.21435-1-mkittler@suse.de>

Hi!
> +#define CMP_ATTR(term_exp, term, attr) \
> +	(flag += cmp_attr((term_exp).attr, (term).attr, #attr))
>  
> -	if (termio.c_iflag != (BRKINT | IGNPAR | INPCK | ISTRIP
> -		 | ICRNL | IUCLC | IXON | IXANY | IXOFF)) {
> -		tst_res(TFAIL, "iflag has incorrect value. %o",
> -			 termio.c_iflag);
> -		flag++;
> -	}
> +#define CMP_C_CC(term_exp, term) \
> +	(flag += cmp_c_cc(term_exp.c_cc, term.c_cc, sizeof(term.c_cc)))

The last thing that I do not like about this is that we modify the flag
variable without it being passed to the macro, this is something you get
frowned upon for in proper C circles.

The rest looks really good.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      parent reply	other threads:[~2023-11-03 15:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 10:53 [LTP] [PATCH v2] Extend ioctl02 to test termio and termios Marius Kittler
2023-11-03 15:31 ` Martin Doucha
2023-11-03 15:47 ` Cyril Hrubis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZUUV9MiVadNA75WY@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mkittler@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.