提交 53c653dd 编写于 作者: S Srinivas Pandruvada 提交者: Caspar Zhang

tools/power/x86/intel-speed-select: Remove warning for unused result

task #29499913

commit abd120e3bdf3dd72ba1ed9ac077a861e0e3dc43a upstream

Fix warning for:
isst-config.c: In function ‘set_cpu_online_offline’:
isst-config.c:221:3: warning: ignoring return value of ‘write’,
declared with attribute warn_unused_result [-Wunused-result]
   write(fd, "1\n", 2);
Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: NErwei Deng <erwei@linux.alibaba.com>
Reviewed-by: NArtie Ding <artie.ding@linux.alibaba.com>
上级 6585c116
......@@ -169,7 +169,7 @@ int get_topo_max_cpus(void)
static void set_cpu_online_offline(int cpu, int state)
{
char buffer[128];
int fd;
int fd, ret;
snprintf(buffer, sizeof(buffer),
"/sys/devices/system/cpu/cpu%d/online", cpu);
......@@ -179,9 +179,12 @@ static void set_cpu_online_offline(int cpu, int state)
err(-1, "%s open failed", buffer);
if (state)
write(fd, "1\n", 2);
ret = write(fd, "1\n", 2);
else
write(fd, "0\n", 2);
ret = write(fd, "0\n", 2);
if (ret == -1)
perror("Online/Offline: Operation failed\n");
close(fd);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册