diff --git a/synapse/storage/client_ips.py b/synapse/storage/client_ips.py
index 365f08650dde83a4e22c04260a19f34dc8a1607e..e31fa53c3f3b8564f1e79e1a2002ac1a3162cfd1 100644
--- a/synapse/storage/client_ips.py
+++ b/synapse/storage/client_ips.py
@@ -103,9 +103,6 @@ class ClientIpStore(SQLBaseStore):
 
     @classmethod
     def _get_last_client_ip_by_device_txn(cls, txn, devices, retcols):
-        def where_clause_for_device(d):
-                return
-
         where_clauses = []
         bindings = []
         for (user_id, device_id) in devices: