[mchehab-edac:edac-fixes 6/6] drivers/acpi/apei/ghes.c:574 ghes_handle_arm_hw_error() warn: inconsistent indenting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac.git edac-fixes
head:   bd8a8958080eb6b4ba0d80fa822703b675aad933
commit: bd8a8958080eb6b4ba0d80fa822703b675aad933 [6/6] apei/ghes: don't go past the ARM processor CPER record buffer
config: x86_64-randconfig-161-20240904 (https://download.01.org/0day-ci/archive/20240904/202409041147.fl53VURu-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409041147.fl53VURu-lkp@xxxxxxxxx/

smatch warnings:
drivers/acpi/apei/ghes.c:574 ghes_handle_arm_hw_error() warn: inconsistent indenting

vim +574 drivers/acpi/apei/ghes.c

   530	
   531	static bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata,
   532					     int sev, bool sync)
   533	{
   534		struct cper_sec_proc_arm *err = acpi_hest_get_payload(gdata);
   535		int flags = sync ? MF_ACTION_REQUIRED : 0;
   536		int length = gdata->error_data_length;
   537		char error_type[120];
   538		bool queued = false;
   539		int sec_sev, i;
   540		char *p;
   541	
   542		sec_sev = ghes_severity(gdata->error_severity);
   543		log_arm_hw_error(err, sec_sev);
   544		if (sev != GHES_SEV_RECOVERABLE || sec_sev != GHES_SEV_RECOVERABLE)
   545			return false;
   546	
   547		p = (char *)(err + 1);
   548		length -= sizeof(err);
   549	
   550		for (i = 0; i < err->err_info_num; i++) {
   551			if (length <= 0)
   552				break;
   553	
   554			struct cper_arm_err_info *err_info = (struct cper_arm_err_info *)p;
   555			bool is_cache = err_info->type & CPER_ARM_CACHE_ERROR;
   556			bool has_pa = (err_info->validation_bits & CPER_ARM_INFO_VALID_PHYSICAL_ADDR);
   557	
   558			/*
   559			 * The field (err_info->error_info & BIT(26)) is fixed to set to
   560			 * 1 in some old firmware of HiSilicon Kunpeng920. We assume that
   561			 * firmware won't mix corrected errors in an uncorrected section,
   562			 * and don't filter out 'corrected' error here.
   563			 */
   564			if (is_cache && has_pa) {
   565				length -= err_info->length;
   566				if (length < 0)
   567					break;
   568				queued = ghes_do_memory_failure(err_info->physical_fault_addr, flags);
   569				p += err_info->length;
   570	
   571				continue;
   572			}
   573			length -= err_info->length;
 > 574				if (length < 0)
   575					break;
   576	
   577			cper_bits_to_str(error_type, sizeof(error_type),
   578					 FIELD_GET(CPER_ARM_ERR_TYPE_MASK, err_info->type),
   579					 cper_proc_error_type_strs,
   580					 ARRAY_SIZE(cper_proc_error_type_strs));
   581	
   582			pr_warn_ratelimited(FW_WARN GHES_PFX
   583					    "Unhandled processor error type 0x%02x: %s%s\n",
   584					    err_info->type, error_type,
   585					    (err_info->type & ~CPER_ARM_ERR_TYPE_MASK) ? " with reserved bit(s)" : "");
   586			p += err_info->length;
   587		}
   588	
   589		return queued;
   590	}
   591	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux