Linux Test Project
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: tangmeng <tangmeng@uniontech.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] syscalls/fchmodat_01: Convert to new API
Date: Thu, 14 Apr 2022 08:54:56 +0100	[thread overview]
Message-ID: <87czhkyu4v.fsf@suse.de> (raw)
In-Reply-To: <20220216063430.31447-1-tangmeng@uniontech.com>

Hello,

tangmeng <tangmeng@uniontech.com> writes:

> Signed-off-by: tangmeng <tangmeng@uniontech.com>
> ---
>  .../kernel/syscalls/fchmodat/fchmodat01.c     | 166 +++++++-----------
>  1 file changed, 60 insertions(+), 106 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
> index 9676ae0fd..70e35b363 100644
> --- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
> +++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
> @@ -1,116 +1,65 @@
> -/******************************************************************************
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (c) International Business Machines  Corp., 2006
>   *
> - *   Copyright (c) International Business Machines  Corp., 2006
> - *
> - *   This program is free software;  you can redistribute it and/or modify
> - *   it under the terms of the GNU General Public License as published by
> - *   the Free Software Foundation; either version 2 of the License, or
> - *   (at your option) any later version.
> - *
> - *   This program is distributed in the hope that it will be useful,
> - *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
> - *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
> - *   the GNU General Public License for more details.
> - *
> - *   You should have received a copy of the GNU General Public License
> - *   along with this program;  if not, write to the Free Software
> - *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> - *
> - * NAME
> - *      fchmodat01.c
> - *
> - * DESCRIPTION
> - *	This test case will verify basic function of fchmodat
> - *	added by kernel 2.6.16 or up.
> - *
> - * Author
> - *	Yi Yang <yyangcdl@cn.ibm.com>
> - *
> - * History
> - *      08/28/2006      Created first by Yi Yang <yyangcdl@cn.ibm.com>
> + * 08/28/2006 AUTHOR: Yi Yang <yyangcdl@cn.ibm.com>
> + */
> +
> +/*\
> + * [Description]
>   *
> - *****************************************************************************/
> + * This test case will verify basic function of fchmodat.
> + */
>  
>  #define _GNU_SOURCE
>  
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
>  #include <unistd.h>
> -#include <stdlib.h>
> -#include <errno.h>
>  #include <string.h>
> -#include <signal.h>
> -#include "test.h"
> -#include "safe_macros.h"
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include "tst_test.h"
>  #include "lapi/syscalls.h"
>  
> -#define TEST_CASES 6
>  #ifndef AT_FDCWD
>  #define AT_FDCWD -100
>  #endif
> -void setup();
> -void cleanup();
> -
> -char *TCID = "fchmodat01";
> -int TST_TOTAL = TEST_CASES;
> -char pathname[256];
> -char testfile[256];
> -char testfile2[256];
> -char testfile3[256];
> -int fds[TEST_CASES];
> -char *filenames[TEST_CASES];
> -int expected_errno[TEST_CASES] = { 0, 0, ENOTDIR, EBADF, 0, 0 };
> -
> -int myfchmodat(int dirfd, const char *filename, mode_t mode)
> -{
> -	return tst_syscall(__NR_fchmodat, dirfd, filename, mode);
> -}
>  
> -int main(int ac, char **av)
> +static char pathname[256];
> +static char testfile[256];
> +static char testfile2[256];
> +static char testfile3[256];
> +
> +static struct tcase {
> +	int exp_errno;          /* Expected error no            */
> +	char *exp_errval;       /* Expected error value string  */

With these comments removed (I can remove them before merge, no need for
another patch)

Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>

The style guide says to avoid comments.

-- 
Thank you,
Richard.

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

      reply	other threads:[~2022-04-14  7:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16  6:34 [LTP] [PATCH v2] syscalls/fchmodat_01: Convert to new API tangmeng
2022-04-14  7:54 ` Richard Palethorpe [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=87czhkyu4v.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=tangmeng@uniontech.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox