Skip to content

Commit

Permalink
drivers: fix string literal warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadenix committed Feb 2, 2024
1 parent 7e3e5ca commit 1d5ac3e
Show file tree
Hide file tree
Showing 24 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion drivers/base/power/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static ssize_t rtpm_status_show(struct device *dev,
return -EIO;
}
}
return sprintf(buf, p);
return sprintf(buf, "%s", p);
}

static DEVICE_ATTR(runtime_status, 0444, rtpm_status_show, NULL);
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ static int __init chr_dev_init(void)
continue;

device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor),
NULL, devlist[minor].name);
NULL, "%s", devlist[minor].name);
}

return tty_init();
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/aee/aed/aed-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static ssize_t proc_generate_wdt_write(struct file *file,
for (i = 0; i < nr_cpu_ids; i++) {
sprintf(name, "wd-test-%d", i);
pr_notice("[WDK]thread name: %s\n", name);
wk_tsk[i] = kthread_create(kwdt_thread_test, NULL, name);
wk_tsk[i] = kthread_create(kwdt_thread_test, NULL, "%s", name);
if (IS_ERR(wk_tsk[i])) {
int ret = PTR_ERR(wk_tsk[i]);

Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/aee/aed/aed-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2318,7 +2318,7 @@ static void kernel_reportAPI(const enum AE_DEFECT_ATTR attr, const int db_opt,
if (oops != NULL) {
do_gettimeofday(&tv);
rtc_time_to_tm(tv.tv_sec - sys_tz.tz_minuteswest * 60, &tm);
n += snprintf(oops->backtrace, AEE_BACKTRACE_LENGTH, msg);
n += snprintf(oops->backtrace, AEE_BACKTRACE_LENGTH, "%s", msg);
n += snprintf(oops->backtrace + n, AEE_BACKTRACE_LENGTH - n,
"\nTrigger time:[%d-%02d-%02d %02d:%02d:%02d.%03d]\n",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/base/power/eem_v2/mt6765/mtk_eem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ static void eem_init_ctrl(struct eem_ctrl *ctrl)
if (1) {
init_waitqueue_head(&ctrl->wq);
ctrl->thread = kthread_run(eem_volt_thread_handler,
ctrl, ctrl->name);
ctrl, "%s", ctrl->name);

if (IS_ERR(ctrl->thread))
eem_error("Create %s thread failed: %ld\n", ctrl->name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static void mcdi_stress_start(void)
snprintf(name, sizeof(name), "mcdi_stress_task%d", i);

mcdi_stress_tsk[i] =
kthread_create(mcdi_stress_task, NULL, name);
kthread_create(mcdi_stress_task, NULL, "%s", name);

if (!IS_ERR(mcdi_stress_tsk[i])) {
kthread_bind(mcdi_stress_tsk[i], i);
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/btif/common/mtk_btif.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ static int btif_chrdev_init(void)
BTIF_INFO_FUNC("create class for btif succeed\n");

p_btif_dev = device_create(p_btif_class,
NULL, btif_dev, 0, p_btif_dev_name);
NULL, btif_dev, 0, "%s", p_btif_dev_name);
if (IS_ERR(p_btif_dev)) {
BTIF_ERR_FUNC("error happened when doing device_create\n");
class_destroy(p_btif_class);
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/c2k_usb/rawbulk.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ static __init struct rawbulk_function *rawbulk_alloc_function(int transfer_id)
}

fn->dev = device_create(rawbulk_class, NULL, MKDEV(0,
fn->transfer_id), NULL, fn->shortname);
fn->transfer_id), NULL, "%s", fn->shortname);
if (IS_ERR(fn->dev)) {
kfree(fn);
return NULL;
Expand Down
6 changes: 3 additions & 3 deletions drivers/misc/mediatek/cmdq/v3/cmdq_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2217,15 +2217,15 @@ static void testcase_thread_dispatch(void)

sprintf(threadName, "cmdqKTHR_%llx", engineFlag1);
pKThread1 = kthread_run(_testcase_thread_dispatch,
(void *)(&engineFlag1), threadName);
(void *)(&engineFlag1), "%s", threadName);
if (IS_ERR(pKThread1)) {
CMDQ_ERR("create thread failed, thread:%s\n", threadName);
return;
}

sprintf(threadName, "cmdqKTHR_%llx", engineFlag2);
pKThread2 = kthread_run(_testcase_thread_dispatch,
(void *)(&engineFlag2), threadName);
(void *)(&engineFlag2), "%s", threadName);
if (IS_ERR(pKThread2)) {
CMDQ_ERR("create thread failed, thread:%s\n", threadName);
return;
Expand Down Expand Up @@ -2296,7 +2296,7 @@ static void testcase_full_thread_array(void)
CMDQ_LOG("%s\n", __func__);

sprintf(threadName, "cmdqKTHR");
pKThread = kthread_run(_testcase_full_thread_array, NULL, threadName);
pKThread = kthread_run(_testcase_full_thread_array, NULL, "%s", threadName);
if (IS_ERR(pKThread)) {
/* create thread failed */
CMDQ_ERR("create thread failed, thread:%s\n", threadName);
Expand Down
20 changes: 10 additions & 10 deletions drivers/misc/mediatek/eccci/fsm/mdee_dumper_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ static void mdee_dumper_info_prepare_v1(struct ccci_fsm_ee *mdee)
if (md_id == MD_SYS3) {
snprintf(debug_info->assert.file_name,
sizeof(debug_info->assert.file_name),
ex_info->content.c2k_assert.filename);
"%s", ex_info->content.c2k_assert.filename);
debug_info->assert.line_num =
ex_info->content.c2k_assert.linenumber;
debug_info->assert.parameters[0] =
Expand All @@ -492,7 +492,7 @@ static void mdee_dumper_info_prepare_v1(struct ccci_fsm_ee *mdee)
} else {
snprintf(debug_info->assert.file_name,
sizeof(debug_info->assert.file_name),
ex_info->content.assert.filename);
"%s", ex_info->content.assert.filename);
debug_info->assert.line_num =
ex_info->content.assert.linenumber;
debug_info->assert.parameters[0] =
Expand Down Expand Up @@ -542,13 +542,13 @@ static void mdee_dumper_info_prepare_v1(struct ccci_fsm_ee *mdee)
if (md_id == MD_SYS3) {
snprintf(debug_info->assert.file_name,
sizeof(debug_info->assert.file_name),
ex_info->content.c2k_assert.filename);
"%s", ex_info->content.c2k_assert.filename);
debug_info->assert.line_num =
ex_info->content.c2k_assert.linenumber;
} else {
snprintf(debug_info->assert.file_name,
sizeof(debug_info->assert.file_name),
ex_info->content.assert.filename);
"%s", ex_info->content.assert.filename);
debug_info->assert.line_num =
ex_info->content.assert.linenumber;
}
Expand All @@ -559,12 +559,12 @@ static void mdee_dumper_info_prepare_v1(struct ccci_fsm_ee *mdee)
if (md_id == MD_SYS3) {
snprintf(debug_info->dsp_assert.file_name,
sizeof(debug_info->dsp_assert.file_name),
ex_info->content.c2k_assert.filename);
"%s", ex_info->content.c2k_assert.filename);
debug_info->dsp_assert.line_num =
ex_info->content.c2k_assert.linenumber;
snprintf(debug_info->dsp_assert.execution_unit,
sizeof(debug_info->dsp_assert.execution_unit),
ex_info->envinfo.execution_unit);
"%s", ex_info->envinfo.execution_unit);
debug_info->dsp_assert.parameters[0] =
ex_info->content.c2k_assert.parameters[0];
debug_info->dsp_assert.parameters[1] =
Expand All @@ -575,12 +575,12 @@ static void mdee_dumper_info_prepare_v1(struct ccci_fsm_ee *mdee)
} else {
snprintf(debug_info->dsp_assert.file_name,
sizeof(debug_info->dsp_assert.file_name),
ex_info->content.assert.filename);
"%s", ex_info->content.assert.filename);
debug_info->dsp_assert.line_num =
ex_info->content.assert.linenumber;
snprintf(debug_info->dsp_assert.execution_unit,
sizeof(debug_info->dsp_assert.execution_unit),
ex_info->envinfo.execution_unit);
"%s", ex_info->envinfo.execution_unit);
debug_info->dsp_assert.parameters[0] =
ex_info->content.assert.parameters[0];
debug_info->dsp_assert.parameters[1] =
Expand All @@ -594,7 +594,7 @@ static void mdee_dumper_info_prepare_v1(struct ccci_fsm_ee *mdee)
debug_info->name = "MD DMD Exception";
snprintf(debug_info->dsp_exception.execution_unit,
sizeof(debug_info->dsp_exception.execution_unit),
ex_info->envinfo.execution_unit);
"%s", ex_info->envinfo.execution_unit);
debug_info->dsp_exception.code1 =
ex_info->content.fatalerr.error_code.code1;
break;
Expand All @@ -603,7 +603,7 @@ static void mdee_dumper_info_prepare_v1(struct ccci_fsm_ee *mdee)
debug_info->name = "MD DMD FATAL ERROR";
snprintf(debug_info->dsp_fatal_err.execution_unit,
sizeof(debug_info->dsp_fatal_err.execution_unit),
ex_info->envinfo.execution_unit);
"%s", ex_info->envinfo.execution_unit);
debug_info->dsp_fatal_err.err_code[0] =
ex_info->content.fatalerr.error_code.code1;
debug_info->dsp_fatal_err.err_code[1] =
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/flashlight/richtek/rt-flashlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ struct flashlight_device *flashlight_device_register(const char *name,
flashlight_dev->dev.class = flashlight_class;
flashlight_dev->dev.parent = parent;
flashlight_dev->dev.release = flashlight_device_release;
dev_set_name(&flashlight_dev->dev, name);
dev_set_name(&flashlight_dev->dev, "%s", name);
dev_set_drvdata(&flashlight_dev->dev, devdata);
/* Copy properties */
if (props) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/gpu/ged/src/ged_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ GED_ERROR ged_thread_create(GED_THREAD_HANDLE *phThread, const char* szThreadNam

psThreadData->pFunc = pFunc;
psThreadData->pvData = pvData;
psThreadData->psThread = kthread_run(ged_thread_run, psThreadData, szThreadName);
psThreadData->psThread = kthread_run(ged_thread_run, psThreadData, "%s", szThreadName);

if (IS_ERR(psThreadData->psThread))
{
Expand Down
4 changes: 2 additions & 2 deletions drivers/misc/mediatek/rt-regmap/rt-regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ static int general_read(struct seq_file *seq_file, void *_data)
if (!rd->error_occurred)
seq_puts(seq_file, "No Error\n");
else
seq_printf(seq_file, rd->err_msg);
seq_printf(seq_file, "%s", rd->err_msg);
break;
case RT_DBG_REGS:
rt_show_regs(rd, seq_file);
Expand Down Expand Up @@ -2035,7 +2035,7 @@ struct rt_regmap_device *rt_regmap_device_register_ex
rd->dev.release = rt_regmap_device_release;
dev_set_drvdata(&rd->dev, drvdata);
snprintf(device_name, 32, "rt_regmap_%s", props->name);
dev_set_name(&rd->dev, device_name);
dev_set_name(&rd->dev, "%s", device_name);
memcpy(&rd->props, props, sizeof(struct rt_regmap_properties));
rd->props.cache_mode_ori = rd->props.rt_regmap_mode&RT_CACHE_MODE_MASK;

Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/scp/v01/scp_logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ void scp_crash_log_move_to_buf(enum scp_core_id scp_id)
ret = 0;
if (scp_last_logger) {
ret += snprintf(scp_last_logger, strlen(crash_message),
crash_message);
"%s", crash_message);
ret--;
while ((log_start_idx != log_end_idx) &&
ret <= (length + strlen(crash_message))) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/smi/smi_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ int smi_register(struct platform_driver *drv)
}

smi_dev->device = device_create(smi_dev->class, NULL, smi_dev->dev_no,
NULL, smi_dev->name);
NULL, "%s", smi_dev->name);
if (IS_ERR(smi_dev->device)) {
ret = PTR_ERR(smi_dev->device);
SMIERR("device_create failed: %d\n", ret);
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/usb_boost/usb_boost.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static int create_sys_fs(void)

for (i = 0 ; i < _TYPE_MAXID ; i++) {
boost_inst[i].dev = device_create(usb_boost_class,
NULL, MKDEV(0, i), NULL, type_name[i]);
NULL, MKDEV(0, i), NULL, "%s", type_name[i]);

for (n = 0; n < _ATTR_MAXID; n++) {
boost_inst[i].attr[n].attr.name = attr_name[n];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ void dprec_logger_event_init(struct dprec_logger_event *p, char *name,
mmp_event *mmp_root)
{
if (p) {
scnprintf(p->name, ARRAY_SIZE(p->name), name);
scnprintf(p->name, ARRAY_SIZE(p->name), "%s", name);
#ifdef SUPPORT_MMPROFILE /* FIXME: remove when MMP ready */
if (mmp_root)
p->mmp = mmprofile_register_event(*mmp_root, name);
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/video/mt6765/videox/disp_lowpower.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ void kick_logger_dump(char *string)

kick_buf_length +=
scnprintf(kick_string_buffer_analysize + kick_buf_length,
kick_dump_max_length - kick_buf_length, string);
kick_dump_max_length - kick_buf_length, "%s", string);
}

void kick_logger_dump_reset(void)
Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/host/mediatek/ComboA/dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ static int smp_test_on_hosts(struct seq_file *m, int thread_num,

sprintf(thread_name, "msdc_H%d_T%d", i, j);
kthread_run(write_read_thread, &wr_data[i][j],
thread_name);
"%s", thread_name);
seq_printf(m, " start thread: %s, at address: 0x%x\n",
thread_name, wr_data[i][j].start_address);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/power/supply/mediatek/charger/adapter_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct adapter_device *adapter_device_register(const char *name,
adapter_dev->dev.class = adapter_class;
adapter_dev->dev.parent = parent;
adapter_dev->dev.release = adapter_device_release;
dev_set_name(&adapter_dev->dev, name);
dev_set_name(&adapter_dev->dev, "%s", name);
dev_set_drvdata(&adapter_dev->dev, devdata);
head = &adapter_dev->evt_nh;
srcu_init_notifier_head(head);
Expand Down
2 changes: 1 addition & 1 deletion drivers/power/supply/mediatek/charger/charger_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ struct charger_device *charger_device_register(const char *name,
chg_dev->dev.class = charger_class;
chg_dev->dev.parent = parent;
chg_dev->dev.release = charger_device_release;
dev_set_name(&chg_dev->dev, name);
dev_set_name(&chg_dev->dev, "%s", name);
dev_set_drvdata(&chg_dev->dev, devdata);
head = &chg_dev->evt_nh;
srcu_init_notifier_head(head);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/nanohub/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ static int nanohub_create_devices(struct nanohub_data *data)

nanohub_io_init(io, data, device_create(sensor_class, NULL,
MKDEV(major, i),
io, names[i]));
io, "%s", names[i]));
if (IS_ERR(io->dev)) {
ret = PTR_ERR(io->dev);
pr_err("nanohub: device_create failed for %s; err=%d\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct device *create_function_device(char *name)
{
if (android_device && !IS_ERR(android_device))
return device_create(android_class, android_device,
MKDEV(0, index++), NULL, name);
MKDEV(0, index++), NULL, "%s", name);
else
return ERR_PTR(-EINVAL);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/meta.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ static int android_init_functions(struct android_usb_function **functions,
pr_notice("[USB]%s: f->dev_name = %s, f->name = %s\n", __func__,
f->dev_name, f->name);
f->dev = device_create(android_class, dev->dev,
MKDEV(0, index), f, f->dev_name);
MKDEV(0, index), f, "%s", f->dev_name);
if (IS_ERR(f->dev)) {
pr_info("%s: Failed to create dev %s", __func__,
f->dev_name);
Expand Down

0 comments on commit 1d5ac3e

Please sign in to comment.