@@ -299,7 +299,7 @@ static void set_max_cpu_num(void)
299
299
300
300
/* get the highest possible cpu number for a sparse allocation */
301
301
ret = snprintf (path , PATH_MAX , "%s/devices/system/cpu/possible" , mnt );
302
- if (ret = = PATH_MAX ) {
302
+ if (ret > = PATH_MAX ) {
303
303
pr_err ("sysfs path crossed PATH_MAX(%d) size\n" , PATH_MAX );
304
304
goto out ;
305
305
}
@@ -310,7 +310,7 @@ static void set_max_cpu_num(void)
310
310
311
311
/* get the highest present cpu number for a sparse allocation */
312
312
ret = snprintf (path , PATH_MAX , "%s/devices/system/cpu/present" , mnt );
313
- if (ret = = PATH_MAX ) {
313
+ if (ret > = PATH_MAX ) {
314
314
pr_err ("sysfs path crossed PATH_MAX(%d) size\n" , PATH_MAX );
315
315
goto out ;
316
316
}
@@ -338,7 +338,7 @@ static void set_max_node_num(void)
338
338
339
339
/* get the highest possible cpu number for a sparse allocation */
340
340
ret = snprintf (path , PATH_MAX , "%s/devices/system/node/possible" , mnt );
341
- if (ret = = PATH_MAX ) {
341
+ if (ret > = PATH_MAX ) {
342
342
pr_err ("sysfs path crossed PATH_MAX(%d) size\n" , PATH_MAX );
343
343
goto out ;
344
344
}
@@ -423,7 +423,7 @@ int cpu__setup_cpunode_map(void)
423
423
return 0 ;
424
424
425
425
n = snprintf (path , PATH_MAX , "%s/devices/system/node" , mnt );
426
- if (n = = PATH_MAX ) {
426
+ if (n > = PATH_MAX ) {
427
427
pr_err ("sysfs path crossed PATH_MAX(%d) size\n" , PATH_MAX );
428
428
return -1 ;
429
429
}
@@ -438,7 +438,7 @@ int cpu__setup_cpunode_map(void)
438
438
continue ;
439
439
440
440
n = snprintf (buf , PATH_MAX , "%s/%s" , path , dent1 -> d_name );
441
- if (n = = PATH_MAX ) {
441
+ if (n > = PATH_MAX ) {
442
442
pr_err ("sysfs path crossed PATH_MAX(%d) size\n" , PATH_MAX );
443
443
continue ;
444
444
}
0 commit comments