From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C51DBCDB465 for ; Mon, 16 Oct 2023 21:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbjJPVRB (ORCPT ); Mon, 16 Oct 2023 17:17:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbjJPVRA (ORCPT ); Mon, 16 Oct 2023 17:17:00 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9491DAB for ; Mon, 16 Oct 2023 14:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697490971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3SAiQPWvobnJto4O41BfA3AiFFWeyo/r47R6J0AOHwI=; b=OM+MoNYfCySD5Imoxogqk7XOJp8q7uvtXL+dGrH9oj8mN/gKx4LaPmeTSbGyjT19CtTENo HOryqGXq3Y+hSWzKZBB1BJ8/M4+LYQelHVH8yW+n1TjvFUocTOMj7ewDETv+eG/W+/Q7hT xIAnVa9Co0p607wBAN+NwkJFaiuBpMg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-214-t7KphYJbOD-QLBESvVMFOw-1; Mon, 16 Oct 2023 17:16:09 -0400 X-MC-Unique: t7KphYJbOD-QLBESvVMFOw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 463C7185A79B; Mon, 16 Oct 2023 21:16:07 +0000 (UTC) Received: from [192.168.37.1] (unknown [10.22.48.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28779492BFA; Mon, 16 Oct 2023 21:16:04 +0000 (UTC) From: Benjamin Coddington To: Geert Uytterhoeven Cc: Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next v3 2/2] sunrpc: Use no_printk() in dfprintk*() dummies Date: Mon, 16 Oct 2023 17:16:03 -0400 Message-ID: In-Reply-To: <180fd042261dcd4243fad90660b114b8f0a78dcd.1697460614.git.geert+renesas@glider.be> References: <180fd042261dcd4243fad90660b114b8f0a78dcd.1697460614.git.geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 16 Oct 2023, at 9:09, Geert Uytterhoeven wrote: > When building NFS with W=3D1 and CONFIG_WERROR=3Dy, but > CONFIG_SUNRPC_DEBUG=3Dn: > > fs/nfs/nfs4proc.c: In function =E2=80=98nfs4_proc_create_session=E2= =80=99: > fs/nfs/nfs4proc.c:9276:19: error: variable =E2=80=98ptr=E2=80=99 se= t but not used [-Werror=3Dunused-but-set-variable] > 9276 | unsigned *ptr; > | ^~~ > CC fs/nfs/callback.o > fs/nfs/callback.c: In function =E2=80=98nfs41_callback_svc=E2=80=99= : > fs/nfs/callback.c:98:13: error: variable =E2=80=98error=E2=80=99 se= t but not used [-Werror=3Dunused-but-set-variable] > 98 | int error; > | ^~~~~ > CC fs/nfs/flexfilelayout/flexfilelayout.o > fs/nfs/flexfilelayout/flexfilelayout.c: In function =E2=80=98ff_lay= out_io_track_ds_error=E2=80=99: > fs/nfs/flexfilelayout/flexfilelayout.c:1230:13: error: variable =E2= =80=98err=E2=80=99 set but not used [-Werror=3Dunused-but-set-variable] > 1230 | int err; > | ^~~ > CC fs/nfs/flexfilelayout/flexfilelayoutdev.o > fs/nfs/flexfilelayout/flexfilelayoutdev.c: In function =E2=80=98nfs= 4_ff_alloc_deviceid_node=E2=80=99: > fs/nfs/flexfilelayout/flexfilelayoutdev.c:55:16: error: variable =E2= =80=98ret=E2=80=99 set but not used [-Werror=3Dunused-but-set-variable] > 55 | int i, ret =3D -ENOMEM; > | ^~~ > > All these are due to variables that are set unconditionally, but are > used only when debugging is enabled. > > Fix this by changing the dfprintk*() dummy macros from empty loops to > calls to the no_printk() helper. This informs the compiler that the > passed debug parameters are actually used, and enables format specifier= > checking as a bonus. > > This requires removing the protection by CONFIG_SUNRPC_DEBUG of the > declaration of nlmdbg_cookie2a() in fs/lockd/svclock.c, as its referenc= e > is now visible to the compiler, but optimized away. > > Signed-off-by: Geert Uytterhoeven > Acked-by: Jeff Layton Reviewed-by: Benjamin Coddington Ben