ACK: [PATCH 29/46] lib: fwts_efi_module: reduce scope of variable
Alex Hung
alex.hung at canonical.com
Tue Jan 20 07:48:11 UTC 2015
On 01/14/2015 03:04 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> cppcheck is picking up some minor style issues which can
> be easily fixed:
>
> [src/lib/src/fwts_efi_module.c:33]:
> (style) The scope of the variable 'buffer' can be reduced.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_efi_module.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_efi_module.c b/src/lib/src/fwts_efi_module.c
> index 922d90b..e662d83 100644
> --- a/src/lib/src/fwts_efi_module.c
> +++ b/src/lib/src/fwts_efi_module.c
> @@ -30,10 +30,11 @@ static bool module_already_loaded = false;
> static int check_module_loaded(void)
> {
> FILE *fp;
> - char buffer[1024];
>
> module_already_loaded = false;
> if ((fp = fopen("/proc/modules", "r")) != NULL) {
> + char buffer[1024];
> +
> while (fgets(buffer, sizeof(buffer), fp) != NULL) {
> if (strstr(buffer, "efi_runtime") != NULL) {
> module_already_loaded = true;
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list