diff --git a/src/plugins/value/engine/partitioned_dataflow.ml b/src/plugins/value/engine/partitioned_dataflow.ml
index 34b0444509ec51b8be814ba930caf101aba28cd9..0fefd04e9a5548e9389a44c2e923766e4395cf23 100644
--- a/src/plugins/value/engine/partitioned_dataflow.ml
+++ b/src/plugins/value/engine/partitioned_dataflow.ml
@@ -111,19 +111,16 @@ module Make_Dataflow
   let unroll (stmt : stmt) : int =
     let local_unroll = match Unroll_annots.get_unroll_terms stmt with
       | [] ->
-        let loop_attr_and_wkey =
-          if Cil.hasAttribute "for" stmt.sattr then
-            Some ("for", Value_parameters.wkey_missing_loop_unroll_for)
-          else if Cil.hasAttribute "while" stmt.sattr then
-            Some ("while", Value_parameters.wkey_missing_loop_unroll)
-          else if Cil.hasAttribute "dowhile" stmt.sattr then
-            Some ("dowhile", Value_parameters.wkey_missing_loop_unroll)
-          else None
-        in
+        let is_attribute a = Cil.hasAttribute a stmt.sattr in
         begin
-          match loop_attr_and_wkey with
-          | None -> ()
-          | Some (loop_kind, wkey) ->
+          match List.filter is_attribute ["for" ; "while" ; "dowhile"] with
+          | [] -> ()
+          | loop_kind :: _ ->
+            let wkey =
+              if loop_kind = "for"
+              then Value_parameters.wkey_missing_loop_unroll_for
+              else Value_parameters.wkey_missing_loop_unroll
+            in
             Value_parameters.warning
               ~wkey ~source:(fst (Cil_datatype.Stmt.loc stmt)) ~once:true
               "%s loop without unroll annotation" loop_kind