LCOV - code coverage report
Current view: top level - external/ffspart/common - arch_flash_unknown.c (source / functions) Hit Total Coverage
Test: skiboot.info Lines: 12 14 85.7 %
Date: 2024-01-02 21:04:04 Functions: 2 2 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // SPDX-License-Identifier: Apache-2.0
       2                 :            : /* Copyright 2013-2017 IBM Corp.
       3                 :            :  */
       4                 :            : 
       5                 :            : #include <stdlib.h>
       6                 :            : #include <stdio.h>
       7                 :            : #include <limits.h>
       8                 :            : #include <unistd.h>
       9                 :            : #include <dirent.h>
      10                 :            : #include <sys/types.h>
      11                 :            : #include <sys/stat.h>
      12                 :            : #include <fcntl.h>
      13                 :            : #include <string.h>
      14                 :            : 
      15                 :            : #include <libflash/file.h>
      16                 :            : 
      17                 :            : #include "arch_flash.h"
      18                 :            : 
      19                 :          6 : int arch_flash_init(struct blocklevel_device **r_bl, const char *file, bool keep_alive)
      20                 :            : {
      21                 :          6 :         int rc;
      22                 :          6 :         struct blocklevel_device *new_bl;
      23                 :            : 
      24                 :            :         /* Must have passed through a file to operate on */
      25                 :          6 :         if (!file) {
      26                 :          0 :                 fprintf(stderr, "Cannot operate without a file\n");
      27                 :          0 :                 return -1;
      28                 :            :         }
      29                 :            : 
      30                 :          6 :         rc = file_init_path(file, NULL, keep_alive, &new_bl);
      31                 :          6 :         if (rc)
      32                 :            :                 return -1;
      33                 :            : 
      34                 :          6 :         *r_bl = new_bl;
      35                 :          6 :         return 0;
      36                 :            : }
      37                 :            : 
      38                 :          6 : void arch_flash_close(struct blocklevel_device *bl, const char *file)
      39                 :            : {
      40                 :          6 :         (void)file;
      41                 :          6 :         file_exit_close(bl);
      42                 :          6 : }

Generated by: LCOV version 1.14