[rafael-pm:bleeding-edge 161/190] drivers/acpi/cppc_acpi.c:1141:3-4: Unneeded semicolon

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head:   d683340e443e46fafe40b050b5dedb64924bf6c8
commit: d837dbba610b1219f626af9578518ae066ed0571 [161/190] ACPI: CPPC: Fix MASK_VAL() usage
config: x86_64-randconfig-103-20240901 (https://download.01.org/0day-ci/archive/20240901/202409011554.KG79Y5xu-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)

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/202409011554.KG79Y5xu-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
>> drivers/acpi/cppc_acpi.c:1141:3-4: Unneeded semicolon

vim +1141 drivers/acpi/cppc_acpi.c

  1075	
  1076	static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
  1077	{
  1078		int ret_val = 0;
  1079		int size;
  1080		u64 prev_val;
  1081		void __iomem *vaddr = NULL;
  1082		int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
  1083		struct cpc_reg *reg = &reg_res->cpc_entry.reg;
  1084		struct cpc_desc *cpc_desc;
  1085	
  1086		size = GET_BIT_WIDTH(reg);
  1087	
  1088		if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
  1089			acpi_status status;
  1090	
  1091			status = acpi_os_write_port((acpi_io_address)reg->address,
  1092						    (u32)val, size);
  1093			if (ACPI_FAILURE(status)) {
  1094				pr_debug("Error: Failed to write SystemIO port %llx\n",
  1095					 reg->address);
  1096				return -EFAULT;
  1097			}
  1098	
  1099			return 0;
  1100		} else if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >= 0) {
  1101			/*
  1102			 * For registers in PCC space, the register size is determined
  1103			 * by the bit width field; the access size is used to indicate
  1104			 * the PCC subspace id.
  1105			 */
  1106			size = reg->bit_width;
  1107			vaddr = GET_PCC_VADDR(reg->address, pcc_ss_id);
  1108		}
  1109		else if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
  1110			vaddr = reg_res->sys_mem_vaddr;
  1111		else if (reg->space_id == ACPI_ADR_SPACE_FIXED_HARDWARE)
  1112			return cpc_write_ffh(cpu, reg, val);
  1113		else
  1114			return acpi_os_write_memory((acpi_physical_address)reg->address,
  1115					val, size);
  1116	
  1117		if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
  1118			cpc_desc = per_cpu(cpc_desc_ptr, cpu);
  1119			if (!cpc_desc) {
  1120				pr_debug("No CPC descriptor for CPU:%d\n", cpu);
  1121				return -ENODEV;
  1122			}
  1123	
  1124			spin_lock(&cpc_desc->rmw_lock);
  1125			switch (size) {
  1126			case 8:
  1127				prev_val = readb_relaxed(vaddr);
  1128				break;
  1129			case 16:
  1130				prev_val = readw_relaxed(vaddr);
  1131				break;
  1132			case 32:
  1133				prev_val = readl_relaxed(vaddr);
  1134				break;
  1135			case 64:
  1136				prev_val = readq_relaxed(vaddr);
  1137				break;
  1138			default:
  1139				spin_unlock(&cpc_desc->rmw_lock);
  1140				return -EFAULT;
> 1141			};
  1142			val = MASK_VAL_WRITE(reg, prev_val, val);
  1143			val |= prev_val;
  1144		}
  1145	
  1146		switch (size) {
  1147		case 8:
  1148			writeb_relaxed(val, vaddr);
  1149			break;
  1150		case 16:
  1151			writew_relaxed(val, vaddr);
  1152			break;
  1153		case 32:
  1154			writel_relaxed(val, vaddr);
  1155			break;
  1156		case 64:
  1157			writeq_relaxed(val, vaddr);
  1158			break;
  1159		default:
  1160			if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
  1161				pr_debug("Error: Cannot write %u bit width to system memory: 0x%llx\n",
  1162					size, reg->address);
  1163			} else if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM) {
  1164				pr_debug("Error: Cannot write %u bit width to PCC for ss: %d\n",
  1165					size, pcc_ss_id);
  1166			}
  1167			ret_val = -EFAULT;
  1168			break;
  1169		}
  1170	
  1171		if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
  1172			spin_unlock(&cpc_desc->rmw_lock);
  1173	
  1174		return ret_val;
  1175	}
  1176	

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




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux