All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [cel:topic-rpc-with-tls-upcall 3/19] net/tls/af_tlsh.c:100:52: warning: Parameter 'net' can be declared with const [constParameter]
Date: Mon, 30 May 2022 09:03:59 +0800	[thread overview]
Message-ID: <202205300838.RhsBELII-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3507 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Chuck Lever <chuck.lever@oracle.com>
CC: Hannes Reinecke <hare@suse.de>

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux topic-rpc-with-tls-upcall
head:   b1c8574490c25c8b5bade67796641a449badc818
commit: 47ebadbb7c8a9c6329f485ed254c38350492727b [3/19] net/tls: Add support for PF_TLSH (a TLS handshake listener)
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
compiler: s390-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout 47ebadbb7c8a9c6329f485ed254c38350492727b
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> net/tls/af_tlsh.c:100:52: warning: Parameter 'net' can be declared with const [constParameter]
   static struct sock *tlsh_find_listener(struct net *net, unsigned short family)
                                                      ^

vim +/net +100 net/tls/af_tlsh.c

47ebadbb7c8a9c Chuck Lever 2021-11-19   90  
47ebadbb7c8a9c Chuck Lever 2021-11-19   91  /**
47ebadbb7c8a9c Chuck Lever 2021-11-19   92   * tlsh_find_listener - find listener that matches an incoming connection
47ebadbb7c8a9c Chuck Lever 2021-11-19   93   * @net: net namespace to match
47ebadbb7c8a9c Chuck Lever 2021-11-19   94   * @family: address family to match
47ebadbb7c8a9c Chuck Lever 2021-11-19   95   *
47ebadbb7c8a9c Chuck Lever 2021-11-19   96   * Return values:
47ebadbb7c8a9c Chuck Lever 2021-11-19   97   *   On success, address of a listening AF_TLSH socket
47ebadbb7c8a9c Chuck Lever 2021-11-19   98   *   %NULL: No matching listener found
47ebadbb7c8a9c Chuck Lever 2021-11-19   99   */
47ebadbb7c8a9c Chuck Lever 2021-11-19 @100  static struct sock *tlsh_find_listener(struct net *net, unsigned short family)
47ebadbb7c8a9c Chuck Lever 2021-11-19  101  {
47ebadbb7c8a9c Chuck Lever 2021-11-19  102  	struct sock *listener;
47ebadbb7c8a9c Chuck Lever 2021-11-19  103  
47ebadbb7c8a9c Chuck Lever 2021-11-19  104  	read_lock(&tlsh_listener_lock);
47ebadbb7c8a9c Chuck Lever 2021-11-19  105  
47ebadbb7c8a9c Chuck Lever 2021-11-19  106  	sk_for_each(listener, &tlsh_listeners) {
47ebadbb7c8a9c Chuck Lever 2021-11-19  107  		if (sock_net(listener) != net)
47ebadbb7c8a9c Chuck Lever 2021-11-19  108  			continue;
47ebadbb7c8a9c Chuck Lever 2021-11-19  109  		if (tlsh_sk(listener)->th_bind_family != AF_UNSPEC &&
47ebadbb7c8a9c Chuck Lever 2021-11-19  110  		    tlsh_sk(listener)->th_bind_family != family)
47ebadbb7c8a9c Chuck Lever 2021-11-19  111  			continue;
47ebadbb7c8a9c Chuck Lever 2021-11-19  112  
47ebadbb7c8a9c Chuck Lever 2021-11-19  113  		sock_hold(listener);	/* Ref: C */
47ebadbb7c8a9c Chuck Lever 2021-11-19  114  		goto out;
47ebadbb7c8a9c Chuck Lever 2021-11-19  115  	}
47ebadbb7c8a9c Chuck Lever 2021-11-19  116  	listener = NULL;
47ebadbb7c8a9c Chuck Lever 2021-11-19  117  
47ebadbb7c8a9c Chuck Lever 2021-11-19  118  out:
47ebadbb7c8a9c Chuck Lever 2021-11-19  119  	read_unlock(&tlsh_listener_lock);
47ebadbb7c8a9c Chuck Lever 2021-11-19  120  	return listener;
47ebadbb7c8a9c Chuck Lever 2021-11-19  121  }
47ebadbb7c8a9c Chuck Lever 2021-11-19  122  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-05-30  1:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202205300838.RhsBELII-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.