ACK: [PATCH 4/7] lib: fwts_pipeio: remove redundant initializations of file to NULL
ivanhu
ivan.hu at canonical.com
Mon Oct 24 08:03:13 UTC 2016
On 2016年10月19日 21:26, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The open assigns file to the open descriptor, so no need to initialize
> it to NULL. Cleans up 2 cppcheck style warnings:
>
> src/lib/src/fwts_pipeio.c:397: (style) Variable 'file' is reassigned a
> value before the old one has been used.
> src/lib/src/fwts_pipeio.c:429: (style) Variable 'file' is reassigned a
> value before the old one has been used
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_pipeio.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
> index ecd4e33..0ee1de1 100644
> --- a/src/lib/src/fwts_pipeio.c
> +++ b/src/lib/src/fwts_pipeio.c
> @@ -390,7 +390,7 @@ int fwts_write_string_file(
> const char *file_name,
> const char *str)
> {
> - FILE *file = NULL;
> + FILE *file;
> int ret;
>
> errno = 0;
> @@ -422,7 +422,7 @@ int fwts_read_file_first_line(
> const char *file_name,
> char **line)
> {
> - FILE *file = NULL;
> + FILE *file;
> char buffer[LINE_MAX], *temp;
> errno = 0;
>
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list