From nobody Tue Apr 7 17:14:30 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90C20332637 for ; Thu, 26 Feb 2026 18:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772129632; cv=none; b=fO5cwZafenVM4JOwsX6gtd1E4i0+OmtTWbkMEW1HxQQz4sKtZE+0srXzjxrk5bT990DGGLIZoytEorS7npcNziBDFiN3TguwbE8KaMwsblR26In0l+AE5qg8cY18xe47wTtERO/n1hW2VPCIfl7DXrukR/QRz7BBRrz4PuF8xhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772129632; c=relaxed/simple; bh=TKtyPv/fUkMLoB48HfHVIQzQqfQau+NU52aJHmhZk1M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oPE09er6I1D/CEH9UB7tGaOTmbo97vZY8XVm68dSttjXdi6qgJRSnl1Ia+nx0ybaR2+2Jq3mrcgRRkm3mHNRaxffgh+1AbxCUYGL/5JVJnFNEklS+9tqOEbILx4jGt66jInKC53lizFb8uF7RITG9HVKYc91CCCqx0JMuXuwuKM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=AEzc3vf3; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AEzc3vf3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772129630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=8/TyEfe76Y6Kiy4VsURDps2mRDuc/UO2jHi1HRNucPI=; b=AEzc3vf3cV+2flkUvD2+3RFNykvBKIxfApl9KZ6WUxfl2pL5fn0FOxBmKiiCK5Lx/+g9nc RyrLbVpdHEm3Ca5wTXmB5ya2kTLnvX7fxcjAyLa8wKT9QToLWh8YJherU7x5RMj2SI/DcQ uSfgFVjK1mgtT2Az3osMRyBpde6HsmA= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-213-VwNu4PR_O7yVNexRbgIGeA-1; Thu, 26 Feb 2026 13:13:47 -0500 X-MC-Unique: VwNu4PR_O7yVNexRbgIGeA-1 X-Mimecast-MFC-AGG-ID: VwNu4PR_O7yVNexRbgIGeA_1772129626 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2699E1956063; Thu, 26 Feb 2026 18:13:46 +0000 (UTC) Received: from wsxc.redhat.com (unknown [10.96.134.51]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 41ED71956056; Thu, 26 Feb 2026 18:13:42 +0000 (UTC) From: Ricardo Robaina To: audit@vger.kernel.org, linux-kernel@vger.kernel.org Cc: paul@paul-moore.com, eparis@redhat.com, Ricardo Robaina Subject: [PATCH] audit: remove redundant initialization of static variables to 0 Date: Thu, 26 Feb 2026 15:13:38 -0300 Message-ID: <20260226181338.2526777-1-rrobaina@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" Static variables are automatically initialized to 0 by the compiler. Remove the redundant explicit assignments in kernel/audit.c to clean up the code, align with standard kernel coding style, and fix the following checkpatch.pl errors: ./scripts/checkpatch.pl kernel/audit.c | grep -A2 ERROR: ERROR: do not initialise statics to 0 + static unsigned long last_check =3D 0; -- ERROR: do not initialise statics to 0 + static int messages =3D 0; -- ERROR: do not initialise statics to 0 + static unsigned long last_msg =3D 0; Signed-off-by: Ricardo Robaina --- kernel/audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/audit.c b/kernel/audit.c index 5a0216056524..08793e71b975 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -355,8 +355,8 @@ void audit_panic(const char *message) =20 static inline int audit_rate_check(void) { - static unsigned long last_check =3D 0; - static int messages =3D 0; + static unsigned long last_check; + static int messages; static DEFINE_SPINLOCK(lock); unsigned long flags; unsigned long now; @@ -391,7 +391,7 @@ static inline int audit_rate_check(void) */ void audit_log_lost(const char *message) { - static unsigned long last_msg =3D 0; + static unsigned long last_msg; static DEFINE_SPINLOCK(lock); unsigned long flags; unsigned long now; --=20 2.53.0