LCOV - code coverage report
Current view: top level - external/ffspart/common - arch_flash_unknown.c (source / functions) Coverage Total Hit
Test: skiboot.info Lines: 85.7 % 14 12
Test Date: 2025-01-15 20:37:39 Functions: 100.0 % 2 2
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 2.0-1