File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,11 @@ late_initcall(cpu_latency_qos_init);
426
426
427
427
/* Definitions related to the frequency QoS below. */
428
428
429
+ static inline bool freq_qos_value_invalid (s32 value )
430
+ {
431
+ return value < 0 && value != PM_QOS_DEFAULT_VALUE ;
432
+ }
433
+
429
434
/**
430
435
* freq_constraints_init - Initialize frequency QoS constraints.
431
436
* @qos: Frequency QoS constraints to initialize.
@@ -531,7 +536,7 @@ int freq_qos_add_request(struct freq_constraints *qos,
531
536
{
532
537
int ret ;
533
538
534
- if (IS_ERR_OR_NULL (qos ) || !req || value < 0 )
539
+ if (IS_ERR_OR_NULL (qos ) || !req || freq_qos_value_invalid ( value ) )
535
540
return - EINVAL ;
536
541
537
542
if (WARN (freq_qos_request_active (req ),
@@ -563,7 +568,7 @@ EXPORT_SYMBOL_GPL(freq_qos_add_request);
563
568
*/
564
569
int freq_qos_update_request (struct freq_qos_request * req , s32 new_value )
565
570
{
566
- if (!req || new_value < 0 )
571
+ if (!req || freq_qos_value_invalid ( new_value ) )
567
572
return - EINVAL ;
568
573
569
574
if (WARN (!freq_qos_request_active (req ),
You can’t perform that action at this time.
0 commit comments