public inbox for netfs@lists.linux.dev
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Paulo Alcantara <pc@manguebit.org>, Enzo Matsumiya <ematsumiya@suse.de>
Cc: Steve French <sfrench@samba.org>,
	David Howells <dhowells@redhat.com>,
	Shyam Prasad N <sprasad@microsoft.com>,
	Stefan Metzmacher <metze@samba.org>,
	linux-cifs@vger.kernel.org, netfs@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Can we sort out the prototypes within the cifs headers?
Date: Mon, 01 Dec 2025 13:25:23 +0000	[thread overview]
Message-ID: <1430101.1764595523@warthog.procyon.org.uk> (raw)

Hi Paulo, Enzo, et al.,

You may have seen my patch:

	https://lore.kernel.org/linux-cifs/20251124124251.3565566-4-dhowells@redhat.com/T/#u

to sort out the cifs header file prototypes, which are a bit of a mess: some
seem to have been placed haphazardly in the headers, some have unnamed
arguments and also sometimes the names in the .h and the .c don't match.

Now Steve specifically namechecked you two as this will affect the backporting
of patches.  Whilst this only affects the prototypes in the headers and not
the implementations in C files, it does cause chunks of the headers to move
around.

Can we agree on at least a subset of the cleanups to be made?  In order of
increasing conflictiveness, I have:

 (1) Remove 'extern'.  cifs has a mix of externed and non-externed, but the
     documented approach is to get rid of externs on prototypes.

 (2) (Re)name the arguments in the prototypes to be the same as in the
     implementations.

 (3) Adjust the layout of each prototype to match the implementation, just
     with a semicolon on the end.  My script partially does this, but moves
     the return type onto the same line as the function name.

 (4) Move SMB1-specific functions out to smb1proto.h.  Move SMB2/3-specific
     functions out to smb2proto.h.

 (5) Divide the lists of prototypes (particularly the massive one in
     cifsproto.h) up into blocks according to which .c file contains the
     implementation and preface each block with a comment that indicates the
     name of the relevant .c file.

     The comment could then be used as a key for the script to maintain the
     division in future.

 (6) Sort each block by position in the .c file to make it easier to maintain
     them.

A hybrid approach is also possible, where we run the script to do the basic
sorting and then manually correct the output.

David


             reply	other threads:[~2025-12-01 13:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 13:25 David Howells [this message]
2025-12-01 16:55 ` Can we sort out the prototypes within the cifs headers? Steve French
2025-12-01 17:30 ` Enzo Matsumiya
2025-12-01 18:16   ` Steve French
2026-01-02 18:43   ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430101.1764595523@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=ematsumiya@suse.de \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=metze@samba.org \
    --cc=netfs@lists.linux.dev \
    --cc=pc@manguebit.org \
    --cc=sfrench@samba.org \
    --cc=sprasad@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox