linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/16]Fix several bad kernel-doc markups
@ 2020-12-01 12:08 Mauro Carvalho Chehab
  2020-12-01 12:08 ` [PATCH v5 01/16] HSI: fix a kernel-doc markup Mauro Carvalho Chehab
                   ` (15 more replies)
  0 siblings, 16 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:08 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, linux-kernel, Alexander Viro,
	Alexandre Bounine, Andy Lutomirski, Anton Vorontsov, Ben Segall,
	Colin Cross, Daniel Bristot de Oliveira, Dietmar Eggemann,
	Evgeniy Polyakov, Ingo Molnar, Juri Lelli, Kees Cook,
	Matt Porter, Mel Gorman, Mike Rapoport, Peter Zijlstra,
	Richard Gong, Sebastian Reichel, Shuah Khan, Steven Rostedt,
	Sudip Mukherjee, Tony Luck, Vincent Guittot, Will Drewry,
	linux-fsdevel, linux-kselftest, linux-mm, linux-rdma,
	target-devel

Kernel-doc has always be limited to a probably bad documented
rule:

The kernel-doc markups should appear *imediatelly before* the
function or data structure that it documents.

On other words, if a C file would contain something like this:

	/**
	 * foo - function foo
	 * @args: foo args
	 */
	static inline void bar(int args);

	/**
	 * bar - function bar
	 * @args: foo args
	 */
	static inline void foo(void *args);


The output (in ReST format) will be:

	.. c:function:: void bar (int args)

	   function foo

	**Parameters**

	``int args``
	  foo args


	.. c:function:: void foo (void *args)

	   function bar

	**Parameters**

	``void *args``
	  foo args

Which is clearly a wrong result.  Before this changeset, 
not even a warning is produced on such cases.

As placing such markups just before the documented
data is a common practice, on most cases this is fine.

However, as patches touch things, identifiers may be
renamed, and people may forget to update the kernel-doc
markups to follow such changes.

This has been happening for quite a while, as there are
lots of files with kernel-doc problems.

This series address those issues and add a file at the
end that will enforce that the identifier will match the
kernel-doc markup, avoiding this problem from
keep happening as time goes by.

This series is based on current upstream tree.

@maintainers: feel free to pick the patches and
apply them directly on your trees, as all patches on 
this series are independent from the other ones.

--

v5:
  - The completion.h patch was replaced by another one which drops
    an obsolete macro;
  - Some typos got fixed and review tags got added;
  - Dropped patches that were already merged at linux-next.

v4:

  - Patches got rebased and got some acks.

Mauro Carvalho Chehab (16):
  HSI: fix a kernel-doc markup
  IB: fix kernel-doc markups
  parport: fix a kernel-doc markup
  rapidio: fix kernel-doc a markup
  fs: fix kernel-doc markups
  pstore/zone: fix a kernel-doc markup
  completion: drop init_completion define
  firmware: stratix10-svc: fix kernel-doc markups
  connector: fix a kernel-doc markup
  lib/crc7: fix a kernel-doc markup
  memblock: fix kernel-doc markups
  w1: fix a kernel-doc markup
  sched: fix kernel-doc markup
  selftests: kselftest_harness.h: partially fix kernel-doc markups
  refcount.h: fix a kernel-doc markup
  scripts: kernel-doc: validate kernel-doc markup with the actual names

 drivers/hsi/hsi_core.c                        |  2 +-
 drivers/infiniband/core/cm.c                  |  5 +-
 drivers/infiniband/core/cq.c                  |  4 +-
 drivers/infiniband/core/iwpm_util.h           |  2 +-
 drivers/infiniband/core/sa_query.c            |  3 +-
 drivers/infiniband/core/verbs.c               |  4 +-
 drivers/infiniband/sw/rdmavt/ah.c             |  2 +-
 drivers/infiniband/sw/rdmavt/mcast.c          | 12 ++--
 drivers/infiniband/sw/rdmavt/qp.c             |  8 +--
 drivers/infiniband/ulp/iser/iscsi_iser.c      |  2 +-
 .../infiniband/ulp/opa_vnic/opa_vnic_encap.h  |  2 +-
 .../ulp/opa_vnic/opa_vnic_vema_iface.c        |  2 +-
 drivers/infiniband/ulp/srpt/ib_srpt.h         |  2 +-
 drivers/parport/share.c                       |  2 +-
 drivers/rapidio/rio.c                         |  2 +-
 fs/dcache.c                                   | 72 +++++++++----------
 fs/inode.c                                    |  4 +-
 fs/pstore/zone.c                              |  2 +-
 fs/seq_file.c                                 |  5 +-
 fs/super.c                                    | 12 ++--
 include/linux/completion.h                    |  5 +-
 include/linux/connector.h                     |  2 +-
 .../firmware/intel/stratix10-svc-client.h     | 10 +--
 include/linux/memblock.h                      |  4 +-
 include/linux/parport.h                       | 31 ++++++++
 include/linux/refcount.h                      |  2 +-
 include/linux/w1.h                            |  2 +-
 include/rdma/ib_verbs.h                       | 11 +++
 kernel/sched/core.c                           | 16 ++---
 kernel/sched/fair.c                           |  2 +-
 lib/crc7.c                                    |  2 +-
 scripts/kernel-doc                            | 62 +++++++++++-----
 tools/testing/selftests/kselftest_harness.h   | 22 +++---
 33 files changed, 197 insertions(+), 123 deletions(-)

-- 
2.28.0



^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH v5 01/16] HSI: fix a kernel-doc markup
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
@ 2020-12-01 12:08 ` Mauro Carvalho Chehab
  2020-12-02 21:38   ` Sebastian Reichel
  2020-12-01 12:08 ` [PATCH v5 02/16] IB: fix kernel-doc markups Mauro Carvalho Chehab
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:08 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Sebastian Reichel, linux-kernel

A function has a different name between their prototype
and its kernel-doc markup.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/hsi/hsi_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hsi/hsi_core.c b/drivers/hsi/hsi_core.c
index 47f0208aa7c3..c3fb5beb846e 100644
--- a/drivers/hsi/hsi_core.c
+++ b/drivers/hsi/hsi_core.c
@@ -323,65 +323,65 @@ EXPORT_SYMBOL_GPL(hsi_add_clients_from_dt);
 #endif
 
 int hsi_remove_client(struct device *dev, void *data __maybe_unused)
 {
 	device_unregister(dev);
 
 	return 0;
 }
 EXPORT_SYMBOL_GPL(hsi_remove_client);
 
 static int hsi_remove_port(struct device *dev, void *data __maybe_unused)
 {
 	device_for_each_child(dev, NULL, hsi_remove_client);
 	device_unregister(dev);
 
 	return 0;
 }
 
 static void hsi_controller_release(struct device *dev)
 {
 	struct hsi_controller *hsi = to_hsi_controller(dev);
 
 	kfree(hsi->port);
 	kfree(hsi);
 }
 
 static void hsi_port_release(struct device *dev)
 {
 	kfree(to_hsi_port(dev));
 }
 
 /**
- * hsi_unregister_port - Unregister an HSI port
+ * hsi_port_unregister_clients - Unregister an HSI port
  * @port: The HSI port to unregister
  */
 void hsi_port_unregister_clients(struct hsi_port *port)
 {
 	device_for_each_child(&port->device, NULL, hsi_remove_client);
 }
 EXPORT_SYMBOL_GPL(hsi_port_unregister_clients);
 
 /**
  * hsi_unregister_controller - Unregister an HSI controller
  * @hsi: The HSI controller to register
  */
 void hsi_unregister_controller(struct hsi_controller *hsi)
 {
 	device_for_each_child(&hsi->device, NULL, hsi_remove_port);
 	device_unregister(&hsi->device);
 }
 EXPORT_SYMBOL_GPL(hsi_unregister_controller);
 
 /**
  * hsi_register_controller - Register an HSI controller and its ports
  * @hsi: The HSI controller to register
  *
  * Returns -errno on failure, 0 on success.
  */
 int hsi_register_controller(struct hsi_controller *hsi)
 {
 	unsigned int i;
 	int err;
 
 	err = device_add(&hsi->device);
 	if (err < 0)
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 02/16] IB: fix kernel-doc markups
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
  2020-12-01 12:08 ` [PATCH v5 01/16] HSI: fix a kernel-doc markup Mauro Carvalho Chehab
@ 2020-12-01 12:08 ` Mauro Carvalho Chehab
  2020-12-07 19:46   ` Jason Gunthorpe
  2020-12-01 12:08 ` [PATCH v5 03/16] parport: fix a kernel-doc markup Mauro Carvalho Chehab
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:08 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Gustavo A. R. Silva, Håkon Bugge,
	Bart Van Assche, Chuck Lever, Dennis Dalessandro, Divya Indi,
	Doug Ledford, Gal Pressman, Jason Gunthorpe, Leon Romanovsky,
	Maor Gottlieb, Max Gurtovoy, Mike Marciniszyn, Moni Shoua,
	Parav Pandit, Sagi Grimberg, Ursula Braun, Xi Wang,
	Yamin Friedman, linux-kernel, linux-rdma, target-devel

Some functions have different names between their prototypes
and the kernel-doc markup.

Others need to be fixed, as kernel-doc markups should use this format:
        identifier - description

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/infiniband/core/cm.c                         |  5 +++--
 drivers/infiniband/core/cq.c                         |  4 ++--
 drivers/infiniband/core/iwpm_util.h                  |  2 +-
 drivers/infiniband/core/sa_query.c                   |  3 ++-
 drivers/infiniband/core/verbs.c                      |  4 ++--
 drivers/infiniband/sw/rdmavt/ah.c                    |  2 +-
 drivers/infiniband/sw/rdmavt/mcast.c                 | 12 ++++++------
 drivers/infiniband/sw/rdmavt/qp.c                    |  8 ++++----
 drivers/infiniband/ulp/iser/iscsi_iser.c             |  2 +-
 drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h     |  2 +-
 .../infiniband/ulp/opa_vnic/opa_vnic_vema_iface.c    |  2 +-
 drivers/infiniband/ulp/srpt/ib_srpt.h                |  2 +-
 include/rdma/ib_verbs.h                              | 11 +++++++++++
 13 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 167e436ae11d..46c48690f909 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -1222,65 +1222,66 @@ static int cm_init_listen(struct cm_id_private *cm_id_priv, __be64 service_id,
 int ib_cm_listen(struct ib_cm_id *cm_id, __be64 service_id, __be64 service_mask)
 {
 	struct cm_id_private *cm_id_priv =
 		container_of(cm_id, struct cm_id_private, id);
 	unsigned long flags;
 	int ret;
 
 	spin_lock_irqsave(&cm_id_priv->lock, flags);
 	if (cm_id_priv->id.state != IB_CM_IDLE) {
 		ret = -EINVAL;
 		goto out;
 	}
 
 	ret = cm_init_listen(cm_id_priv, service_id, service_mask);
 	if (ret)
 		goto out;
 
 	if (!cm_insert_listen(cm_id_priv, NULL)) {
 		ret = -EBUSY;
 		goto out;
 	}
 
 	cm_id_priv->id.state = IB_CM_LISTEN;
 	ret = 0;
 
 out:
 	spin_unlock_irqrestore(&cm_id_priv->lock, flags);
 	return ret;
 }
 EXPORT_SYMBOL(ib_cm_listen);
 
 /**
- * Create a new listening ib_cm_id and listen on the given service ID.
+ * ib_cm_insert_listen - Create a new listening ib_cm_id and listen on
+ *			 the given service ID.
  *
  * If there's an existing ID listening on that same device and service ID,
  * return it.
  *
  * @device: Device associated with the cm_id.  All related communication will
  * be associated with the specified device.
  * @cm_handler: Callback invoked to notify the user of CM events.
  * @service_id: Service identifier matched against incoming connection
  *   and service ID resolution requests.  The service ID should be specified
  *   network-byte order.  If set to IB_CM_ASSIGN_SERVICE_ID, the CM will
  *   assign a service ID to the caller.
  *
  * Callers should call ib_destroy_cm_id when done with the listener ID.
  */
 struct ib_cm_id *ib_cm_insert_listen(struct ib_device *device,
 				     ib_cm_handler cm_handler,
 				     __be64 service_id)
 {
 	struct cm_id_private *listen_id_priv;
 	struct cm_id_private *cm_id_priv;
 	int err = 0;
 
 	/* Create an ID in advance, since the creation may sleep */
 	cm_id_priv = cm_alloc_id_priv(device, cm_handler, NULL);
 	if (IS_ERR(cm_id_priv))
 		return ERR_CAST(cm_id_priv);
 
 	err = cm_init_listen(cm_id_priv, service_id, 0);
 	if (err)
 		return ERR_PTR(err);
 
 	spin_lock_irq(&cm_id_priv->lock);
@@ -1735,65 +1736,65 @@ static void cm_format_paths_from_req(struct cm_req_msg *req_msg,
 		alt_path->packet_life_time_selector = IB_SA_EQ;
 		alt_path->packet_life_time =
 			IBA_GET(CM_REQ_ALTERNATE_LOCAL_ACK_TIMEOUT, req_msg);
 		alt_path->packet_life_time -= (alt_path->packet_life_time > 0);
 		alt_path->service_id =
 			cpu_to_be64(IBA_GET(CM_REQ_SERVICE_ID, req_msg));
 
 		if (sa_path_is_roce(alt_path))
 			alt_path->roce.route_resolved = false;
 	}
 	cm_format_path_lid_from_req(req_msg, primary_path, alt_path);
 }
 
 static u16 cm_get_bth_pkey(struct cm_work *work)
 {
 	struct ib_device *ib_dev = work->port->cm_dev->ib_device;
 	u8 port_num = work->port->port_num;
 	u16 pkey_index = work->mad_recv_wc->wc->pkey_index;
 	u16 pkey;
 	int ret;
 
 	ret = ib_get_cached_pkey(ib_dev, port_num, pkey_index, &pkey);
 	if (ret) {
 		dev_warn_ratelimited(&ib_dev->dev, "ib_cm: Couldn't retrieve pkey for incoming request (port %d, pkey index %d). %d\n",
 				     port_num, pkey_index, ret);
 		return 0;
 	}
 
 	return pkey;
 }
 
 /**
- * Convert OPA SGID to IB SGID
+ * cm_opa_to_ib_sgid - Convert OPA SGID to IB SGID
  * ULPs (such as IPoIB) do not understand OPA GIDs and will
  * reject them as the local_gid will not match the sgid. Therefore,
  * change the pathrec's SGID to an IB SGID.
  *
  * @work: Work completion
  * @path: Path record
  */
 static void cm_opa_to_ib_sgid(struct cm_work *work,
 			      struct sa_path_rec *path)
 {
 	struct ib_device *dev = work->port->cm_dev->ib_device;
 	u8 port_num = work->port->port_num;
 
 	if (rdma_cap_opa_ah(dev, port_num) &&
 	    (ib_is_opa_gid(&path->sgid))) {
 		union ib_gid sgid;
 
 		if (rdma_query_gid(dev, port_num, 0, &sgid)) {
 			dev_warn(&dev->dev,
 				 "Error updating sgid in CM request\n");
 			return;
 		}
 
 		path->sgid = sgid;
 	}
 }
 
 static void cm_format_req_event(struct cm_work *work,
 				struct cm_id_private *cm_id_priv,
 				struct ib_cm_id *listen_id)
 {
 	struct cm_req_msg *req_msg;
diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c
index 12ebacf52958..d4248bbe74da 100644
--- a/drivers/infiniband/core/cq.c
+++ b/drivers/infiniband/core/cq.c
@@ -94,65 +94,65 @@ static int __ib_process_cq(struct ib_cq *cq, int budget, struct ib_wc *wcs,
 			   int batch)
 {
 	int i, n, completed = 0;
 
 	trace_cq_process(cq);
 
 	/*
 	 * budget might be (-1) if the caller does not
 	 * want to bound this call, thus we need unsigned
 	 * minimum here.
 	 */
 	while ((n = __poll_cq(cq, min_t(u32, batch,
 					budget - completed), wcs)) > 0) {
 		for (i = 0; i < n; i++) {
 			struct ib_wc *wc = &wcs[i];
 
 			if (wc->wr_cqe)
 				wc->wr_cqe->done(cq, wc);
 			else
 				WARN_ON_ONCE(wc->status == IB_WC_SUCCESS);
 		}
 
 		completed += n;
 
 		if (n != batch || (budget != -1 && completed >= budget))
 			break;
 	}
 
 	return completed;
 }
 
 /**
- * ib_process_direct_cq - process a CQ in caller context
+ * ib_process_cq_direct - process a CQ in caller context
  * @cq:		CQ to process
  * @budget:	number of CQEs to poll for
  *
  * This function is used to process all outstanding CQ entries.
  * It does not offload CQ processing to a different context and does
  * not ask for completion interrupts from the HCA.
  * Using direct processing on CQ with non IB_POLL_DIRECT type may trigger
  * concurrent processing.
  *
  * Note: do not pass -1 as %budget unless it is guaranteed that the number
  * of completions that will be processed is small.
  */
 int ib_process_cq_direct(struct ib_cq *cq, int budget)
 {
 	struct ib_wc wcs[IB_POLL_BATCH_DIRECT];
 
 	return __ib_process_cq(cq, budget, wcs, IB_POLL_BATCH_DIRECT);
 }
 EXPORT_SYMBOL(ib_process_cq_direct);
 
 static void ib_cq_completion_direct(struct ib_cq *cq, void *private)
 {
 	WARN_ONCE(1, "got unsolicited completion for CQ 0x%p\n", cq);
 }
 
 static int ib_poll_handler(struct irq_poll *iop, int budget)
 {
 	struct ib_cq *cq = container_of(iop, struct ib_cq, iop);
 	struct dim *dim = cq->dim;
 	int completed;
 
 	completed = __ib_process_cq(cq, budget, cq->wc, IB_POLL_BATCH);
@@ -168,65 +168,65 @@ static int ib_poll_handler(struct irq_poll *iop, int budget)
 		rdma_dim(dim, completed);
 
 	return completed;
 }
 
 static void ib_cq_completion_softirq(struct ib_cq *cq, void *private)
 {
 	trace_cq_schedule(cq);
 	irq_poll_sched(&cq->iop);
 }
 
 static void ib_cq_poll_work(struct work_struct *work)
 {
 	struct ib_cq *cq = container_of(work, struct ib_cq, work);
 	int completed;
 
 	completed = __ib_process_cq(cq, IB_POLL_BUDGET_WORKQUEUE, cq->wc,
 				    IB_POLL_BATCH);
 	if (completed >= IB_POLL_BUDGET_WORKQUEUE ||
 	    ib_req_notify_cq(cq, IB_POLL_FLAGS) > 0)
 		queue_work(cq->comp_wq, &cq->work);
 	else if (cq->dim)
 		rdma_dim(cq->dim, completed);
 }
 
 static void ib_cq_completion_workqueue(struct ib_cq *cq, void *private)
 {
 	trace_cq_schedule(cq);
 	queue_work(cq->comp_wq, &cq->work);
 }
 
 /**
- * __ib_alloc_cq        allocate a completion queue
+ * __ib_alloc_cq - allocate a completion queue
  * @dev:		device to allocate the CQ for
  * @private:		driver private data, accessible from cq->cq_context
  * @nr_cqe:		number of CQEs to allocate
  * @comp_vector:	HCA completion vectors for this CQ
  * @poll_ctx:		context to poll the CQ from.
  * @caller:		module owner name.
  *
  * This is the proper interface to allocate a CQ for in-kernel users. A
  * CQ allocated with this interface will automatically be polled from the
  * specified context. The ULP must use wr->wr_cqe instead of wr->wr_id
  * to use this CQ abstraction.
  */
 struct ib_cq *__ib_alloc_cq(struct ib_device *dev, void *private, int nr_cqe,
 			    int comp_vector, enum ib_poll_context poll_ctx,
 			    const char *caller)
 {
 	struct ib_cq_init_attr cq_attr = {
 		.cqe		= nr_cqe,
 		.comp_vector	= comp_vector,
 	};
 	struct ib_cq *cq;
 	int ret = -ENOMEM;
 
 	cq = rdma_zalloc_drv_obj(dev, ib_cq);
 	if (!cq)
 		return ERR_PTR(ret);
 
 	cq->device = dev;
 	cq->cq_context = private;
 	cq->poll_ctx = poll_ctx;
 	atomic_set(&cq->usecnt, 0);
 	cq->comp_vector = comp_vector;
diff --git a/drivers/infiniband/core/iwpm_util.h b/drivers/infiniband/core/iwpm_util.h
index 1bf87d9fd0bd..eeb8e6010907 100644
--- a/drivers/infiniband/core/iwpm_util.h
+++ b/drivers/infiniband/core/iwpm_util.h
@@ -112,65 +112,65 @@ struct iwpm_nlmsg_request *iwpm_get_nlmsg_request(__u32 nlmsg_seq,
  * iwpm_free_nlmsg_request - Deallocate netlink message request
  * @kref: Holds reference of netlink message request
  */
 void iwpm_free_nlmsg_request(struct kref *kref);
 
 /**
  * iwpm_find_nlmsg_request - Find netlink message request in the request list
  * @echo_seq: Sequence number of the netlink request to find
  *
  * Returns the found netlink message request,
  * if not found, returns NULL
  */
 struct iwpm_nlmsg_request *iwpm_find_nlmsg_request(__u32 echo_seq);
 
 /**
  * iwpm_wait_complete_req - Block while servicing the netlink request
  * @nlmsg_request: Netlink message request to service
  *
  * Wakes up, after the request is completed or expired
  * Returns 0 if the request is complete without error
  */
 int iwpm_wait_complete_req(struct iwpm_nlmsg_request *nlmsg_request);
 
 /**
  * iwpm_get_nlmsg_seq - Get the sequence number for a netlink
  *			message to send to the port mapper
  *
  * Returns the sequence number for the netlink message.
  */
 int iwpm_get_nlmsg_seq(void);
 
 /**
- * iwpm_add_reminfo - Add remote address info of the connecting peer
+ * iwpm_add_remote_info - Add remote address info of the connecting peer
  *                    to the remote info hash table
  * @reminfo: The remote info to be added
  */
 void iwpm_add_remote_info(struct iwpm_remote_info *reminfo);
 
 /**
  * iwpm_valid_client - Check if the port mapper client is valid
  * @nl_client: The index of the netlink client
  *
  * Valid clients need to call iwpm_init() before using
  * the port mapper
  */
 int iwpm_valid_client(u8 nl_client);
 
 /**
  * iwpm_set_valid - Set the port mapper client to valid or not
  * @nl_client: The index of the netlink client
  * @valid: 1 if valid or 0 if invalid
  */
 void iwpm_set_valid(u8 nl_client, int valid);
 
 /**
  * iwpm_check_registration - Check if the client registration
  *			      matches the given one
  * @nl_client: The index of the netlink client
  * @reg: The given registration type to compare with
  *
  * Call iwpm_register_pid() to register a client
  * Returns true if the client registration matches reg,
  * otherwise returns false
  */
 u32 iwpm_check_registration(u8 nl_client, u32 reg);
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index 8c930bf1df89..89a831fa1885 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -1406,65 +1406,66 @@ void ib_sa_pack_path(struct sa_path_rec *rec, void *attribute)
 	ib_pack(path_rec_table, ARRAY_SIZE(path_rec_table), rec, attribute);
 }
 EXPORT_SYMBOL(ib_sa_pack_path);
 
 static bool ib_sa_opa_pathrecord_support(struct ib_sa_client *client,
 					 struct ib_sa_device *sa_dev,
 					 u8 port_num)
 {
 	struct ib_sa_port *port;
 	unsigned long flags;
 	bool ret = false;
 
 	port = &sa_dev->port[port_num - sa_dev->start_port];
 	spin_lock_irqsave(&port->classport_lock, flags);
 	if (!port->classport_info.valid)
 		goto ret;
 
 	if (port->classport_info.data.type == RDMA_CLASS_PORT_INFO_OPA)
 		ret = opa_get_cpi_capmask2(&port->classport_info.data.opa) &
 			OPA_CLASS_PORT_INFO_PR_SUPPORT;
 ret:
 	spin_unlock_irqrestore(&port->classport_lock, flags);
 	return ret;
 }
 
 enum opa_pr_supported {
 	PR_NOT_SUPPORTED,
 	PR_OPA_SUPPORTED,
 	PR_IB_SUPPORTED
 };
 
 /**
- * Check if current PR query can be an OPA query.
+ * opa_pr_query_possible - Check if current PR query can be an OPA query.
+ *
  * Retuns PR_NOT_SUPPORTED if a path record query is not
  * possible, PR_OPA_SUPPORTED if an OPA path record query
  * is possible and PR_IB_SUPPORTED if an IB path record
  * query is possible.
  */
 static int opa_pr_query_possible(struct ib_sa_client *client,
 				 struct ib_sa_device *sa_dev,
 				 struct ib_device *device, u8 port_num,
 				 struct sa_path_rec *rec)
 {
 	struct ib_port_attr port_attr;
 
 	if (ib_query_port(device, port_num, &port_attr))
 		return PR_NOT_SUPPORTED;
 
 	if (ib_sa_opa_pathrecord_support(client, sa_dev, port_num))
 		return PR_OPA_SUPPORTED;
 
 	if (port_attr.lid >= be16_to_cpu(IB_MULTICAST_LID_BASE))
 		return PR_NOT_SUPPORTED;
 	else
 		return PR_IB_SUPPORTED;
 }
 
 static void ib_sa_path_rec_callback(struct ib_sa_query *sa_query,
 				    int status,
 				    struct ib_sa_mad *mad)
 {
 	struct ib_sa_path_query *query =
 		container_of(sa_query, struct ib_sa_path_query, sa_query);
 
 	if (mad) {
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 33778f8674a1..2ae0e448a524 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -215,65 +215,65 @@ rdma_node_get_transport(unsigned int node_type)
 {
 
 	if (node_type == RDMA_NODE_USNIC)
 		return RDMA_TRANSPORT_USNIC;
 	if (node_type == RDMA_NODE_USNIC_UDP)
 		return RDMA_TRANSPORT_USNIC_UDP;
 	if (node_type == RDMA_NODE_RNIC)
 		return RDMA_TRANSPORT_IWARP;
 	if (node_type == RDMA_NODE_UNSPECIFIED)
 		return RDMA_TRANSPORT_UNSPECIFIED;
 
 	return RDMA_TRANSPORT_IB;
 }
 EXPORT_SYMBOL(rdma_node_get_transport);
 
 enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_num)
 {
 	enum rdma_transport_type lt;
 	if (device->ops.get_link_layer)
 		return device->ops.get_link_layer(device, port_num);
 
 	lt = rdma_node_get_transport(device->node_type);
 	if (lt == RDMA_TRANSPORT_IB)
 		return IB_LINK_LAYER_INFINIBAND;
 
 	return IB_LINK_LAYER_ETHERNET;
 }
 EXPORT_SYMBOL(rdma_port_get_link_layer);
 
 /* Protection domains */
 
 /**
- * ib_alloc_pd - Allocates an unused protection domain.
+ * __ib_alloc_pd - Allocates an unused protection domain.
  * @device: The device on which to allocate the protection domain.
  * @flags: protection domain flags
  * @caller: caller's build-time module name
  *
  * A protection domain object provides an association between QPs, shared
  * receive queues, address handles, memory regions, and memory windows.
  *
  * Every PD has a local_dma_lkey which can be used as the lkey value for local
  * memory operations.
  */
 struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags,
 		const char *caller)
 {
 	struct ib_pd *pd;
 	int mr_access_flags = 0;
 	int ret;
 
 	pd = rdma_zalloc_drv_obj(device, ib_pd);
 	if (!pd)
 		return ERR_PTR(-ENOMEM);
 
 	pd->device = device;
 	pd->uobject = NULL;
 	pd->__internal_mr = NULL;
 	atomic_set(&pd->usecnt, 0);
 	pd->flags = flags;
 
 	rdma_restrack_new(&pd->res, RDMA_RESTRACK_PD);
 	rdma_restrack_set_name(&pd->res, caller);
 
 	ret = device->ops.alloc_pd(pd, NULL);
 	if (ret) {
@@ -1636,65 +1636,65 @@ EXPORT_SYMBOL(ib_modify_qp_is_ok);
  * returns 0 on success or appropriate error code. It initializes the
  * necessary ah_attr fields when call is successful.
  */
 static int ib_resolve_eth_dmac(struct ib_device *device,
 			       struct rdma_ah_attr *ah_attr)
 {
 	int ret = 0;
 
 	if (rdma_is_multicast_addr((struct in6_addr *)ah_attr->grh.dgid.raw)) {
 		if (ipv6_addr_v4mapped((struct in6_addr *)ah_attr->grh.dgid.raw)) {
 			__be32 addr = 0;
 
 			memcpy(&addr, ah_attr->grh.dgid.raw + 12, 4);
 			ip_eth_mc_map(addr, (char *)ah_attr->roce.dmac);
 		} else {
 			ipv6_eth_mc_map((struct in6_addr *)ah_attr->grh.dgid.raw,
 					(char *)ah_attr->roce.dmac);
 		}
 	} else {
 		ret = ib_resolve_unicast_gid_dmac(device, ah_attr);
 	}
 	return ret;
 }
 
 static bool is_qp_type_connected(const struct ib_qp *qp)
 {
 	return (qp->qp_type == IB_QPT_UC ||
 		qp->qp_type == IB_QPT_RC ||
 		qp->qp_type == IB_QPT_XRC_INI ||
 		qp->qp_type == IB_QPT_XRC_TGT);
 }
 
-/**
+/*
  * IB core internal function to perform QP attributes modification.
  */
 static int _ib_modify_qp(struct ib_qp *qp, struct ib_qp_attr *attr,
 			 int attr_mask, struct ib_udata *udata)
 {
 	u8 port = attr_mask & IB_QP_PORT ? attr->port_num : qp->port;
 	const struct ib_gid_attr *old_sgid_attr_av;
 	const struct ib_gid_attr *old_sgid_attr_alt_av;
 	int ret;
 
 	attr->xmit_slave = NULL;
 	if (attr_mask & IB_QP_AV) {
 		ret = rdma_fill_sgid_attr(qp->device, &attr->ah_attr,
 					  &old_sgid_attr_av);
 		if (ret)
 			return ret;
 
 		if (attr->ah_attr.type == RDMA_AH_ATTR_TYPE_ROCE &&
 		    is_qp_type_connected(qp)) {
 			struct net_device *slave;
 
 			/*
 			 * If the user provided the qp_attr then we have to
 			 * resolve it. Kerne users have to provide already
 			 * resolved rdma_ah_attr's.
 			 */
 			if (udata) {
 				ret = ib_resolve_eth_dmac(qp->device,
 							  &attr->ah_attr);
 				if (ret)
 					goto out_av;
 			}
diff --git a/drivers/infiniband/sw/rdmavt/ah.c b/drivers/infiniband/sw/rdmavt/ah.c
index f9754dcd250b..a3e5b368c5e7 100644
--- a/drivers/infiniband/sw/rdmavt/ah.c
+++ b/drivers/infiniband/sw/rdmavt/ah.c
@@ -97,65 +97,65 @@ EXPORT_SYMBOL(rvt_check_ah);
  *
  * Return: 0 on success
  */
 int rvt_create_ah(struct ib_ah *ibah, struct rdma_ah_init_attr *init_attr,
 		  struct ib_udata *udata)
 {
 	struct rvt_ah *ah = ibah_to_rvtah(ibah);
 	struct rvt_dev_info *dev = ib_to_rvt(ibah->device);
 	unsigned long flags;
 
 	if (rvt_check_ah(ibah->device, init_attr->ah_attr))
 		return -EINVAL;
 
 	spin_lock_irqsave(&dev->n_ahs_lock, flags);
 	if (dev->n_ahs_allocated == dev->dparms.props.max_ah) {
 		spin_unlock_irqrestore(&dev->n_ahs_lock, flags);
 		return -ENOMEM;
 	}
 
 	dev->n_ahs_allocated++;
 	spin_unlock_irqrestore(&dev->n_ahs_lock, flags);
 
 	rdma_copy_ah_attr(&ah->attr, init_attr->ah_attr);
 
 	if (dev->driver_f.notify_new_ah)
 		dev->driver_f.notify_new_ah(ibah->device,
 					    init_attr->ah_attr, ah);
 
 	return 0;
 }
 
 /**
- * rvt_destory_ah - Destory an address handle
+ * rvt_destroy_ah - Destroy an address handle
  * @ibah: address handle
  * @destroy_flags: destroy address handle flags (see enum rdma_destroy_ah_flags)
  * Return: 0 on success
  */
 int rvt_destroy_ah(struct ib_ah *ibah, u32 destroy_flags)
 {
 	struct rvt_dev_info *dev = ib_to_rvt(ibah->device);
 	struct rvt_ah *ah = ibah_to_rvtah(ibah);
 	unsigned long flags;
 
 	spin_lock_irqsave(&dev->n_ahs_lock, flags);
 	dev->n_ahs_allocated--;
 	spin_unlock_irqrestore(&dev->n_ahs_lock, flags);
 
 	rdma_destroy_ah_attr(&ah->attr);
 	return 0;
 }
 
 /**
  * rvt_modify_ah - modify an ah with given attrs
  * @ibah: address handle to modify
  * @ah_attr: attrs to apply
  *
  * Return: 0 on success
  */
 int rvt_modify_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr)
 {
 	struct rvt_ah *ah = ibah_to_rvtah(ibah);
 
 	if (rvt_check_ah(ibah->device, ah_attr))
 		return -EINVAL;
 
diff --git a/drivers/infiniband/sw/rdmavt/mcast.c b/drivers/infiniband/sw/rdmavt/mcast.c
index dd11c6fcd060..5233a63d99a6 100644
--- a/drivers/infiniband/sw/rdmavt/mcast.c
+++ b/drivers/infiniband/sw/rdmavt/mcast.c
@@ -25,109 +25,109 @@
  *    notice, this list of conditions and the following disclaimer.
  *  - Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *  - Neither the name of Intel Corporation nor the names of its
  *    contributors may be used to endorse or promote products derived
  *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  */
 
 #include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/rculist.h>
 #include <rdma/rdma_vt.h>
 #include <rdma/rdmavt_qp.h>
 
 #include "mcast.h"
 
 /**
- * rvt_driver_mcast - init resources for multicast
+ * rvt_driver_mcast_init - init resources for multicast
  * @rdi: rvt dev struct
  *
  * This is per device that registers with rdmavt
  */
 void rvt_driver_mcast_init(struct rvt_dev_info *rdi)
 {
 	/*
 	 * Anything that needs setup for multicast on a per driver or per rdi
 	 * basis should be done in here.
 	 */
 	spin_lock_init(&rdi->n_mcast_grps_lock);
 }
 
 /**
- * mcast_qp_alloc - alloc a struct to link a QP to mcast GID struct
+ * rvt_mcast_qp_alloc - alloc a struct to link a QP to mcast GID struct
  * @qp: the QP to link
  */
 static struct rvt_mcast_qp *rvt_mcast_qp_alloc(struct rvt_qp *qp)
 {
 	struct rvt_mcast_qp *mqp;
 
 	mqp = kmalloc(sizeof(*mqp), GFP_KERNEL);
 	if (!mqp)
 		goto bail;
 
 	mqp->qp = qp;
 	rvt_get_qp(qp);
 
 bail:
 	return mqp;
 }
 
 static void rvt_mcast_qp_free(struct rvt_mcast_qp *mqp)
 {
 	struct rvt_qp *qp = mqp->qp;
 
 	/* Notify hfi1_destroy_qp() if it is waiting. */
 	rvt_put_qp(qp);
 
 	kfree(mqp);
 }
 
 /**
- * mcast_alloc - allocate the multicast GID structure
+ * rvt_mcast_alloc - allocate the multicast GID structure
  * @mgid: the multicast GID
  * @lid: the muilticast LID (host order)
  *
  * A list of QPs will be attached to this structure.
  */
 static struct rvt_mcast *rvt_mcast_alloc(union ib_gid *mgid, u16 lid)
 {
 	struct rvt_mcast *mcast;
 
 	mcast = kzalloc(sizeof(*mcast), GFP_KERNEL);
 	if (!mcast)
 		goto bail;
 
 	mcast->mcast_addr.mgid = *mgid;
 	mcast->mcast_addr.lid = lid;
 
 	INIT_LIST_HEAD(&mcast->qp_list);
 	init_waitqueue_head(&mcast->wait);
 	atomic_set(&mcast->refcount, 0);
 
 bail:
 	return mcast;
 }
 
 static void rvt_mcast_free(struct rvt_mcast *mcast)
 {
 	struct rvt_mcast_qp *p, *tmp;
 
 	list_for_each_entry_safe(p, tmp, &mcast->qp_list, list)
 		rvt_mcast_qp_free(p);
 
 	kfree(mcast);
@@ -152,65 +152,65 @@ struct rvt_mcast *rvt_mcast_find(struct rvt_ibport *ibp, union ib_gid *mgid,
 	unsigned long flags;
 	struct rvt_mcast *found = NULL;
 
 	spin_lock_irqsave(&ibp->lock, flags);
 	n = ibp->mcast_tree.rb_node;
 	while (n) {
 		int ret;
 		struct rvt_mcast *mcast;
 
 		mcast = rb_entry(n, struct rvt_mcast, rb_node);
 
 		ret = memcmp(mgid->raw, mcast->mcast_addr.mgid.raw,
 			     sizeof(*mgid));
 		if (ret < 0) {
 			n = n->rb_left;
 		} else if (ret > 0) {
 			n = n->rb_right;
 		} else {
 			/* MGID/MLID must match */
 			if (mcast->mcast_addr.lid == lid) {
 				atomic_inc(&mcast->refcount);
 				found = mcast;
 			}
 			break;
 		}
 	}
 	spin_unlock_irqrestore(&ibp->lock, flags);
 	return found;
 }
 EXPORT_SYMBOL(rvt_mcast_find);
 
 /**
- * mcast_add - insert mcast GID into table and attach QP struct
+ * rvt_mcast_add - insert mcast GID into table and attach QP struct
  * @mcast: the mcast GID table
  * @mqp: the QP to attach
  *
  * Return: zero if both were added.  Return EEXIST if the GID was already in
  * the table but the QP was added.  Return ESRCH if the QP was already
  * attached and neither structure was added. Return EINVAL if the MGID was
  * found, but the MLID did NOT match.
  */
 static int rvt_mcast_add(struct rvt_dev_info *rdi, struct rvt_ibport *ibp,
 			 struct rvt_mcast *mcast, struct rvt_mcast_qp *mqp)
 {
 	struct rb_node **n = &ibp->mcast_tree.rb_node;
 	struct rb_node *pn = NULL;
 	int ret;
 
 	spin_lock_irq(&ibp->lock);
 
 	while (*n) {
 		struct rvt_mcast *tmcast;
 		struct rvt_mcast_qp *p;
 
 		pn = *n;
 		tmcast = rb_entry(pn, struct rvt_mcast, rb_node);
 
 		ret = memcmp(mcast->mcast_addr.mgid.raw,
 			     tmcast->mcast_addr.mgid.raw,
 			     sizeof(mcast->mcast_addr.mgid));
 		if (ret < 0) {
 			n = &pn->rb_left;
 			continue;
 		}
 		if (ret > 0) {
@@ -397,47 +397,47 @@ int rvt_detach_mcast(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
 		if (list_empty(&mcast->qp_list)) {
 			rb_erase(&mcast->rb_node, &ibp->mcast_tree);
 			last = 1;
 		}
 		break;
 	}
 
 	spin_unlock_irq(&ibp->lock);
 	/* QP not attached */
 	if (!delp)
 		return -EINVAL;
 
 	/*
 	 * Wait for any list walkers to finish before freeing the
 	 * list element.
 	 */
 	wait_event(mcast->wait, atomic_read(&mcast->refcount) <= 1);
 	rvt_mcast_qp_free(delp);
 
 	if (last) {
 		atomic_dec(&mcast->refcount);
 		wait_event(mcast->wait, !atomic_read(&mcast->refcount));
 		rvt_mcast_free(mcast);
 		spin_lock_irq(&rdi->n_mcast_grps_lock);
 		rdi->n_mcast_grps_allocated--;
 		spin_unlock_irq(&rdi->n_mcast_grps_lock);
 	}
 
 	return 0;
 }
 
 /**
- *rvt_mast_tree_empty - determine if any qps are attached to any mcast group
- *@rdi: rvt dev struct
+ * rvt_mcast_tree_empty - determine if any qps are attached to any mcast group
+ * @rdi: rvt dev struct
  *
  * Return: in use count
  */
 int rvt_mcast_tree_empty(struct rvt_dev_info *rdi)
 {
 	int i;
 	int in_use = 0;
 
 	for (i = 0; i < rdi->dparms.nports; i++)
 		if (rdi->ports[i]->mcast_tree.rb_node)
 			in_use++;
 	return in_use;
 }
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index e9db6bf10618..22fa9bde5419 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -1798,65 +1798,65 @@ int rvt_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 	attr->alt_ah_attr = qp->alt_ah_attr;
 	attr->pkey_index = qp->s_pkey_index;
 	attr->alt_pkey_index = qp->s_alt_pkey_index;
 	attr->en_sqd_async_notify = 0;
 	attr->sq_draining = qp->s_draining;
 	attr->max_rd_atomic = qp->s_max_rd_atomic;
 	attr->max_dest_rd_atomic = qp->r_max_rd_atomic;
 	attr->min_rnr_timer = qp->r_min_rnr_timer;
 	attr->port_num = qp->port_num;
 	attr->timeout = qp->timeout;
 	attr->retry_cnt = qp->s_retry_cnt;
 	attr->rnr_retry = qp->s_rnr_retry_cnt;
 	attr->alt_port_num =
 		rdma_ah_get_port_num(&qp->alt_ah_attr);
 	attr->alt_timeout = qp->alt_timeout;
 
 	init_attr->event_handler = qp->ibqp.event_handler;
 	init_attr->qp_context = qp->ibqp.qp_context;
 	init_attr->send_cq = qp->ibqp.send_cq;
 	init_attr->recv_cq = qp->ibqp.recv_cq;
 	init_attr->srq = qp->ibqp.srq;
 	init_attr->cap = attr->cap;
 	if (qp->s_flags & RVT_S_SIGNAL_REQ_WR)
 		init_attr->sq_sig_type = IB_SIGNAL_REQ_WR;
 	else
 		init_attr->sq_sig_type = IB_SIGNAL_ALL_WR;
 	init_attr->qp_type = qp->ibqp.qp_type;
 	init_attr->port_num = qp->port_num;
 	return 0;
 }
 
 /**
- * rvt_post_receive - post a receive on a QP
+ * rvt_post_recv - post a receive on a QP
  * @ibqp: the QP to post the receive on
  * @wr: the WR to post
  * @bad_wr: the first bad WR is put here
  *
  * This may be called from interrupt context.
  *
  * Return: 0 on success otherwise errno
  */
 int rvt_post_recv(struct ib_qp *ibqp, const struct ib_recv_wr *wr,
 		  const struct ib_recv_wr **bad_wr)
 {
 	struct rvt_qp *qp = ibqp_to_rvtqp(ibqp);
 	struct rvt_krwq *wq = qp->r_rq.kwq;
 	unsigned long flags;
 	int qp_err_flush = (ib_rvt_state_ops[qp->state] & RVT_FLUSH_RECV) &&
 				!qp->ibqp.srq;
 
 	/* Check that state is OK to post receive. */
 	if (!(ib_rvt_state_ops[qp->state] & RVT_POST_RECV_OK) || !wq) {
 		*bad_wr = wr;
 		return -EINVAL;
 	}
 
 	for (; wr; wr = wr->next) {
 		struct rvt_rwqe *wqe;
 		u32 next;
 		int i;
 
 		if ((unsigned)wr->num_sge > qp->r_rq.max_sge) {
 			*bad_wr = wr;
 			return -EINVAL;
 		}
@@ -2220,65 +2220,65 @@ int rvt_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,
 
 	/*
 	 * If the send queue is empty, and we only have a single WR then just go
 	 * ahead and kick the send engine into gear. Otherwise we will always
 	 * just schedule the send to happen later.
 	 */
 	call_send = qp->s_head == READ_ONCE(qp->s_last) && !wr->next;
 
 	for (; wr; wr = wr->next) {
 		err = rvt_post_one_wr(qp, wr, &call_send);
 		if (unlikely(err)) {
 			*bad_wr = wr;
 			goto bail;
 		}
 		nreq++;
 	}
 bail:
 	spin_unlock_irqrestore(&qp->s_hlock, flags);
 	if (nreq) {
 		/*
 		 * Only call do_send if there is exactly one packet, and the
 		 * driver said it was ok.
 		 */
 		if (nreq == 1 && call_send)
 			rdi->driver_f.do_send(qp);
 		else
 			rdi->driver_f.schedule_send_no_lock(qp);
 	}
 	return err;
 }
 
 /**
- * rvt_post_srq_receive - post a receive on a shared receive queue
+ * rvt_post_srq_recv - post a receive on a shared receive queue
  * @ibsrq: the SRQ to post the receive on
  * @wr: the list of work requests to post
  * @bad_wr: A pointer to the first WR to cause a problem is put here
  *
  * This may be called from interrupt context.
  *
  * Return: 0 on success else errno
  */
 int rvt_post_srq_recv(struct ib_srq *ibsrq, const struct ib_recv_wr *wr,
 		      const struct ib_recv_wr **bad_wr)
 {
 	struct rvt_srq *srq = ibsrq_to_rvtsrq(ibsrq);
 	struct rvt_krwq *wq;
 	unsigned long flags;
 
 	for (; wr; wr = wr->next) {
 		struct rvt_rwqe *wqe;
 		u32 next;
 		int i;
 
 		if ((unsigned)wr->num_sge > srq->rq.max_sge) {
 			*bad_wr = wr;
 			return -EINVAL;
 		}
 
 		spin_lock_irqsave(&srq->rq.kwq->p_lock, flags);
 		wq = srq->rq.kwq;
 		next = wq->head + 1;
 		if (next >= srq->rq.size)
 			next = 0;
 		if (next == READ_ONCE(wq->tail)) {
 			spin_unlock_irqrestore(&srq->rq.kwq->p_lock, flags);
@@ -2472,65 +2472,65 @@ int rvt_get_rwqe(struct rvt_qp *qp, bool wr_id_only)
 	ret = 1;
 	set_bit(RVT_R_WRID_VALID, &qp->r_aflags);
 	if (handler) {
 		/*
 		 * Validate head pointer value and compute
 		 * the number of remaining WQEs.
 		 */
 		if (kwq->count < srq->limit) {
 			kwq->count =
 				rvt_get_rq_count(rq,
 						 get_rvt_head(rq, ip), tail);
 			if (kwq->count < srq->limit) {
 				struct ib_event ev;
 
 				srq->limit = 0;
 				spin_unlock_irqrestore(&rq->kwq->c_lock, flags);
 				ev.device = qp->ibqp.device;
 				ev.element.srq = qp->ibqp.srq;
 				ev.event = IB_EVENT_SRQ_LIMIT_REACHED;
 				handler(&ev, srq->ibsrq.srq_context);
 				goto bail;
 			}
 		}
 	}
 unlock:
 	spin_unlock_irqrestore(&rq->kwq->c_lock, flags);
 bail:
 	return ret;
 }
 EXPORT_SYMBOL(rvt_get_rwqe);
 
 /**
- * qp_comm_est - handle trap with QP established
+ * rvt_comm_est - handle trap with QP established
  * @qp: the QP
  */
 void rvt_comm_est(struct rvt_qp *qp)
 {
 	qp->r_flags |= RVT_R_COMM_EST;
 	if (qp->ibqp.event_handler) {
 		struct ib_event ev;
 
 		ev.device = qp->ibqp.device;
 		ev.element.qp = &qp->ibqp;
 		ev.event = IB_EVENT_COMM_EST;
 		qp->ibqp.event_handler(&ev, qp->ibqp.qp_context);
 	}
 }
 EXPORT_SYMBOL(rvt_comm_est);
 
 void rvt_rc_error(struct rvt_qp *qp, enum ib_wc_status err)
 {
 	unsigned long flags;
 	int lastwqe;
 
 	spin_lock_irqsave(&qp->s_lock, flags);
 	lastwqe = rvt_error_qp(qp, err);
 	spin_unlock_irqrestore(&qp->s_lock, flags);
 
 	if (lastwqe) {
 		struct ib_event ev;
 
 		ev.device = qp->ibqp.device;
 		ev.element.qp = &qp->ibqp;
 		ev.event = IB_EVENT_QP_LAST_WQE_REACHED;
 		qp->ibqp.event_handler(&ev, qp->ibqp.qp_context);
@@ -2918,65 +2918,65 @@ void rvt_copy_sge(struct rvt_qp *qp, struct rvt_sge_state *ss,
 		} else if (cacheless_copy) {
 			cacheless_memcpy(sge->vaddr, data, len);
 		} else {
 			memcpy(sge->vaddr, data, len);
 		}
 		rvt_update_sge(ss, len, release);
 		data += len;
 		length -= len;
 	}
 
 	if (copy_last) {
 		copy_last = false;
 		in_last = true;
 		length = 8;
 		goto again;
 	}
 }
 EXPORT_SYMBOL(rvt_copy_sge);
 
 static enum ib_wc_status loopback_qp_drop(struct rvt_ibport *rvp,
 					  struct rvt_qp *sqp)
 {
 	rvp->n_pkt_drops++;
 	/*
 	 * For RC, the requester would timeout and retry so
 	 * shortcut the timeouts and just signal too many retries.
 	 */
 	return sqp->ibqp.qp_type == IB_QPT_RC ?
 		IB_WC_RETRY_EXC_ERR : IB_WC_SUCCESS;
 }
 
 /**
- * ruc_loopback - handle UC and RC loopback requests
+ * rvt_ruc_loopback - handle UC and RC loopback requests
  * @sqp: the sending QP
  *
  * This is called from rvt_do_send() to forward a WQE addressed to the same HFI
  * Note that although we are single threaded due to the send engine, we still
  * have to protect against post_send().  We don't have to worry about
  * receive interrupts since this is a connected protocol and all packets
  * will pass through here.
  */
 void rvt_ruc_loopback(struct rvt_qp *sqp)
 {
 	struct rvt_ibport *rvp =  NULL;
 	struct rvt_dev_info *rdi = ib_to_rvt(sqp->ibqp.device);
 	struct rvt_qp *qp;
 	struct rvt_swqe *wqe;
 	struct rvt_sge *sge;
 	unsigned long flags;
 	struct ib_wc wc;
 	u64 sdata;
 	atomic64_t *maddr;
 	enum ib_wc_status send_status;
 	bool release;
 	int ret;
 	bool copy_last = false;
 	int local_ops = 0;
 
 	rcu_read_lock();
 	rvp = rdi->ports[sqp->port_num - 1];
 
 	/*
 	 * Note that we check the responder QP state after
 	 * checking the requester's state.
 	 */
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 3690e28cc7ea..1a459b35000c 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -710,65 +710,65 @@ iscsi_iser_set_param(struct iscsi_cls_conn *cls_conn,
 			return -EPROTO;
 		}
 		break;
 	case ISCSI_PARAM_DATADGST_EN:
 		sscanf(buf, "%d", &value);
 		if (value) {
 			iser_err("DataDigest wasn't negotiated to None\n");
 			return -EPROTO;
 		}
 		break;
 	case ISCSI_PARAM_IFMARKER_EN:
 		sscanf(buf, "%d", &value);
 		if (value) {
 			iser_err("IFMarker wasn't negotiated to No\n");
 			return -EPROTO;
 		}
 		break;
 	case ISCSI_PARAM_OFMARKER_EN:
 		sscanf(buf, "%d", &value);
 		if (value) {
 			iser_err("OFMarker wasn't negotiated to No\n");
 			return -EPROTO;
 		}
 		break;
 	default:
 		return iscsi_set_param(cls_conn, param, buf, buflen);
 	}
 
 	return 0;
 }
 
 /**
- * iscsi_iser_set_param() - set class connection parameter
+ * iscsi_iser_conn_get_stats() - get iscsi connection statistics
  * @cls_conn:    iscsi class connection
  * @stats:       iscsi stats to output
  *
  * Output connection statistics.
  */
 static void
 iscsi_iser_conn_get_stats(struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats)
 {
 	struct iscsi_conn *conn = cls_conn->dd_data;
 
 	stats->txdata_octets = conn->txdata_octets;
 	stats->rxdata_octets = conn->rxdata_octets;
 	stats->scsicmd_pdus = conn->scsicmd_pdus_cnt;
 	stats->dataout_pdus = conn->dataout_pdus_cnt;
 	stats->scsirsp_pdus = conn->scsirsp_pdus_cnt;
 	stats->datain_pdus = conn->datain_pdus_cnt; /* always 0 */
 	stats->r2t_pdus = conn->r2t_pdus_cnt; /* always 0 */
 	stats->tmfcmd_pdus = conn->tmfcmd_pdus_cnt;
 	stats->tmfrsp_pdus = conn->tmfrsp_pdus_cnt;
 	stats->custom_length = 0;
 }
 
 static int iscsi_iser_get_ep_param(struct iscsi_endpoint *ep,
 				   enum iscsi_param param, char *buf)
 {
 	struct iser_conn *iser_conn = ep->dd_data;
 
 	switch (param) {
 	case ISCSI_PARAM_CONN_PORT:
 	case ISCSI_PARAM_CONN_ADDRESS:
 		if (!iser_conn || !iser_conn->ib_conn.cma_id)
 			return -ENOTCONN;
diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h b/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h
index f64519872297..012fc27c5c93 100644
--- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h
+++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h
@@ -408,65 +408,65 @@ struct opa_veswport_error_counters {
 	__be64  rx_drop_state;
 	__be64  rx_logic;
 	__be64  rsvd8;
 
 	__be64  rsvd9[16];
 } __packed;
 
 /**
  * struct opa_veswport_trap - Trap message sent to EM by VNIC
  * @fabric_id: 10 bit fabric id
  * @veswid: 12 bit virtual ethernet switch id
  * @veswportnum: logical port number on the Virtual switch
  * @opaportnum: physical port num (redundant on host)
  * @veswportindex: switch port index on opa port 0 based
  * @opcode: operation
  * @reserved: 32 bit for alignment
  *
  * The VNIC will send trap messages to the Ethernet manager to
  * inform it about changes to the VNIC config, behaviour etc.
  * This is the format of the trap payload.
  */
 struct opa_veswport_trap {
 	__be16  fabric_id;
 	__be16  veswid;
 	__be32  veswportnum;
 	__be16  opaportnum;
 	u8      veswportindex;
 	u8      opcode;
 	__be32  reserved;
 } __packed;
 
 /**
- * struct opa_vnic_iface_macs_entry - single entry in the mac list
+ * struct opa_vnic_iface_mac_entry - single entry in the mac list
  * @mac_addr: MAC address
  */
 struct opa_vnic_iface_mac_entry {
 	u8 mac_addr[ETH_ALEN];
 };
 
 /**
  * struct opa_veswport_iface_macs - Msg to set globally administered MAC
  * @start_idx: position of first entry (0 based)
  * @num_macs_in_msg: number of MACs in this message
  * @tot_macs_in_lst: The total number of MACs the agent has
  * @gen_count: gen_count to indicate change
  * @entry: The mac list entry
  *
  * Same attribute IDS and attribute modifiers as in locally administered
  * addresses used to set globally administered addresses
  */
 struct opa_veswport_iface_macs {
 	__be16 start_idx;
 	__be16 num_macs_in_msg;
 	__be16 tot_macs_in_lst;
 	__be16 gen_count;
 	struct opa_vnic_iface_mac_entry entry[];
 } __packed;
 
 /**
  * struct opa_vnic_vema_mad - Generic VEMA MAD
  * @mad_hdr: Generic MAD header
  * @rmpp_hdr: RMPP header for vendor specific MADs
  * @reserved: reserved bytes
  * @oui: Unique org identifier
  * @data: MAD data
diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema_iface.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema_iface.c
index 868b5aec1537..292c037aa239 100644
--- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema_iface.c
+++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema_iface.c
@@ -45,65 +45,65 @@
  *
  */
 
 /*
  * This file contains OPA VNIC EMA Interface functions.
  */
 
 #include "opa_vnic_internal.h"
 
 /**
  * opa_vnic_vema_report_event - sent trap to report the specified event
  * @adapter: vnic port adapter
  * @event: event to be reported
  *
  * This function calls vema api to sent a trap for the given event.
  */
 void opa_vnic_vema_report_event(struct opa_vnic_adapter *adapter, u8 event)
 {
 	struct __opa_veswport_info *info = &adapter->info;
 	struct __opa_veswport_trap trap_data;
 
 	trap_data.fabric_id = info->vesw.fabric_id;
 	trap_data.veswid = info->vesw.vesw_id;
 	trap_data.veswportnum = info->vport.port_num;
 	trap_data.opaportnum = adapter->port_num;
 	trap_data.veswportindex = adapter->vport_num;
 	trap_data.opcode = event;
 
 	opa_vnic_vema_send_trap(adapter, &trap_data, info->vport.encap_slid);
 }
 
 /**
- * opa_vnic_get_error_counters - get summary counters
+ * opa_vnic_get_summary_counters - get summary counters
  * @adapter: vnic port adapter
  * @cntrs: pointer to destination summary counters structure
  *
  * This function populates the summary counters that is maintained by the
  * given adapter to destination address provided.
  */
 void opa_vnic_get_summary_counters(struct opa_vnic_adapter *adapter,
 				   struct opa_veswport_summary_counters *cntrs)
 {
 	struct opa_vnic_stats vstats;
 	__be64 *dst;
 	u64 *src;
 
 	memset(&vstats, 0, sizeof(vstats));
 	spin_lock(&adapter->stats_lock);
 	adapter->rn_ops->ndo_get_stats64(adapter->netdev, &vstats.netstats);
 	spin_unlock(&adapter->stats_lock);
 
 	cntrs->vp_instance = cpu_to_be16(adapter->vport_num);
 	cntrs->vesw_id = cpu_to_be16(adapter->info.vesw.vesw_id);
 	cntrs->veswport_num = cpu_to_be32(adapter->port_num);
 
 	cntrs->tx_errors = cpu_to_be64(vstats.netstats.tx_errors);
 	cntrs->rx_errors = cpu_to_be64(vstats.netstats.rx_errors);
 	cntrs->tx_packets = cpu_to_be64(vstats.netstats.tx_packets);
 	cntrs->rx_packets = cpu_to_be64(vstats.netstats.rx_packets);
 	cntrs->tx_bytes = cpu_to_be64(vstats.netstats.tx_bytes);
 	cntrs->rx_bytes = cpu_to_be64(vstats.netstats.rx_bytes);
 
 	/*
 	 * This loop depends on layout of
 	 * opa_veswport_summary_counters opa_vnic_stats structures.
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h
index bdeb010efee6..76e66f630c17 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.h
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.h
@@ -318,65 +318,65 @@ struct srpt_rdma_ch {
 	enum rdma_ch_state	state;
 	struct kmem_cache	*rsp_buf_cache;
 	struct srpt_send_ioctx	**ioctx_ring;
 	struct kmem_cache	*req_buf_cache;
 	struct srpt_recv_ioctx	**ioctx_recv_ring;
 	struct list_head	list;
 	struct list_head	cmd_wait_list;
 	uint16_t		pkey;
 	bool			using_rdma_cm;
 	bool			processing_wait_list;
 	struct se_session	*sess;
 	u8			sess_name[40];
 	struct work_struct	release_work;
 };
 
 /**
  * struct srpt_nexus - I_T nexus
  * @rcu:       RCU head for this data structure.
  * @entry:     srpt_port.nexus_list list node.
  * @ch_list:   struct srpt_rdma_ch list. Protected by srpt_port.mutex.
  * @i_port_id: 128-bit initiator port identifier copied from SRP_LOGIN_REQ.
  * @t_port_id: 128-bit target port identifier copied from SRP_LOGIN_REQ.
  */
 struct srpt_nexus {
 	struct rcu_head		rcu;
 	struct list_head	entry;
 	struct list_head	ch_list;
 	u8			i_port_id[16];
 	u8			t_port_id[16];
 };
 
 /**
- * struct srpt_port_attib - attributes for SRPT port
+ * struct srpt_port_attrib - attributes for SRPT port
  * @srp_max_rdma_size: Maximum size of SRP RDMA transfers for new connections.
  * @srp_max_rsp_size: Maximum size of SRP response messages in bytes.
  * @srp_sq_size: Shared receive queue (SRQ) size.
  * @use_srq: Whether or not to use SRQ.
  */
 struct srpt_port_attrib {
 	u32			srp_max_rdma_size;
 	u32			srp_max_rsp_size;
 	u32			srp_sq_size;
 	bool			use_srq;
 };
 
 /**
  * struct srpt_tpg - information about a single "target portal group"
  * @entry:	Entry in @sport_id->tpg_list.
  * @sport_id:	Port name this TPG is associated with.
  * @tpg:	LIO TPG data structure.
  *
  * Zero or more target portal groups are associated with each port name
  * (srpt_port_id). With each TPG an ACL list is associated.
  */
 struct srpt_tpg {
 	struct list_head	entry;
 	struct srpt_port_id	*sport_id;
 	struct se_portal_group	tpg;
 };
 
 /**
  * struct srpt_port_id - information about an RDMA port name
  * @mutex:	Protects @tpg_list changes.
  * @tpg_list:	TPGs associated with the RDMA port name.
  * @wwn:	WWN associated with the RDMA port name.
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 5c4a3c0dec5d..c20befb734ca 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -3365,64 +3365,75 @@ int ib_query_pkey(struct ib_device *device,
 		  u8 port_num, u16 index, u16 *pkey);
 
 int ib_modify_device(struct ib_device *device,
 		     int device_modify_mask,
 		     struct ib_device_modify *device_modify);
 
 int ib_modify_port(struct ib_device *device,
 		   u8 port_num, int port_modify_mask,
 		   struct ib_port_modify *port_modify);
 
 int ib_find_gid(struct ib_device *device, union ib_gid *gid,
 		u8 *port_num, u16 *index);
 
 int ib_find_pkey(struct ib_device *device,
 		 u8 port_num, u16 pkey, u16 *index);
 
 enum ib_pd_flags {
 	/*
 	 * Create a memory registration for all memory in the system and place
 	 * the rkey for it into pd->unsafe_global_rkey.  This can be used by
 	 * ULPs to avoid the overhead of dynamic MRs.
 	 *
 	 * This flag is generally considered unsafe and must only be used in
 	 * extremly trusted environments.  Every use of it will log a warning
 	 * in the kernel log.
 	 */
 	IB_PD_UNSAFE_GLOBAL_RKEY	= 0x01,
 };
 
 struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags,
 		const char *caller);
 
+/**
+ * ib_alloc_pd - Allocates an unused protection domain.
+ * @device: The device on which to allocate the protection domain.
+ * @flags: protection domain flags
+ *
+ * A protection domain object provides an association between QPs, shared
+ * receive queues, address handles, memory regions, and memory windows.
+ *
+ * Every PD has a local_dma_lkey which can be used as the lkey value for local
+ * memory operations.
+ */
 #define ib_alloc_pd(device, flags) \
 	__ib_alloc_pd((device), (flags), KBUILD_MODNAME)
 
 int ib_dealloc_pd_user(struct ib_pd *pd, struct ib_udata *udata);
 
 /**
  * ib_dealloc_pd - Deallocate kernel PD
  * @pd: The protection domain
  *
  * NOTE: for user PD use ib_dealloc_pd_user with valid udata!
  */
 static inline void ib_dealloc_pd(struct ib_pd *pd)
 {
 	int ret = ib_dealloc_pd_user(pd, NULL);
 
 	WARN_ONCE(ret, "Destroy of kernel PD shouldn't fail");
 }
 
 enum rdma_create_ah_flags {
 	/* In a sleepable context */
 	RDMA_CREATE_AH_SLEEPABLE = BIT(0),
 };
 
 /**
  * rdma_create_ah - Creates an address handle for the given address vector.
  * @pd: The protection domain associated with the address handle.
  * @ah_attr: The attributes of the address vector.
  * @flags: Create address handle flags (see enum rdma_create_ah_flags).
  *
  * The address handle is used to reference a local or global destination
  * in all UD QP post sends.
  */
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 03/16] parport: fix a kernel-doc markup
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
  2020-12-01 12:08 ` [PATCH v5 01/16] HSI: fix a kernel-doc markup Mauro Carvalho Chehab
  2020-12-01 12:08 ` [PATCH v5 02/16] IB: fix kernel-doc markups Mauro Carvalho Chehab
@ 2020-12-01 12:08 ` Mauro Carvalho Chehab
  2020-12-01 12:08 ` [PATCH v5 04/16] rapidio: fix kernel-doc a markup Mauro Carvalho Chehab
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:08 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Sudip Mukherjee, linux-kernel

The kernel-doc markup inside share.c is actually for
__parport_register_driver. The actual goal seems to be
to document parport_register_driver().

So, fix the existing markup and add a new one.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/parport/share.c |  2 +-
 include/linux/parport.h | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 7fec4fefe151..62f8407923d4 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -214,65 +214,65 @@ static void get_lowlevel_driver(void)
 	request_module("parport_lowlevel");
 }
 
 /*
  * iterates through all the devices connected to the bus and sends the device
  * details to the match_port callback of the driver, so that the driver can
  * know what are all the ports that are connected to the bus and choose the
  * port to which it wants to register its device.
  */
 static int port_check(struct device *dev, void *dev_drv)
 {
 	struct parport_driver *drv = dev_drv;
 
 	/* only send ports, do not send other devices connected to bus */
 	if (is_parport(dev))
 		drv->match_port(to_parport_dev(dev));
 	return 0;
 }
 
 /*
  * Iterates through all the devices connected to the bus and return 1
  * if the device is a parallel port.
  */
 
 static int port_detect(struct device *dev, void *dev_drv)
 {
 	if (is_parport(dev))
 		return 1;
 	return 0;
 }
 
 /**
- *	parport_register_driver - register a parallel port device driver
+ *	__parport_register_driver - register a parallel port device driver
  *	@drv: structure describing the driver
  *	@owner: owner module of drv
  *	@mod_name: module name string
  *
  *	This can be called by a parallel port device driver in order
  *	to receive notifications about ports being found in the
  *	system, as well as ports no longer available.
  *
  *	If devmodel is true then the new device model is used
  *	for registration.
  *
  *	The @drv structure is allocated by the caller and must not be
  *	deallocated until after calling parport_unregister_driver().
  *
  *	If using the non device model:
  *	The driver's attach() function may block.  The port that
  *	attach() is given will be valid for the duration of the
  *	callback, but if the driver wants to take a copy of the
  *	pointer it must call parport_get_port() to do so.  Calling
  *	parport_register_device() on that port will do this for you.
  *
  *	The driver's detach() function may block.  The port that
  *	detach() is given will be valid for the duration of the
  *	callback, but if the driver wants to take a copy of the
  *	pointer it must call parport_get_port() to do so.
  *
  *
  *	Returns 0 on success. The non device model will always succeeds.
  *	but the new device model can fail and will return the error code.
  **/
 
 int __parport_register_driver(struct parport_driver *drv, struct module *owner,
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 1fb508c19e83..f981f794c850 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -268,64 +268,95 @@ struct parport_driver {
 
 #define to_parport_driver(n) container_of(n, struct parport_driver, driver)
 
 int parport_bus_init(void);
 void parport_bus_exit(void);
 
 /* parport_register_port registers a new parallel port at the given
    address (if one does not already exist) and returns a pointer to it.
    This entails claiming the I/O region, IRQ and DMA.  NULL is returned
    if initialisation fails. */
 struct parport *parport_register_port(unsigned long base, int irq, int dma,
 				      struct parport_operations *ops);
 
 /* Once a registered port is ready for high-level drivers to use, the
    low-level driver that registered it should announce it.  This will
    call the high-level drivers' attach() functions (after things like
    determining the IEEE 1284.3 topology of the port and collecting
    DeviceIDs). */
 void parport_announce_port (struct parport *port);
 
 /* Unregister a port. */
 extern void parport_remove_port(struct parport *port);
 
 /* Register a new high-level driver. */
 
 int __must_check __parport_register_driver(struct parport_driver *,
 					   struct module *,
 					   const char *mod_name);
 /*
  * parport_register_driver must be a macro so that KBUILD_MODNAME can
  * be expanded
  */
+
+/**
+ *	parport_register_driver - register a parallel port device driver
+ *	@driver: structure describing the driver
+ *
+ *	This can be called by a parallel port device driver in order
+ *	to receive notifications about ports being found in the
+ *	system, as well as ports no longer available.
+ *
+ *	If devmodel is true then the new device model is used
+ *	for registration.
+ *
+ *	The @driver structure is allocated by the caller and must not be
+ *	deallocated until after calling parport_unregister_driver().
+ *
+ *	If using the non device model:
+ *	The driver's attach() function may block.  The port that
+ *	attach() is given will be valid for the duration of the
+ *	callback, but if the driver wants to take a copy of the
+ *	pointer it must call parport_get_port() to do so.  Calling
+ *	parport_register_device() on that port will do this for you.
+ *
+ *	The driver's detach() function may block.  The port that
+ *	detach() is given will be valid for the duration of the
+ *	callback, but if the driver wants to take a copy of the
+ *	pointer it must call parport_get_port() to do so.
+ *
+ *
+ *	Returns 0 on success. The non device model will always succeeds.
+ *	but the new device model can fail and will return the error code.
+ **/
 #define parport_register_driver(driver)             \
 	__parport_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
 
 /* Unregister a high-level driver. */
 extern void parport_unregister_driver (struct parport_driver *);
 void parport_unregister_driver(struct parport_driver *);
 
 /* If parport_register_driver doesn't fit your needs, perhaps
  * parport_find_xxx does. */
 extern struct parport *parport_find_number (int);
 extern struct parport *parport_find_base (unsigned long);
 
 /* generic irq handler, if it suits your needs */
 extern irqreturn_t parport_irq_handler(int irq, void *dev_id);
 
 /* Reference counting for ports. */
 extern struct parport *parport_get_port (struct parport *);
 extern void parport_put_port (struct parport *);
 void parport_del_port(struct parport *);
 
 struct pardev_cb {
 	int (*preempt)(void *);
 	void (*wakeup)(void *);
 	void *private;
 	void (*irq_func)(void *);
 	unsigned int flags;
 };
 
 /*
  * parport_register_dev_model declares that a device is connected to a
  * port, and tells the kernel all it needs to know.
  */
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 04/16] rapidio: fix kernel-doc a markup
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (2 preceding siblings ...)
  2020-12-01 12:08 ` [PATCH v5 03/16] parport: fix a kernel-doc markup Mauro Carvalho Chehab
@ 2020-12-01 12:08 ` Mauro Carvalho Chehab
  2020-12-01 12:08 ` [PATCH v5 05/16] fs: fix kernel-doc markups Mauro Carvalho Chehab
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:08 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Alexandre Bounine, Matt Porter, linux-kernel

Probaly this was due to a cut and paste issue.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/rapidio/rio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index c2b79736a92b..e74cf09eeff0 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -720,65 +720,65 @@ EXPORT_SYMBOL_GPL(rio_unmap_inb_region);
 /**
  * rio_map_outb_region -- Map outbound memory region.
  * @mport: Master port.
  * @destid: destination id window points to
  * @rbase: RIO base address window translates to
  * @size: Size of the memory region
  * @rflags: Flags for mapping.
  * @local: physical address of memory region mapped
  *
  * Return: 0 -- Success.
  *
  * This function will create the mapping from RIO space to local memory.
  */
 int rio_map_outb_region(struct rio_mport *mport, u16 destid, u64 rbase,
 			u32 size, u32 rflags, dma_addr_t *local)
 {
 	int rc;
 	unsigned long flags;
 
 	if (!mport->ops->map_outb)
 		return -ENODEV;
 
 	spin_lock_irqsave(&rio_mmap_lock, flags);
 	rc = mport->ops->map_outb(mport, destid, rbase, size,
 		rflags, local);
 	spin_unlock_irqrestore(&rio_mmap_lock, flags);
 
 	return rc;
 }
 EXPORT_SYMBOL_GPL(rio_map_outb_region);
 
 /**
- * rio_unmap_inb_region -- Unmap the inbound memory region
+ * rio_unmap_outb_region -- Unmap the inbound memory region
  * @mport: Master port
  * @destid: destination id mapping points to
  * @rstart: RIO base address window translates to
  */
 void rio_unmap_outb_region(struct rio_mport *mport, u16 destid, u64 rstart)
 {
 	unsigned long flags;
 
 	if (!mport->ops->unmap_outb)
 		return;
 
 	spin_lock_irqsave(&rio_mmap_lock, flags);
 	mport->ops->unmap_outb(mport, destid, rstart);
 	spin_unlock_irqrestore(&rio_mmap_lock, flags);
 }
 EXPORT_SYMBOL_GPL(rio_unmap_outb_region);
 
 /**
  * rio_mport_get_physefb - Helper function that returns register offset
  *                      for Physical Layer Extended Features Block.
  * @port: Master port to issue transaction
  * @local: Indicate a local master port or remote device access
  * @destid: Destination ID of the device
  * @hopcount: Number of switch hops to the device
  * @rmap: pointer to location to store register map type info
  */
 u32
 rio_mport_get_physefb(struct rio_mport *port, int local,
 		      u16 destid, u8 hopcount, u32 *rmap)
 {
 	u32 ext_ftr_ptr;
 	u32 ftr_header;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 05/16] fs: fix kernel-doc markups
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (3 preceding siblings ...)
  2020-12-01 12:08 ` [PATCH v5 04/16] rapidio: fix kernel-doc a markup Mauro Carvalho Chehab
@ 2020-12-01 12:08 ` Mauro Carvalho Chehab
  2020-12-01 12:43   ` Christoph Hellwig
  2020-12-01 12:08 ` [PATCH v5 06/16] pstore/zone: fix a kernel-doc markup Mauro Carvalho Chehab
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:08 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Alexander Viro, linux-fsdevel, linux-kernel

Two markups are at the wrong place. Kernel-doc only
support having the comment just before the identifier.

Also, some identifiers have different names between their
prototypes and the kernel-doc markup.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 fs/dcache.c   | 72 +++++++++++++++++++++++++--------------------------
 fs/inode.c    |  4 +--
 fs/seq_file.c |  5 ++--
 fs/super.c    | 12 ++++-----
 4 files changed, 47 insertions(+), 46 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index ea0485861d93..6eabb48a49fc 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -427,109 +427,109 @@ static void d_shrink_add(struct dentry *dentry, struct list_head *list)
 	D_FLAG_VERIFY(dentry, 0);
 	list_add(&dentry->d_lru, list);
 	dentry->d_flags |= DCACHE_SHRINK_LIST | DCACHE_LRU_LIST;
 	this_cpu_inc(nr_dentry_unused);
 }
 
 /*
  * These can only be called under the global LRU lock, ie during the
  * callback for freeing the LRU list. "isolate" removes it from the
  * LRU lists entirely, while shrink_move moves it to the indicated
  * private list.
  */
 static void d_lru_isolate(struct list_lru_one *lru, struct dentry *dentry)
 {
 	D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST);
 	dentry->d_flags &= ~DCACHE_LRU_LIST;
 	this_cpu_dec(nr_dentry_unused);
 	if (d_is_negative(dentry))
 		this_cpu_dec(nr_dentry_negative);
 	list_lru_isolate(lru, &dentry->d_lru);
 }
 
 static void d_lru_shrink_move(struct list_lru_one *lru, struct dentry *dentry,
 			      struct list_head *list)
 {
 	D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST);
 	dentry->d_flags |= DCACHE_SHRINK_LIST;
 	if (d_is_negative(dentry))
 		this_cpu_dec(nr_dentry_negative);
 	list_lru_isolate_move(lru, &dentry->d_lru, list);
 }
 
-/**
- * d_drop - drop a dentry
- * @dentry: dentry to drop
- *
- * d_drop() unhashes the entry from the parent dentry hashes, so that it won't
- * be found through a VFS lookup any more. Note that this is different from
- * deleting the dentry - d_delete will try to mark the dentry negative if
- * possible, giving a successful _negative_ lookup, while d_drop will
- * just make the cache lookup fail.
- *
- * d_drop() is used mainly for stuff that wants to invalidate a dentry for some
- * reason (NFS timeouts or autofs deletes).
- *
- * __d_drop requires dentry->d_lock
- * ___d_drop doesn't mark dentry as "unhashed"
- *   (dentry->d_hash.pprev will be LIST_POISON2, not NULL).
- */
 static void ___d_drop(struct dentry *dentry)
 {
 	struct hlist_bl_head *b;
 	/*
 	 * Hashed dentries are normally on the dentry hashtable,
 	 * with the exception of those newly allocated by
 	 * d_obtain_root, which are always IS_ROOT:
 	 */
 	if (unlikely(IS_ROOT(dentry)))
 		b = &dentry->d_sb->s_roots;
 	else
 		b = d_hash(dentry->d_name.hash);
 
 	hlist_bl_lock(b);
 	__hlist_bl_del(&dentry->d_hash);
 	hlist_bl_unlock(b);
 }
 
 void __d_drop(struct dentry *dentry)
 {
 	if (!d_unhashed(dentry)) {
 		___d_drop(dentry);
 		dentry->d_hash.pprev = NULL;
 		write_seqcount_invalidate(&dentry->d_seq);
 	}
 }
 EXPORT_SYMBOL(__d_drop);
 
+/**
+ * d_drop - drop a dentry
+ * @dentry: dentry to drop
+ *
+ * d_drop() unhashes the entry from the parent dentry hashes, so that it won't
+ * be found through a VFS lookup any more. Note that this is different from
+ * deleting the dentry - d_delete will try to mark the dentry negative if
+ * possible, giving a successful _negative_ lookup, while d_drop will
+ * just make the cache lookup fail.
+ *
+ * d_drop() is used mainly for stuff that wants to invalidate a dentry for some
+ * reason (NFS timeouts or autofs deletes).
+ *
+ * __d_drop requires dentry->d_lock
+ * ___d_drop doesn't mark dentry as "unhashed"
+ *   (dentry->d_hash.pprev will be LIST_POISON2, not NULL).
+ */
 void d_drop(struct dentry *dentry)
 {
 	spin_lock(&dentry->d_lock);
 	__d_drop(dentry);
 	spin_unlock(&dentry->d_lock);
 }
 EXPORT_SYMBOL(d_drop);
 
 static inline void dentry_unlist(struct dentry *dentry, struct dentry *parent)
 {
 	struct dentry *next;
 	/*
 	 * Inform d_walk() and shrink_dentry_list() that we are no longer
 	 * attached to the dentry tree
 	 */
 	dentry->d_flags |= DCACHE_DENTRY_KILLED;
 	if (unlikely(list_empty(&dentry->d_child)))
 		return;
 	__list_del_entry(&dentry->d_child);
 	/*
 	 * Cursors can move around the list of children.  While we'd been
 	 * a normal list member, it didn't matter - ->d_child.next would've
 	 * been updated.  However, from now on it won't be and for the
 	 * things like d_walk() it might end up with a nasty surprise.
 	 * Normally d_walk() doesn't care about cursors moving around -
 	 * ->d_lock on parent prevents that and since a cursor has no children
 	 * of its own, we get through it without ever unlocking the parent.
 	 * There is one exception, though - if we ascend from a child that
 	 * gets killed as soon as we unlock it, the next sibling is found
 	 * using the value left in its ->d_child.next.  And if _that_
 	 * pointed to a cursor, and cursor got moved (e.g. by lseek())
 	 * before d_walk() regains parent->d_lock, we'll end up skipping
@@ -960,97 +960,97 @@ struct dentry *dget_parent(struct dentry *dentry)
 }
 EXPORT_SYMBOL(dget_parent);
 
 static struct dentry * __d_find_any_alias(struct inode *inode)
 {
 	struct dentry *alias;
 
 	if (hlist_empty(&inode->i_dentry))
 		return NULL;
 	alias = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);
 	__dget(alias);
 	return alias;
 }
 
 /**
  * d_find_any_alias - find any alias for a given inode
  * @inode: inode to find an alias for
  *
  * If any aliases exist for the given inode, take and return a
  * reference for one of them.  If no aliases exist, return %NULL.
  */
 struct dentry *d_find_any_alias(struct inode *inode)
 {
 	struct dentry *de;
 
 	spin_lock(&inode->i_lock);
 	de = __d_find_any_alias(inode);
 	spin_unlock(&inode->i_lock);
 	return de;
 }
 EXPORT_SYMBOL(d_find_any_alias);
 
+static struct dentry *__d_find_alias(struct inode *inode)
+{
+	struct dentry *alias;
+
+	if (S_ISDIR(inode->i_mode))
+		return __d_find_any_alias(inode);
+
+	hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
+		spin_lock(&alias->d_lock);
+ 		if (!d_unhashed(alias)) {
+			__dget_dlock(alias);
+			spin_unlock(&alias->d_lock);
+			return alias;
+		}
+		spin_unlock(&alias->d_lock);
+	}
+	return NULL;
+}
+
 /**
  * d_find_alias - grab a hashed alias of inode
  * @inode: inode in question
  *
  * If inode has a hashed alias, or is a directory and has any alias,
  * acquire the reference to alias and return it. Otherwise return NULL.
  * Notice that if inode is a directory there can be only one alias and
  * it can be unhashed only if it has no children, or if it is the root
  * of a filesystem, or if the directory was renamed and d_revalidate
  * was the first vfs operation to notice.
  *
  * If the inode has an IS_ROOT, DCACHE_DISCONNECTED alias, then prefer
  * any other hashed alias over that one.
  */
-static struct dentry *__d_find_alias(struct inode *inode)
-{
-	struct dentry *alias;
-
-	if (S_ISDIR(inode->i_mode))
-		return __d_find_any_alias(inode);
-
-	hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
-		spin_lock(&alias->d_lock);
- 		if (!d_unhashed(alias)) {
-			__dget_dlock(alias);
-			spin_unlock(&alias->d_lock);
-			return alias;
-		}
-		spin_unlock(&alias->d_lock);
-	}
-	return NULL;
-}
-
 struct dentry *d_find_alias(struct inode *inode)
 {
 	struct dentry *de = NULL;
 
 	if (!hlist_empty(&inode->i_dentry)) {
 		spin_lock(&inode->i_lock);
 		de = __d_find_alias(inode);
 		spin_unlock(&inode->i_lock);
 	}
 	return de;
 }
 EXPORT_SYMBOL(d_find_alias);
 
 /*
  *	Try to kill dentries associated with this inode.
  * WARNING: you must own a reference to inode.
  */
 void d_prune_aliases(struct inode *inode)
 {
 	struct dentry *dentry;
 restart:
 	spin_lock(&inode->i_lock);
 	hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
 		spin_lock(&dentry->d_lock);
 		if (!dentry->d_lockref.count) {
 			struct dentry *parent = lock_parent(dentry);
 			if (likely(!dentry->d_lockref.count)) {
 				__dentry_kill(dentry);
 				dput(parent);
 				goto restart;
 			}
 			if (parent)
diff --git a/fs/inode.c b/fs/inode.c
index 9d78c37b00b8..aad3dcf2e259 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1467,65 +1467,65 @@ EXPORT_SYMBOL(find_inode_nowait);
  * and 1 if it does.  The @test function must be responsible for taking the
  * i_lock spin_lock and checking i_state for an inode being freed or being
  * initialized.
  *
  * If successful, this will return the inode for which the @test function
  * returned 1 and NULL otherwise.
  *
  * The @test function is not permitted to take a ref on any inode presented.
  * It is also not permitted to sleep.
  *
  * The caller must hold the RCU read lock.
  */
 struct inode *find_inode_rcu(struct super_block *sb, unsigned long hashval,
 			     int (*test)(struct inode *, void *), void *data)
 {
 	struct hlist_head *head = inode_hashtable + hash(sb, hashval);
 	struct inode *inode;
 
 	RCU_LOCKDEP_WARN(!rcu_read_lock_held(),
 			 "suspicious find_inode_rcu() usage");
 
 	hlist_for_each_entry_rcu(inode, head, i_hash) {
 		if (inode->i_sb == sb &&
 		    !(READ_ONCE(inode->i_state) & (I_FREEING | I_WILL_FREE)) &&
 		    test(inode, data))
 			return inode;
 	}
 	return NULL;
 }
 EXPORT_SYMBOL(find_inode_rcu);
 
 /**
- * find_inode_by_rcu - Find an inode in the inode cache
+ * find_inode_by_ino_rcu - Find an inode in the inode cache
  * @sb:		Super block of file system to search
  * @ino:	The inode number to match
  *
  * Search for the inode specified by @hashval and @data in the inode cache,
  * where the helper function @test will return 0 if the inode does not match
  * and 1 if it does.  The @test function must be responsible for taking the
  * i_lock spin_lock and checking i_state for an inode being freed or being
  * initialized.
  *
  * If successful, this will return the inode for which the @test function
  * returned 1 and NULL otherwise.
  *
  * The @test function is not permitted to take a ref on any inode presented.
  * It is also not permitted to sleep.
  *
  * The caller must hold the RCU read lock.
  */
 struct inode *find_inode_by_ino_rcu(struct super_block *sb,
 				    unsigned long ino)
 {
 	struct hlist_head *head = inode_hashtable + hash(sb, ino);
 	struct inode *inode;
 
 	RCU_LOCKDEP_WARN(!rcu_read_lock_held(),
 			 "suspicious find_inode_by_ino_rcu() usage");
 
 	hlist_for_each_entry_rcu(inode, head, i_hash) {
 		if (inode->i_ino == ino &&
 		    inode->i_sb == sb &&
 		    !(READ_ONCE(inode->i_state) & (I_FREEING | I_WILL_FREE)))
 		    return inode;
 	}
@@ -1749,65 +1749,65 @@ int generic_update_time(struct inode *inode, struct timespec64 *time, int flags)
 
 	if (flags & S_ATIME)
 		inode->i_atime = *time;
 	if (flags & S_VERSION)
 		dirty = inode_maybe_inc_iversion(inode, false);
 	if (flags & S_CTIME)
 		inode->i_ctime = *time;
 	if (flags & S_MTIME)
 		inode->i_mtime = *time;
 	if ((flags & (S_ATIME | S_CTIME | S_MTIME)) &&
 	    !(inode->i_sb->s_flags & SB_LAZYTIME))
 		dirty = true;
 
 	if (dirty)
 		iflags |= I_DIRTY_SYNC;
 	__mark_inode_dirty(inode, iflags);
 	return 0;
 }
 EXPORT_SYMBOL(generic_update_time);
 
 /*
  * This does the actual work of updating an inodes time or version.  Must have
  * had called mnt_want_write() before calling this.
  */
 static int update_time(struct inode *inode, struct timespec64 *time, int flags)
 {
 	if (inode->i_op->update_time)
 		return inode->i_op->update_time(inode, time, flags);
 	return generic_update_time(inode, time, flags);
 }
 
 /**
- *	touch_atime	-	update the access time
+ *	atime_needs_update	-	update the access time
  *	@path: the &struct path to update
  *	@inode: inode to update
  *
  *	Update the accessed time on an inode and mark it for writeback.
  *	This function automatically handles read only file systems and media,
  *	as well as the "noatime" flag and inode specific "noatime" markers.
  */
 bool atime_needs_update(const struct path *path, struct inode *inode)
 {
 	struct vfsmount *mnt = path->mnt;
 	struct timespec64 now;
 
 	if (inode->i_flags & S_NOATIME)
 		return false;
 
 	/* Atime updates will likely cause i_uid and i_gid to be written
 	 * back improprely if their true value is unknown to the vfs.
 	 */
 	if (HAS_UNMAPPED_ID(inode))
 		return false;
 
 	if (IS_NOATIME(inode))
 		return false;
 	if ((inode->i_sb->s_flags & SB_NODIRATIME) && S_ISDIR(inode->i_mode))
 		return false;
 
 	if (mnt->mnt_flags & MNT_NOATIME)
 		return false;
 	if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
 		return false;
 
 	now = current_time(inode);
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 03a369ccd28c..cb11a34fb871 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -640,65 +640,66 @@ void *__seq_open_private(struct file *f, const struct seq_operations *ops,
 EXPORT_SYMBOL(__seq_open_private);
 
 int seq_open_private(struct file *filp, const struct seq_operations *ops,
 		int psize)
 {
 	return __seq_open_private(filp, ops, psize) ? 0 : -ENOMEM;
 }
 EXPORT_SYMBOL(seq_open_private);
 
 void seq_putc(struct seq_file *m, char c)
 {
 	if (m->count >= m->size)
 		return;
 
 	m->buf[m->count++] = c;
 }
 EXPORT_SYMBOL(seq_putc);
 
 void seq_puts(struct seq_file *m, const char *s)
 {
 	int len = strlen(s);
 
 	if (m->count + len >= m->size) {
 		seq_set_overflow(m);
 		return;
 	}
 	memcpy(m->buf + m->count, s, len);
 	m->count += len;
 }
 EXPORT_SYMBOL(seq_puts);
 
 /**
- * A helper routine for putting decimal numbers without rich format of printf().
+ * seq_put_decimal_ull_width - A helper routine for putting decimal numbers
+ * 			       without rich format of printf().
  * only 'unsigned long long' is supported.
  * @m: seq_file identifying the buffer to which data should be written
  * @delimiter: a string which is printed before the number
  * @num: the number
  * @width: a minimum field width
  *
  * This routine will put strlen(delimiter) + number into seq_filed.
  * This routine is very quick when you show lots of numbers.
  * In usual cases, it will be better to use seq_printf(). It's easier to read.
  */
 void seq_put_decimal_ull_width(struct seq_file *m, const char *delimiter,
 			 unsigned long long num, unsigned int width)
 {
 	int len;
 
 	if (m->count + 2 >= m->size) /* we'll write 2 bytes at least */
 		goto overflow;
 
 	if (delimiter && delimiter[0]) {
 		if (delimiter[1] == 0)
 			seq_putc(m, delimiter[0]);
 		else
 			seq_puts(m, delimiter);
 	}
 
 	if (!width)
 		width = 1;
 
 	if (m->count + width >= m->size)
 		goto overflow;
 
 	len = num_to_str(m->buf + m->count, m->size - m->count, num, width);
@@ -1015,65 +1016,65 @@ struct hlist_node *seq_hlist_start_head_rcu(struct hlist_head *head,
 
 	return seq_hlist_start_rcu(head, pos - 1);
 }
 EXPORT_SYMBOL(seq_hlist_start_head_rcu);
 
 /**
  * seq_hlist_next_rcu - move to the next position of the hlist protected by RCU
  * @v:    the current iterator
  * @head: the head of the hlist
  * @ppos: the current position
  *
  * Called at seq_file->op->next().
  *
  * This list-traversal primitive may safely run concurrently with
  * the _rcu list-mutation primitives such as hlist_add_head_rcu()
  * as long as the traversal is guarded by rcu_read_lock().
  */
 struct hlist_node *seq_hlist_next_rcu(void *v,
 				      struct hlist_head *head,
 				      loff_t *ppos)
 {
 	struct hlist_node *node = v;
 
 	++*ppos;
 	if (v == SEQ_START_TOKEN)
 		return rcu_dereference(head->first);
 	else
 		return rcu_dereference(node->next);
 }
 EXPORT_SYMBOL(seq_hlist_next_rcu);
 
 /**
- * seq_hlist_start_precpu - start an iteration of a percpu hlist array
+ * seq_hlist_start_percpu - start an iteration of a percpu hlist array
  * @head: pointer to percpu array of struct hlist_heads
  * @cpu:  pointer to cpu "cursor"
  * @pos:  start position of sequence
  *
  * Called at seq_file->op->start().
  */
 struct hlist_node *
 seq_hlist_start_percpu(struct hlist_head __percpu *head, int *cpu, loff_t pos)
 {
 	struct hlist_node *node;
 
 	for_each_possible_cpu(*cpu) {
 		hlist_for_each(node, per_cpu_ptr(head, *cpu)) {
 			if (pos-- == 0)
 				return node;
 		}
 	}
 	return NULL;
 }
 EXPORT_SYMBOL(seq_hlist_start_percpu);
 
 /**
  * seq_hlist_next_percpu - move to the next position of the percpu hlist array
  * @v:    pointer to current hlist_node
  * @head: pointer to percpu array of struct hlist_heads
  * @cpu:  pointer to cpu "cursor"
  * @pos:  start position of sequence
  *
  * Called at seq_file->op->next().
  */
 struct hlist_node *
 seq_hlist_next_percpu(void *v, struct hlist_head __percpu *head,
diff --git a/fs/super.c b/fs/super.c
index 98bb0629ee10..912636bbda9e 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1742,79 +1742,79 @@ int freeze_super(struct super_block *sb)
 	sb_wait_write(sb, SB_FREEZE_PAGEFAULT);
 
 	/* All writers are done so after syncing there won't be dirty data */
 	sync_filesystem(sb);
 
 	/* Now wait for internal filesystem counter */
 	sb->s_writers.frozen = SB_FREEZE_FS;
 	sb_wait_write(sb, SB_FREEZE_FS);
 
 	if (sb->s_op->freeze_fs) {
 		ret = sb->s_op->freeze_fs(sb);
 		if (ret) {
 			printk(KERN_ERR
 				"VFS:Filesystem freeze failed\n");
 			sb->s_writers.frozen = SB_UNFROZEN;
 			sb_freeze_unlock(sb);
 			wake_up(&sb->s_writers.wait_unfrozen);
 			deactivate_locked_super(sb);
 			return ret;
 		}
 	}
 	/*
 	 * For debugging purposes so that fs can warn if it sees write activity
 	 * when frozen is set to SB_FREEZE_COMPLETE, and for thaw_super().
 	 */
 	sb->s_writers.frozen = SB_FREEZE_COMPLETE;
 	lockdep_sb_freeze_release(sb);
 	up_write(&sb->s_umount);
 	return 0;
 }
 EXPORT_SYMBOL(freeze_super);
 
-/**
- * thaw_super -- unlock filesystem
- * @sb: the super to thaw
- *
- * Unlocks the filesystem and marks it writeable again after freeze_super().
- */
 static int thaw_super_locked(struct super_block *sb)
 {
 	int error;
 
 	if (sb->s_writers.frozen != SB_FREEZE_COMPLETE) {
 		up_write(&sb->s_umount);
 		return -EINVAL;
 	}
 
 	if (sb_rdonly(sb)) {
 		sb->s_writers.frozen = SB_UNFROZEN;
 		goto out;
 	}
 
 	lockdep_sb_freeze_acquire(sb);
 
 	if (sb->s_op->unfreeze_fs) {
 		error = sb->s_op->unfreeze_fs(sb);
 		if (error) {
 			printk(KERN_ERR
 				"VFS:Filesystem thaw failed\n");
 			lockdep_sb_freeze_release(sb);
 			up_write(&sb->s_umount);
 			return error;
 		}
 	}
 
 	sb->s_writers.frozen = SB_UNFROZEN;
 	sb_freeze_unlock(sb);
 out:
 	wake_up(&sb->s_writers.wait_unfrozen);
 	deactivate_locked_super(sb);
 	return 0;
 }
 
+/**
+ * thaw_super -- unlock filesystem
+ * @sb: the super to thaw
+ *
+ * Unlocks the filesystem and marks it writeable again after freeze_super().
+ */
 int thaw_super(struct super_block *sb)
 {
 	down_write(&sb->s_umount);
 	return thaw_super_locked(sb);
 }
 EXPORT_SYMBOL(thaw_super);
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 06/16] pstore/zone: fix a kernel-doc markup
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (4 preceding siblings ...)
  2020-12-01 12:08 ` [PATCH v5 05/16] fs: fix kernel-doc markups Mauro Carvalho Chehab
@ 2020-12-01 12:08 ` Mauro Carvalho Chehab
  2020-12-01 12:09 ` [PATCH v5 07/16] completion: drop init_completion define Mauro Carvalho Chehab
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:08 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Anton Vorontsov, Colin Cross, Kees Cook,
	Tony Luck, linux-kernel

The documented struct is psz_head and not psz_buffer.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 fs/pstore/zone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c
index 3ce89216670c..46a1610c06fa 100644
--- a/fs/pstore/zone.c
+++ b/fs/pstore/zone.c
@@ -1,58 +1,58 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
  * Provide a pstore intermediate backend, organized into kernel memory
  * allocated zones that are then mapped and flushed into a single
  * contiguous region on a storage backend of some kind (block, mtd, etc).
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/mount.h>
 #include <linux/printk.h>
 #include <linux/fs.h>
 #include <linux/pstore_zone.h>
 #include <linux/kdev_t.h>
 #include <linux/device.h>
 #include <linux/namei.h>
 #include <linux/fcntl.h>
 #include <linux/uio.h>
 #include <linux/writeback.h>
 #include "internal.h"
 
 /**
- * struct psz_head - header of zone to flush to storage
+ * struct psz_buffer - header of zone to flush to storage
  *
  * @sig: signature to indicate header (PSZ_SIG xor PSZONE-type value)
  * @datalen: length of data in @data
  * @start: offset into @data where the beginning of the stored bytes begin
  * @data: zone data.
  */
 struct psz_buffer {
 #define PSZ_SIG (0x43474244) /* DBGC */
 	uint32_t sig;
 	atomic_t datalen;
 	atomic_t start;
 	uint8_t data[];
 };
 
 /**
  * struct psz_kmsg_header - kmsg dump-specific header to flush to storage
  *
  * @magic: magic num for kmsg dump header
  * @time: kmsg dump trigger time
  * @compressed: whether conpressed
  * @counter: kmsg dump counter
  * @reason: the kmsg dump reason (e.g. oops, panic, etc)
  * @data: pointer to log data
  *
  * This is a sub-header for a kmsg dump, trailing after &psz_buffer.
  */
 struct psz_kmsg_header {
 #define PSTORE_KMSG_HEADER_MAGIC 0x4dfc3ae5 /* Just a random number */
 	uint32_t magic;
 	struct timespec64 time;
 	bool compressed;
 	uint32_t counter;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 07/16] completion: drop init_completion define
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (5 preceding siblings ...)
  2020-12-01 12:08 ` [PATCH v5 06/16] pstore/zone: fix a kernel-doc markup Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-01 12:54   ` Peter Zijlstra
  2020-12-01 12:09 ` [PATCH v5 08/16] firmware: stratix10-svc: fix kernel-doc markups Mauro Carvalho Chehab
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Joel Fernandes (Google),
	Peter Zijlstra (Intel),
	Davidlohr Bueso, Greg Kroah-Hartman, Ingo Molnar,
	Thomas Gleixner, linux-kernel

Changeset cd8084f91c02 ("locking/lockdep: Apply crossrelease to completions")
added a CONFIG_LOCKDEP_COMPLETE (that was later renamed to
CONFIG_LOCKDEP_COMPLETIONS).

Such changeset renamed the init_completion, and add a macro
that would either run a modified version or the original code.

However, such code reported too many false positives. So, it
ended being dropped later on by
changeset e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks").

Yet, the define remained there as just:

	 #define init_completion(x) __init_completion(x)

Get rid of the define, and return __init_completion() function
to its original name.

Fixes: e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 include/linux/completion.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/linux/completion.h b/include/linux/completion.h
index bf8e77001f18..51d9ab079629 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -1,117 +1,116 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #ifndef __LINUX_COMPLETION_H
 #define __LINUX_COMPLETION_H
 
 /*
  * (C) Copyright 2001 Linus Torvalds
  *
  * Atomic wait-for-completion handler data structures.
  * See kernel/sched/completion.c for details.
  */
 
 #include <linux/swait.h>
 
 /*
  * struct completion - structure used to maintain state for a "completion"
  *
  * This is the opaque structure used to maintain the state for a "completion".
  * Completions currently use a FIFO to queue threads that have to wait for
  * the "completion" event.
  *
  * See also:  complete(), wait_for_completion() (and friends _timeout,
  * _interruptible, _interruptible_timeout, and _killable), init_completion(),
  * reinit_completion(), and macros DECLARE_COMPLETION(),
  * DECLARE_COMPLETION_ONSTACK().
  */
 struct completion {
 	unsigned int done;
 	struct swait_queue_head wait;
 };
 
-#define init_completion_map(x, m) __init_completion(x)
-#define init_completion(x) __init_completion(x)
+#define init_completion_map(x, m) init_completion(x)
 static inline void complete_acquire(struct completion *x) {}
 static inline void complete_release(struct completion *x) {}
 
 #define COMPLETION_INITIALIZER(work) \
 	{ 0, __SWAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
 
 #define COMPLETION_INITIALIZER_ONSTACK_MAP(work, map) \
 	(*({ init_completion_map(&(work), &(map)); &(work); }))
 
 #define COMPLETION_INITIALIZER_ONSTACK(work) \
 	(*({ init_completion(&work); &work; }))
 
 /**
  * DECLARE_COMPLETION - declare and initialize a completion structure
  * @work:  identifier for the completion structure
  *
  * This macro declares and initializes a completion structure. Generally used
  * for static declarations. You should use the _ONSTACK variant for automatic
  * variables.
  */
 #define DECLARE_COMPLETION(work) \
 	struct completion work = COMPLETION_INITIALIZER(work)
 
 /*
  * Lockdep needs to run a non-constant initializer for on-stack
  * completions - so we use the _ONSTACK() variant for those that
  * are on the kernel stack:
  */
 /**
  * DECLARE_COMPLETION_ONSTACK - declare and initialize a completion structure
  * @work:  identifier for the completion structure
  *
  * This macro declares and initializes a completion structure on the kernel
  * stack.
  */
 #ifdef CONFIG_LOCKDEP
 # define DECLARE_COMPLETION_ONSTACK(work) \
 	struct completion work = COMPLETION_INITIALIZER_ONSTACK(work)
 # define DECLARE_COMPLETION_ONSTACK_MAP(work, map) \
 	struct completion work = COMPLETION_INITIALIZER_ONSTACK_MAP(work, map)
 #else
 # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
 # define DECLARE_COMPLETION_ONSTACK_MAP(work, map) DECLARE_COMPLETION(work)
 #endif
 
 /**
  * init_completion - Initialize a dynamically allocated completion
  * @x:  pointer to completion structure that is to be initialized
  *
  * This inline function will initialize a dynamically created completion
  * structure.
  */
-static inline void __init_completion(struct completion *x)
+static inline void init_completion(struct completion *x)
 {
 	x->done = 0;
 	init_swait_queue_head(&x->wait);
 }
 
 /**
  * reinit_completion - reinitialize a completion structure
  * @x:  pointer to completion structure that is to be reinitialized
  *
  * This inline function should be used to reinitialize a completion structure so it can
  * be reused. This is especially important after complete_all() is used.
  */
 static inline void reinit_completion(struct completion *x)
 {
 	x->done = 0;
 }
 
 extern void wait_for_completion(struct completion *);
 extern void wait_for_completion_io(struct completion *);
 extern int wait_for_completion_interruptible(struct completion *x);
 extern int wait_for_completion_killable(struct completion *x);
 extern unsigned long wait_for_completion_timeout(struct completion *x,
 						   unsigned long timeout);
 extern unsigned long wait_for_completion_io_timeout(struct completion *x,
 						    unsigned long timeout);
 extern long wait_for_completion_interruptible_timeout(
 	struct completion *x, unsigned long timeout);
 extern long wait_for_completion_killable_timeout(
 	struct completion *x, unsigned long timeout);
 extern bool try_wait_for_completion(struct completion *x);
 extern bool completion_done(struct completion *x);
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 08/16] firmware: stratix10-svc: fix kernel-doc markups
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (6 preceding siblings ...)
  2020-12-01 12:09 ` [PATCH v5 07/16] completion: drop init_completion define Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-01 12:09 ` [PATCH v5 09/16] connector: fix a kernel-doc markup Mauro Carvalho Chehab
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Richard Gong, linux-kernel

There are some common comments marked, instead, with kernel-doc
notation, which won't work.

While here, rename an identifier, in order to match the
function prototype below kernel-doc markup.

Acked-by: Richard Gong <richard.gong@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 include/linux/firmware/intel/stratix10-svc-client.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/firmware/intel/stratix10-svc-client.h b/include/linux/firmware/intel/stratix10-svc-client.h
index a93d85932eb9..ebc295647581 100644
--- a/include/linux/firmware/intel/stratix10-svc-client.h
+++ b/include/linux/firmware/intel/stratix10-svc-client.h
@@ -1,93 +1,93 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2017-2018, Intel Corporation
  */
 
 #ifndef __STRATIX10_SVC_CLIENT_H
 #define __STRATIX10_SVC_CLIENT_H
 
-/**
+/*
  * Service layer driver supports client names
  *
  * fpga: for FPGA configuration
  * rsu: for remote status update
  */
 #define SVC_CLIENT_FPGA			"fpga"
 #define SVC_CLIENT_RSU			"rsu"
 
-/**
+/*
  * Status of the sent command, in bit number
  *
  * SVC_STATUS_OK:
  * Secure firmware accepts the request issued by one of service clients.
  *
  * SVC_STATUS_BUFFER_SUBMITTED:
  * Service client successfully submits data buffer to secure firmware.
  *
  * SVC_STATUS_BUFFER_DONE:
  * Secure firmware completes data process, ready to accept the
  * next WRITE transaction.
  *
  * SVC_STATUS_COMPLETED:
  * Secure firmware completes service request successfully. In case of
  * FPGA configuration, FPGA should be in user mode.
  *
  * SVC_COMMAND_STATUS_BUSY:
  * Service request is still in process.
  *
  * SVC_COMMAND_STATUS_ERROR:
  * Error encountered during the process of the service request.
  *
  * SVC_STATUS_NO_SUPPORT:
  * Secure firmware doesn't support requested features such as RSU retry
  * or RSU notify.
  */
 #define SVC_STATUS_OK			0
 #define SVC_STATUS_BUFFER_SUBMITTED	1
 #define SVC_STATUS_BUFFER_DONE		2
 #define SVC_STATUS_COMPLETED		3
 #define SVC_STATUS_BUSY			4
 #define SVC_STATUS_ERROR		5
 #define SVC_STATUS_NO_SUPPORT		6
 
-/**
+/*
  * Flag bit for COMMAND_RECONFIG
  *
  * COMMAND_RECONFIG_FLAG_PARTIAL:
  * Set to FPGA configuration type (full or partial).
  */
 #define COMMAND_RECONFIG_FLAG_PARTIAL	1
 
-/**
+/*
  * Timeout settings for service clients:
  * timeout value used in Stratix10 FPGA manager driver.
  * timeout value used in RSU driver
  */
 #define SVC_RECONFIG_REQUEST_TIMEOUT_MS         300
 #define SVC_RECONFIG_BUFFER_TIMEOUT_MS          720
 #define SVC_RSU_REQUEST_TIMEOUT_MS              300
 
 struct stratix10_svc_chan;
 
 /**
  * enum stratix10_svc_command_code - supported service commands
  *
  * @COMMAND_NOOP: do 'dummy' request for integration/debug/trouble-shooting
  *
  * @COMMAND_RECONFIG: ask for FPGA configuration preparation, return status
  * is SVC_STATUS_OK
  *
  * @COMMAND_RECONFIG_DATA_SUBMIT: submit buffer(s) of bit-stream data for the
  * FPGA configuration, return status is SVC_STATUS_SUBMITTED or SVC_STATUS_ERROR
  *
  * @COMMAND_RECONFIG_DATA_CLAIM: check the status of the configuration, return
  * status is SVC_STATUS_COMPLETED, or SVC_STATUS_BUSY, or SVC_STATUS_ERROR
  *
  * @COMMAND_RECONFIG_STATUS: check the status of the configuration, return
  * status is SVC_STATUS_COMPLETED, or SVC_STATUS_BUSY, or SVC_STATUS_ERROR
  *
  * @COMMAND_RSU_STATUS: request remote system update boot log, return status
  * is log data or SVC_STATUS_RSU_ERROR
  *
  * @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot,
  * return status is SVC_STATUS_OK or SVC_STATUS_ERROR
@@ -189,42 +189,42 @@ void stratix10_svc_free_channel(struct stratix10_svc_chan *chan);
 /**
  * stratix10_svc_allocate_memory() - allocate the momory
  * @chan: service channel assigned to the client
  * @size: number of bytes client requests
  *
  * Service layer allocates the requested number of bytes from the memory
  * pool for the client.
  *
  * Return: the starting address of allocated memory on success, or
  * ERR_PTR() on error.
  */
 void *stratix10_svc_allocate_memory(struct stratix10_svc_chan *chan,
 				    size_t size);
 
 /**
  * stratix10_svc_free_memory() - free allocated memory
  * @chan: service channel assigned to the client
  * @kaddr: starting address of memory to be free back to pool
  */
 void stratix10_svc_free_memory(struct stratix10_svc_chan *chan, void *kaddr);
 
 /**
  * stratix10_svc_send() - send a message to the remote
  * @chan: service channel assigned to the client
  * @msg: message data to be sent, in the format of
  * struct stratix10_svc_client_msg
  *
  * Return: 0 for success, -ENOMEM or -ENOBUFS on error.
  */
 int stratix10_svc_send(struct stratix10_svc_chan *chan, void *msg);
 
 /**
- * intel_svc_done() - complete service request
+ * stratix10_svc_done() - complete service request
  * @chan: service channel assigned to the client
  *
  * This function is used by service client to inform service layer that
  * client's service requests are completed, or there is an error in the
  * request process.
  */
 void stratix10_svc_done(struct stratix10_svc_chan *chan);
 #endif
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 09/16] connector: fix a kernel-doc markup
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (7 preceding siblings ...)
  2020-12-01 12:09 ` [PATCH v5 08/16] firmware: stratix10-svc: fix kernel-doc markups Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-01 12:09 ` [PATCH v5 10/16] lib/crc7: " Mauro Carvalho Chehab
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, linux-kernel

A function has a different name between their prototype
and its kernel-doc markup.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 include/linux/connector.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/connector.h b/include/linux/connector.h
index cb732643471b..6bdb56662675 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -70,65 +70,65 @@ int cn_add_callback(struct cb_id *id, const char *name,
  * cn_del_callback() - Unregisters new callback with connector core.
  *
  * @id:		unique connector's user identifier.
  */
 void cn_del_callback(struct cb_id *id);
 
 
 /**
  * cn_netlink_send_mult - Sends message to the specified groups.
  *
  * @msg: 	message header(with attached data).
  * @len:	Number of @msg to be sent.
  * @portid:	destination port.
  *		If non-zero the message will be sent to the given port,
  *		which should be set to the original sender.
  * @group:	destination group.
  * 		If @portid and @group is zero, then appropriate group will
  *		be searched through all registered connector users, and
  *		message will be delivered to the group which was created
  *		for user with the same ID as in @msg.
  *		If @group is not zero, then message will be delivered
  *		to the specified group.
  * @gfp_mask:	GFP mask.
  *
  * It can be safely called from softirq context, but may silently
  * fail under strong memory pressure.
  *
  * If there are no listeners for given group %-ESRCH can be returned.
  */
 int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 group, gfp_t gfp_mask);
 
 /**
- * cn_netlink_send_mult - Sends message to the specified groups.
+ * cn_netlink_send - Sends message to the specified groups.
  *
  * @msg:	message header(with attached data).
  * @portid:	destination port.
  *		If non-zero the message will be sent to the given port,
  *		which should be set to the original sender.
  * @group:	destination group.
  * 		If @portid and @group is zero, then appropriate group will
  *		be searched through all registered connector users, and
  *		message will be delivered to the group which was created
  *		for user with the same ID as in @msg.
  *		If @group is not zero, then message will be delivered
  *		to the specified group.
  * @gfp_mask:	GFP mask.
  *
  * It can be safely called from softirq context, but may silently
  * fail under strong memory pressure.
  *
  * If there are no listeners for given group %-ESRCH can be returned.
  */
 int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 group, gfp_t gfp_mask);
 
 int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name,
 			  struct cb_id *id,
 			  void (*callback)(struct cn_msg *, struct netlink_skb_parms *));
 void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
 void cn_queue_release_callback(struct cn_callback_entry *);
 
 struct cn_queue_dev *cn_queue_alloc_dev(const char *name, struct sock *);
 void cn_queue_free_dev(struct cn_queue_dev *dev);
 
 int cn_cb_equal(struct cb_id *, struct cb_id *);
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 10/16] lib/crc7: fix a kernel-doc markup
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (8 preceding siblings ...)
  2020-12-01 12:09 ` [PATCH v5 09/16] connector: fix a kernel-doc markup Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-01 12:09 ` [PATCH v5 11/16] memblock: fix kernel-doc markups Mauro Carvalho Chehab
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, linux-kernel

A function has a different name between their prototype
and its kernel-doc markup.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 lib/crc7.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/crc7.c b/lib/crc7.c
index 6a848d73e804..3848e313b722 100644
--- a/lib/crc7.c
+++ b/lib/crc7.c
@@ -22,53 +22,53 @@ const u8 crc7_be_syndrome_table[256] = {
 	0x64, 0x76, 0x40, 0x52, 0x2c, 0x3e, 0x08, 0x1a,
 	0xf4, 0xe6, 0xd0, 0xc2, 0xbc, 0xae, 0x98, 0x8a,
 	0x56, 0x44, 0x72, 0x60, 0x1e, 0x0c, 0x3a, 0x28,
 	0xc6, 0xd4, 0xe2, 0xf0, 0x8e, 0x9c, 0xaa, 0xb8,
 	0xc8, 0xda, 0xec, 0xfe, 0x80, 0x92, 0xa4, 0xb6,
 	0x58, 0x4a, 0x7c, 0x6e, 0x10, 0x02, 0x34, 0x26,
 	0xfa, 0xe8, 0xde, 0xcc, 0xb2, 0xa0, 0x96, 0x84,
 	0x6a, 0x78, 0x4e, 0x5c, 0x22, 0x30, 0x06, 0x14,
 	0xac, 0xbe, 0x88, 0x9a, 0xe4, 0xf6, 0xc0, 0xd2,
 	0x3c, 0x2e, 0x18, 0x0a, 0x74, 0x66, 0x50, 0x42,
 	0x9e, 0x8c, 0xba, 0xa8, 0xd6, 0xc4, 0xf2, 0xe0,
 	0x0e, 0x1c, 0x2a, 0x38, 0x46, 0x54, 0x62, 0x70,
 	0x82, 0x90, 0xa6, 0xb4, 0xca, 0xd8, 0xee, 0xfc,
 	0x12, 0x00, 0x36, 0x24, 0x5a, 0x48, 0x7e, 0x6c,
 	0xb0, 0xa2, 0x94, 0x86, 0xf8, 0xea, 0xdc, 0xce,
 	0x20, 0x32, 0x04, 0x16, 0x68, 0x7a, 0x4c, 0x5e,
 	0xe6, 0xf4, 0xc2, 0xd0, 0xae, 0xbc, 0x8a, 0x98,
 	0x76, 0x64, 0x52, 0x40, 0x3e, 0x2c, 0x1a, 0x08,
 	0xd4, 0xc6, 0xf0, 0xe2, 0x9c, 0x8e, 0xb8, 0xaa,
 	0x44, 0x56, 0x60, 0x72, 0x0c, 0x1e, 0x28, 0x3a,
 	0x4a, 0x58, 0x6e, 0x7c, 0x02, 0x10, 0x26, 0x34,
 	0xda, 0xc8, 0xfe, 0xec, 0x92, 0x80, 0xb6, 0xa4,
 	0x78, 0x6a, 0x5c, 0x4e, 0x30, 0x22, 0x14, 0x06,
 	0xe8, 0xfa, 0xcc, 0xde, 0xa0, 0xb2, 0x84, 0x96,
 	0x2e, 0x3c, 0x0a, 0x18, 0x66, 0x74, 0x42, 0x50,
 	0xbe, 0xac, 0x9a, 0x88, 0xf6, 0xe4, 0xd2, 0xc0,
 	0x1c, 0x0e, 0x38, 0x2a, 0x54, 0x46, 0x70, 0x62,
 	0x8c, 0x9e, 0xa8, 0xba, 0xc4, 0xd6, 0xe0, 0xf2
 };
 EXPORT_SYMBOL(crc7_be_syndrome_table);
 
 /**
- * crc7 - update the CRC7 for the data buffer
+ * crc7_be - update the CRC7 for the data buffer
  * @crc:     previous CRC7 value
  * @buffer:  data pointer
  * @len:     number of bytes in the buffer
  * Context: any
  *
  * Returns the updated CRC7 value.
  * The CRC7 is left-aligned in the byte (the lsbit is always 0), as that
  * makes the computation easier, and all callers want it in that form.
  *
  */
 u8 crc7_be(u8 crc, const u8 *buffer, size_t len)
 {
 	while (len--)
 		crc = crc7_be_byte(crc, *buffer++);
 	return crc;
 }
 EXPORT_SYMBOL(crc7_be);
 
 MODULE_DESCRIPTION("CRC7 calculations");
 MODULE_LICENSE("GPL");
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 11/16] memblock: fix kernel-doc markups
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (9 preceding siblings ...)
  2020-12-01 12:09 ` [PATCH v5 10/16] lib/crc7: " Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-01 12:09 ` [PATCH v5 12/16] w1: fix a kernel-doc markup Mauro Carvalho Chehab
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Mike Rapoport, linux-kernel, linux-mm,
	Mike Rapoport

Some identifiers have different names between their prototypes
and the kernel-doc markup.

Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 include/linux/memblock.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index b93c44b9121e..9cc6da7b513e 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -243,85 +243,85 @@ static inline bool memblock_is_mirror(struct memblock_region *m)
 	return m->flags & MEMBLOCK_MIRROR;
 }
 
 static inline bool memblock_is_nomap(struct memblock_region *m)
 {
 	return m->flags & MEMBLOCK_NOMAP;
 }
 
 int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
 			    unsigned long  *end_pfn);
 void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
 			  unsigned long *out_end_pfn, int *out_nid);
 
 /**
  * for_each_mem_pfn_range - early memory pfn range iterator
  * @i: an integer used as loop variable
  * @nid: node selector, %MAX_NUMNODES for all nodes
  * @p_start: ptr to ulong for start pfn of the range, can be %NULL
  * @p_end: ptr to ulong for end pfn of the range, can be %NULL
  * @p_nid: ptr to int for nid of the range, can be %NULL
  *
  * Walks over configured memory ranges.
  */
 #define for_each_mem_pfn_range(i, nid, p_start, p_end, p_nid)		\
 	for (i = -1, __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid); \
 	     i >= 0; __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid))
 
 #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
 void __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
 				  unsigned long *out_spfn,
 				  unsigned long *out_epfn);
 /**
- * for_each_free_mem_range_in_zone - iterate through zone specific free
+ * for_each_free_mem_pfn_range_in_zone - iterate through zone specific free
  * memblock areas
  * @i: u64 used as loop variable
  * @zone: zone in which all of the memory blocks reside
  * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
  * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
  *
  * Walks over free (memory && !reserved) areas of memblock in a specific
  * zone. Available once memblock and an empty zone is initialized. The main
  * assumption is that the zone start, end, and pgdat have been associated.
  * This way we can use the zone to determine NUMA node, and if a given part
  * of the memblock is valid for the zone.
  */
 #define for_each_free_mem_pfn_range_in_zone(i, zone, p_start, p_end)	\
 	for (i = 0,							\
 	     __next_mem_pfn_range_in_zone(&i, zone, p_start, p_end);	\
 	     i != U64_MAX;					\
 	     __next_mem_pfn_range_in_zone(&i, zone, p_start, p_end))
 
 /**
- * for_each_free_mem_range_in_zone_from - iterate through zone specific
+ * for_each_free_mem_pfn_range_in_zone_from - iterate through zone specific
  * free memblock areas from a given point
  * @i: u64 used as loop variable
  * @zone: zone in which all of the memory blocks reside
  * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
  * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
  *
  * Walks over free (memory && !reserved) areas of memblock in a specific
  * zone, continuing from current position. Available as soon as memblock is
  * initialized.
  */
 #define for_each_free_mem_pfn_range_in_zone_from(i, zone, p_start, p_end) \
 	for (; i != U64_MAX;					  \
 	     __next_mem_pfn_range_in_zone(&i, zone, p_start, p_end))
 
 int __init deferred_page_init_max_threads(const struct cpumask *node_cpumask);
 
 #endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
 
 /**
  * for_each_free_mem_range - iterate through free memblock areas
  * @i: u64 used as loop variable
  * @nid: node selector, %NUMA_NO_NODE for all nodes
  * @flags: pick from blocks based on memory attributes
  * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
  * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
  * @p_nid: ptr to int for nid of the range, can be %NULL
  *
  * Walks over free (memory && !reserved) areas of memblock.  Available as
  * soon as memblock is initialized.
  */
 #define for_each_free_mem_range(i, nid, flags, p_start, p_end, p_nid)	\
 	__for_each_mem_range(i, &memblock.memory, &memblock.reserved,	\
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 12/16] w1: fix a kernel-doc markup
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (10 preceding siblings ...)
  2020-12-01 12:09 ` [PATCH v5 11/16] memblock: fix kernel-doc markups Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-01 12:09 ` [PATCH v5 13/16] sched: fix " Mauro Carvalho Chehab
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Evgeniy Polyakov, linux-kernel

A function has a different name between their prototype
and its kernel-doc markup.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 include/linux/w1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/w1.h b/include/linux/w1.h
index 949d3b10e531..9a2a0ef39018 100644
--- a/include/linux/w1.h
+++ b/include/linux/w1.h
@@ -251,65 +251,65 @@ void w1_remove_master_device(struct w1_bus_master *master);
  * @chip_info: pointer to struct hwmon_chip_info
  */
 struct w1_family_ops {
 	int  (*add_slave)(struct w1_slave *sl);
 	void (*remove_slave)(struct w1_slave *sl);
 	const struct attribute_group **groups;
 	const struct hwmon_chip_info *chip_info;
 };
 
 /**
  * struct w1_family - reference counted family structure.
  * @family_entry:	family linked list
  * @fid:		8 bit family identifier
  * @fops:		operations for this family
  * @of_match_table: open firmware match table
  * @refcnt:		reference counter
  */
 struct w1_family {
 	struct list_head	family_entry;
 	u8			fid;
 
 	const struct w1_family_ops *fops;
 
 	const struct of_device_id *of_match_table;
 
 	atomic_t		refcnt;
 };
 
 int w1_register_family(struct w1_family *family);
 void w1_unregister_family(struct w1_family *family);
 
 /**
- * module_w1_driver() - Helper macro for registering a 1-Wire families
+ * module_w1_family() - Helper macro for registering a 1-Wire families
  * @__w1_family: w1_family struct
  *
  * Helper macro for 1-Wire families which do not do anything special in module
  * init/exit. This eliminates a lot of boilerplate. Each module may only
  * use this macro once, and calling it replaces module_init() and module_exit()
  */
 #define module_w1_family(__w1_family) \
 	module_driver(__w1_family, w1_register_family, \
 			w1_unregister_family)
 
 u8 w1_triplet(struct w1_master *dev, int bdir);
 u8 w1_touch_bit(struct w1_master *dev, int bit);
 void w1_write_8(struct w1_master *, u8);
 u8 w1_read_8(struct w1_master *);
 int w1_reset_bus(struct w1_master *);
 u8 w1_calc_crc8(u8 *, int);
 void w1_write_block(struct w1_master *, const u8 *, int);
 void w1_touch_block(struct w1_master *, u8 *, int);
 u8 w1_read_block(struct w1_master *, u8 *, int);
 int w1_reset_select_slave(struct w1_slave *sl);
 int w1_reset_resume_command(struct w1_master *);
 void w1_next_pullup(struct w1_master *, int);
 
 static inline struct w1_slave* dev_to_w1_slave(struct device *dev)
 {
 	return container_of(dev, struct w1_slave, dev);
 }
 
 static inline struct w1_slave* kobj_to_w1_slave(struct kobject *kobj)
 {
 	return dev_to_w1_slave(container_of(kobj, struct device, kobj));
 }
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 13/16] sched: fix kernel-doc markup
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (11 preceding siblings ...)
  2020-12-01 12:09 ` [PATCH v5 12/16] w1: fix a kernel-doc markup Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-02  8:13   ` Peter Zijlstra
  2020-12-02 14:10   ` Thomas Gleixner
  2020-12-01 12:09 ` [PATCH v5 14/16] selftests: kselftest_harness.h: partially fix kernel-doc markups Mauro Carvalho Chehab
                   ` (2 subsequent siblings)
  15 siblings, 2 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Ben Segall, Daniel Bristot de Oliveira,
	Dietmar Eggemann, Ingo Molnar, Juri Lelli, Mel Gorman,
	Peter Zijlstra, Steven Rostedt, Vincent Guittot, linux-kernel

Kernel-doc requires that a kernel-doc markup to be immediately
below the function prototype, as otherwise it will rename it.
So, move sys_sched_yield() markup to the right place.

Also fix the cpu_util() markup: Kernel-doc markups
should use this format:
        identifier - description

Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 kernel/sched/core.c | 16 ++++++++--------
 kernel/sched/fair.c |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index d7f5277adbee..3545359072a8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6606,89 +6606,89 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask)
  *
  * Return: size of CPU mask copied to user_mask_ptr on success. An
  * error code otherwise.
  */
 SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len,
 		unsigned long __user *, user_mask_ptr)
 {
 	int ret;
 	cpumask_var_t mask;
 
 	if ((len * BITS_PER_BYTE) < nr_cpu_ids)
 		return -EINVAL;
 	if (len & (sizeof(unsigned long)-1))
 		return -EINVAL;
 
 	if (!alloc_cpumask_var(&mask, GFP_KERNEL))
 		return -ENOMEM;
 
 	ret = sched_getaffinity(pid, mask);
 	if (ret == 0) {
 		unsigned int retlen = min(len, cpumask_size());
 
 		if (copy_to_user(user_mask_ptr, mask, retlen))
 			ret = -EFAULT;
 		else
 			ret = retlen;
 	}
 	free_cpumask_var(mask);
 
 	return ret;
 }
 
-/**
- * sys_sched_yield - yield the current processor to other threads.
- *
- * This function yields the current CPU to other tasks. If there are no
- * other threads running on this CPU then this function will return.
- *
- * Return: 0.
- */
 static void do_sched_yield(void)
 {
 	struct rq_flags rf;
 	struct rq *rq;
 
 	rq = this_rq_lock_irq(&rf);
 
 	schedstat_inc(rq->yld_count);
 	current->sched_class->yield_task(rq);
 
 	preempt_disable();
 	rq_unlock_irq(rq, &rf);
 	sched_preempt_enable_no_resched();
 
 	schedule();
 }
 
+/**
+ * sys_sched_yield - yield the current processor to other threads.
+ *
+ * This function yields the current CPU to other tasks. If there are no
+ * other threads running on this CPU then this function will return.
+ *
+ * Return: 0.
+ */
 SYSCALL_DEFINE0(sched_yield)
 {
 	do_sched_yield();
 	return 0;
 }
 
 #ifndef CONFIG_PREEMPTION
 int __sched _cond_resched(void)
 {
 	if (should_resched(0)) {
 		preempt_schedule_common();
 		return 1;
 	}
 	rcu_all_qs();
 	return 0;
 }
 EXPORT_SYMBOL(_cond_resched);
 #endif
 
 /*
  * __cond_resched_lock() - if a reschedule is pending, drop the given lock,
  * call schedule, and on return reacquire the lock.
  *
  * This works OK both with and without CONFIG_PREEMPTION. We do strange low-level
  * operations here to prevent schedule() from being called twice (once via
  * spin_unlock(), once by hand).
  */
 int __cond_resched_lock(spinlock_t *lock)
 {
 	int resched = should_resched(PREEMPT_LOCK_OFFSET);
 	int ret = 0;
 
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e7e21ac479a2..f5dcedacc104 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6301,65 +6301,65 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
 		 * cpuset defines a symmetric island (i.e. one unique
 		 * capacity_orig value through the cpuset), the key will be set
 		 * but the CPUs within that cpuset will not have a domain with
 		 * SD_ASYM_CPUCAPACITY. These should follow the usual symmetric
 		 * capacity path.
 		 */
 		if (sd) {
 			i = select_idle_capacity(p, sd, target);
 			return ((unsigned)i < nr_cpumask_bits) ? i : target;
 		}
 	}
 
 	sd = rcu_dereference(per_cpu(sd_llc, target));
 	if (!sd)
 		return target;
 
 	i = select_idle_core(p, sd, target);
 	if ((unsigned)i < nr_cpumask_bits)
 		return i;
 
 	i = select_idle_cpu(p, sd, target);
 	if ((unsigned)i < nr_cpumask_bits)
 		return i;
 
 	i = select_idle_smt(p, sd, target);
 	if ((unsigned)i < nr_cpumask_bits)
 		return i;
 
 	return target;
 }
 
 /**
- * Amount of capacity of a CPU that is (estimated to be) used by CFS tasks
+ * cpu_util - Estimates the amount of capacity of a CPU used by CFS tasks.
  * @cpu: the CPU to get the utilization of
  *
  * The unit of the return value must be the one of capacity so we can compare
  * the utilization with the capacity of the CPU that is available for CFS task
  * (ie cpu_capacity).
  *
  * cfs_rq.avg.util_avg is the sum of running time of runnable tasks plus the
  * recent utilization of currently non-runnable tasks on a CPU. It represents
  * the amount of utilization of a CPU in the range [0..capacity_orig] where
  * capacity_orig is the cpu_capacity available at the highest frequency
  * (arch_scale_freq_capacity()).
  * The utilization of a CPU converges towards a sum equal to or less than the
  * current capacity (capacity_curr <= capacity_orig) of the CPU because it is
  * the running time on this CPU scaled by capacity_curr.
  *
  * The estimated utilization of a CPU is defined to be the maximum between its
  * cfs_rq.avg.util_avg and the sum of the estimated utilization of the tasks
  * currently RUNNABLE on that CPU.
  * This allows to properly represent the expected utilization of a CPU which
  * has just got a big task running since a long sleep period. At the same time
  * however it preserves the benefits of the "blocked utilization" in
  * describing the potential for other tasks waking up on the same CPU.
  *
  * Nevertheless, cfs_rq.avg.util_avg can be higher than capacity_curr or even
  * higher than capacity_orig because of unfortunate rounding in
  * cfs.avg.util_avg or just after migrating tasks and new task wakeups until
  * the average stabilizes with the new running time. We need to check that the
  * utilization stays within the range of [0..capacity_orig] and cap it if
  * necessary. Without utilization capping, a group could be seen as overloaded
  * (CPU0 utilization at 121% + CPU1 utilization at 80%) whereas CPU1 has 20% of
  * available capacity. We allow utilization to overshoot capacity_curr (but not
  * capacity_orig) as it useful for predicting the capacity required after task
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 14/16] selftests: kselftest_harness.h: partially fix kernel-doc markups
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (12 preceding siblings ...)
  2020-12-01 12:09 ` [PATCH v5 13/16] sched: fix " Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-01 21:17   ` Kees Cook
  2020-12-01 12:09 ` [PATCH v5 15/16] refcount.h: fix a kernel-doc markup Mauro Carvalho Chehab
  2020-12-01 12:09 ` [PATCH v5 16/16] scripts: kernel-doc: validate kernel-doc markup with the actual names Mauro Carvalho Chehab
  15 siblings, 1 reply; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Andy Lutomirski, Kees Cook, Shuah Khan,
	Will Drewry, linux-kernel, linux-kselftest

The kernel-doc markups on this file are weird: they don't
follow what's specified at:

	Documentation/doc-guide/kernel-doc.rst

In particular, markups should use this format:
        identifier - description

and not this:
	identifier(args)

The way the definitions are inside this file cause the
parser to completely miss the identifier name of each
function.

This prevents improving the script to do some needed validation
tests.

Address this part. Yet, furter changes are needed in order
for it to fully follow the specs.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 tools/testing/selftests/kselftest_harness.h | 22 ++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index edce85420d19..99920466076a 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -50,325 +50,325 @@
 #ifndef __KSELFTEST_HARNESS_H
 #define __KSELFTEST_HARNESS_H
 
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
 #include <asm/types.h>
 #include <errno.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
 
 #include "kselftest.h"
 
 #define TEST_TIMEOUT_DEFAULT 30
 
 /* Utilities exposed to the test definitions */
 #ifndef TH_LOG_STREAM
 #  define TH_LOG_STREAM stderr
 #endif
 
 #ifndef TH_LOG_ENABLED
 #  define TH_LOG_ENABLED 1
 #endif
 
 /**
- * TH_LOG(fmt, ...)
+ * TH_LOG()
  *
  * @fmt: format string
  * @...: optional arguments
  *
  * .. code-block:: c
  *
  *     TH_LOG(format, ...)
  *
  * Optional debug logging function available for use in tests.
  * Logging may be enabled or disabled by defining TH_LOG_ENABLED.
  * E.g., #define TH_LOG_ENABLED 1
  *
  * If no definition is provided, logging is enabled by default.
  *
  * If there is no way to print an error message for the process running the
  * test (e.g. not allowed to write to stderr), it is still possible to get the
  * ASSERT_* number for which the test failed.  This behavior can be enabled by
  * writing `_metadata->no_print = true;` before the check sequence that is
  * unable to print.  When an error occur, instead of printing an error message
  * and calling `abort(3)`, the test process call `_exit(2)` with the assert
  * number as argument, which is then printed by the parent process.
  */
 #define TH_LOG(fmt, ...) do { \
 	if (TH_LOG_ENABLED) \
 		__TH_LOG(fmt, ##__VA_ARGS__); \
 } while (0)
 
 /* Unconditional logger for internal use. */
 #define __TH_LOG(fmt, ...) \
 		fprintf(TH_LOG_STREAM, "# %s:%d:%s:" fmt "\n", \
 			__FILE__, __LINE__, _metadata->name, ##__VA_ARGS__)
 
 /**
- * SKIP(statement, fmt, ...)
+ * SKIP()
  *
  * @statement: statement to run after reporting SKIP
  * @fmt: format string
  * @...: optional arguments
  *
  * This forces a "pass" after reporting why something is being skipped
  * and runs "statement", which is usually "return" or "goto skip".
  */
 #define SKIP(statement, fmt, ...) do { \
 	snprintf(_metadata->results->reason, \
 		 sizeof(_metadata->results->reason), fmt, ##__VA_ARGS__); \
 	if (TH_LOG_ENABLED) { \
 		fprintf(TH_LOG_STREAM, "#      SKIP      %s\n", \
 			_metadata->results->reason); \
 	} \
 	_metadata->passed = 1; \
 	_metadata->skip = 1; \
 	_metadata->trigger = 0; \
 	statement; \
 } while (0)
 
 /**
- * TEST(test_name) - Defines the test function and creates the registration
+ * TEST() - Defines the test function and creates the registration
  * stub
  *
  * @test_name: test name
  *
  * .. code-block:: c
  *
  *     TEST(name) { implementation }
  *
  * Defines a test by name.
  * Names must be unique and tests must not be run in parallel.  The
  * implementation containing block is a function and scoping should be treated
  * as such.  Returning early may be performed with a bare "return;" statement.
  *
  * EXPECT_* and ASSERT_* are valid in a TEST() { } context.
  */
 #define TEST(test_name) __TEST_IMPL(test_name, -1)
 
 /**
- * TEST_SIGNAL(test_name, signal)
+ * TEST_SIGNAL()
  *
  * @test_name: test name
  * @signal: signal number
  *
  * .. code-block:: c
  *
  *     TEST_SIGNAL(name, signal) { implementation }
  *
  * Defines a test by name and the expected term signal.
  * Names must be unique and tests must not be run in parallel.  The
  * implementation containing block is a function and scoping should be treated
  * as such.  Returning early may be performed with a bare "return;" statement.
  *
  * EXPECT_* and ASSERT_* are valid in a TEST() { } context.
  */
 #define TEST_SIGNAL(test_name, signal) __TEST_IMPL(test_name, signal)
 
 #define __TEST_IMPL(test_name, _signal) \
 	static void test_name(struct __test_metadata *_metadata); \
 	static inline void wrapper_##test_name( \
 		struct __test_metadata *_metadata, \
 		struct __fixture_variant_metadata *variant) \
 	{ \
 		test_name(_metadata); \
 	} \
 	static struct __test_metadata _##test_name##_object = \
 		{ .name = #test_name, \
 		  .fn = &wrapper_##test_name, \
 		  .fixture = &_fixture_global, \
 		  .termsig = _signal, \
 		  .timeout = TEST_TIMEOUT_DEFAULT, }; \
 	static void __attribute__((constructor)) _register_##test_name(void) \
 	{ \
 		__register_test(&_##test_name##_object); \
 	} \
 	static void test_name( \
 		struct __test_metadata __attribute__((unused)) *_metadata)
 
 /**
- * FIXTURE_DATA(datatype_name) - Wraps the struct name so we have one less
+ * FIXTURE_DATA() - Wraps the struct name so we have one less
  * argument to pass around
  *
  * @datatype_name: datatype name
  *
  * .. code-block:: c
  *
  *     FIXTURE_DATA(datatype_name)
  *
  * Almost always, you want just FIXTURE() instead (see below).
  * This call may be used when the type of the fixture data
  * is needed.  In general, this should not be needed unless
  * the *self* is being passed to a helper directly.
  */
 #define FIXTURE_DATA(datatype_name) struct _test_data_##datatype_name
 
 /**
- * FIXTURE(fixture_name) - Called once per fixture to setup the data and
+ * FIXTURE() - Called once per fixture to setup the data and
  * register
  *
  * @fixture_name: fixture name
  *
  * .. code-block:: c
  *
  *     FIXTURE(fixture_name) {
  *       type property1;
  *       ...
  *     };
  *
  * Defines the data provided to TEST_F()-defined tests as *self*.  It should be
  * populated and cleaned up using FIXTURE_SETUP() and FIXTURE_TEARDOWN().
  */
 #define FIXTURE(fixture_name) \
 	FIXTURE_VARIANT(fixture_name); \
 	static struct __fixture_metadata _##fixture_name##_fixture_object = \
 		{ .name =  #fixture_name, }; \
 	static void __attribute__((constructor)) \
 	_register_##fixture_name##_data(void) \
 	{ \
 		__register_fixture(&_##fixture_name##_fixture_object); \
 	} \
 	FIXTURE_DATA(fixture_name)
 
 /**
- * FIXTURE_SETUP(fixture_name) - Prepares the setup function for the fixture.
+ * FIXTURE_SETUP() - Prepares the setup function for the fixture.
  * *_metadata* is included so that EXPECT_* and ASSERT_* work correctly.
  *
  * @fixture_name: fixture name
  *
  * .. code-block:: c
  *
  *     FIXTURE_SETUP(fixture_name) { implementation }
  *
  * Populates the required "setup" function for a fixture.  An instance of the
  * datatype defined with FIXTURE_DATA() will be exposed as *self* for the
  * implementation.
  *
  * ASSERT_* are valid for use in this context and will prempt the execution
  * of any dependent fixture tests.
  *
  * A bare "return;" statement may be used to return early.
  */
 #define FIXTURE_SETUP(fixture_name) \
 	void fixture_name##_setup( \
 		struct __test_metadata __attribute__((unused)) *_metadata, \
 		FIXTURE_DATA(fixture_name) __attribute__((unused)) *self, \
 		const FIXTURE_VARIANT(fixture_name) \
 			__attribute__((unused)) *variant)
 
 /**
- * FIXTURE_TEARDOWN(fixture_name)
+ * FIXTURE_TEARDOWN()
  * *_metadata* is included so that EXPECT_* and ASSERT_* work correctly.
  *
  * @fixture_name: fixture name
  *
  * .. code-block:: c
  *
  *     FIXTURE_TEARDOWN(fixture_name) { implementation }
  *
  * Populates the required "teardown" function for a fixture.  An instance of the
  * datatype defined with FIXTURE_DATA() will be exposed as *self* for the
  * implementation to clean up.
  *
  * A bare "return;" statement may be used to return early.
  */
 #define FIXTURE_TEARDOWN(fixture_name) \
 	void fixture_name##_teardown( \
 		struct __test_metadata __attribute__((unused)) *_metadata, \
 		FIXTURE_DATA(fixture_name) __attribute__((unused)) *self)
 
 /**
- * FIXTURE_VARIANT(fixture_name) - Optionally called once per fixture
+ * FIXTURE_VARIANT() - Optionally called once per fixture
  * to declare fixture variant
  *
  * @fixture_name: fixture name
  *
  * .. code-block:: c
  *
  *     FIXTURE_VARIANT(fixture_name) {
  *       type property1;
  *       ...
  *     };
  *
  * Defines type of constant parameters provided to FIXTURE_SETUP() and TEST_F()
  * as *variant*. Variants allow the same tests to be run with different
  * arguments.
  */
 #define FIXTURE_VARIANT(fixture_name) struct _fixture_variant_##fixture_name
 
 /**
- * FIXTURE_VARIANT_ADD(fixture_name, variant_name) - Called once per fixture
+ * FIXTURE_VARIANT_ADD() - Called once per fixture
  * variant to setup and register the data
  *
  * @fixture_name: fixture name
  * @variant_name: name of the parameter set
  *
  * .. code-block:: c
  *
  *     FIXTURE_VARIANT_ADD(fixture_name, variant_name) {
  *       .property1 = val1,
  *       ...
  *     };
  *
  * Defines a variant of the test fixture, provided to FIXTURE_SETUP() and
  * TEST_F() as *variant*. Tests of each fixture will be run once for each
  * variant.
  */
 #define FIXTURE_VARIANT_ADD(fixture_name, variant_name) \
 	extern FIXTURE_VARIANT(fixture_name) \
 		_##fixture_name##_##variant_name##_variant; \
 	static struct __fixture_variant_metadata \
 		_##fixture_name##_##variant_name##_object = \
 		{ .name = #variant_name, \
 		  .data = &_##fixture_name##_##variant_name##_variant}; \
 	static void __attribute__((constructor)) \
 		_register_##fixture_name##_##variant_name(void) \
 	{ \
 		__register_fixture_variant(&_##fixture_name##_fixture_object, \
 			&_##fixture_name##_##variant_name##_object);	\
 	} \
 	FIXTURE_VARIANT(fixture_name) \
 		_##fixture_name##_##variant_name##_variant =
 
 /**
- * TEST_F(fixture_name, test_name) - Emits test registration and helpers for
+ * TEST_F() - Emits test registration and helpers for
  * fixture-based test cases
  *
  * @fixture_name: fixture name
  * @test_name: test name
  *
  * .. code-block:: c
  *
  *     TEST_F(fixture, name) { implementation }
  *
  * Defines a test that depends on a fixture (e.g., is part of a test case).
  * Very similar to TEST() except that *self* is the setup instance of fixture's
  * datatype exposed for use by the implementation.
  *
  * Warning: use of ASSERT_* here will skip TEARDOWN.
  */
 /* TODO(wad) register fixtures on dedicated test lists. */
 #define TEST_F(fixture_name, test_name) \
 	__TEST_F_IMPL(fixture_name, test_name, -1, TEST_TIMEOUT_DEFAULT)
 
 #define TEST_F_SIGNAL(fixture_name, test_name, signal) \
 	__TEST_F_IMPL(fixture_name, test_name, signal, TEST_TIMEOUT_DEFAULT)
 
 #define TEST_F_TIMEOUT(fixture_name, test_name, timeout) \
 	__TEST_F_IMPL(fixture_name, test_name, -1, timeout)
 
 #define __TEST_F_IMPL(fixture_name, test_name, signal, tmout) \
 	static void fixture_name##_##test_name( \
 		struct __test_metadata *_metadata, \
 		FIXTURE_DATA(fixture_name) *self, \
 		const FIXTURE_VARIANT(fixture_name) *variant); \
 	static inline void wrapper_##fixture_name##_##test_name( \
 		struct __test_metadata *_metadata, \
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 15/16] refcount.h: fix a kernel-doc markup
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (13 preceding siblings ...)
  2020-12-01 12:09 ` [PATCH v5 14/16] selftests: kselftest_harness.h: partially fix kernel-doc markups Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-01 21:17   ` Kees Cook
  2020-12-02  8:14   ` Peter Zijlstra
  2020-12-01 12:09 ` [PATCH v5 16/16] scripts: kernel-doc: validate kernel-doc markup with the actual names Mauro Carvalho Chehab
  15 siblings, 2 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Jann Horn, Kees Cook, Peter Zijlstra,
	Will Deacon, linux-kernel

The kernel-doc markup is wrong: it is asking the tool to document
struct refcount_struct, instead of documenting typedef refcount_t.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 include/linux/refcount.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index 497990c69b0b..b8a6e387f8f9 100644
--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -72,65 +72,65 @@
  * Do note that inc_not_zero() provides a control dependency which will order
  * future stores against the inc, this ensures we'll never modify the object
  * if we did not in fact acquire a reference.
  *
  * The decrements will provide release order, such that all the prior loads and
  * stores will be issued before, it also provides a control dependency, which
  * will order us against the subsequent free().
  *
  * The control dependency is against the load of the cmpxchg (ll/sc) that
  * succeeded. This means the stores aren't fully ordered, but this is fine
  * because the 1->0 transition indicates no concurrency.
  *
  * Note that the allocator is responsible for ordering things between free()
  * and alloc().
  *
  * The decrements dec_and_test() and sub_and_test() also provide acquire
  * ordering on success.
  *
  */
 
 #ifndef _LINUX_REFCOUNT_H
 #define _LINUX_REFCOUNT_H
 
 #include <linux/atomic.h>
 #include <linux/bug.h>
 #include <linux/compiler.h>
 #include <linux/limits.h>
 #include <linux/spinlock_types.h>
 
 struct mutex;
 
 /**
- * struct refcount_t - variant of atomic_t specialized for reference counts
+ * typedef refcount_t - variant of atomic_t specialized for reference counts
  * @refs: atomic_t counter field
  *
  * The counter saturates at REFCOUNT_SATURATED and will not move once
  * there. This avoids wrapping the counter and causing 'spurious'
  * use-after-free bugs.
  */
 typedef struct refcount_struct {
 	atomic_t refs;
 } refcount_t;
 
 #define REFCOUNT_INIT(n)	{ .refs = ATOMIC_INIT(n), }
 #define REFCOUNT_MAX		INT_MAX
 #define REFCOUNT_SATURATED	(INT_MIN / 2)
 
 enum refcount_saturation_type {
 	REFCOUNT_ADD_NOT_ZERO_OVF,
 	REFCOUNT_ADD_OVF,
 	REFCOUNT_ADD_UAF,
 	REFCOUNT_SUB_UAF,
 	REFCOUNT_DEC_LEAK,
 };
 
 void refcount_warn_saturate(refcount_t *r, enum refcount_saturation_type t);
 
 /**
  * refcount_set - set a refcount's value
  * @r: the refcount
  * @n: value to which the refcount will be set
  */
 static inline void refcount_set(refcount_t *r, int n)
 {
 	atomic_set(&r->refs, n);
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH v5 16/16] scripts: kernel-doc: validate kernel-doc markup with the actual names
  2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
                   ` (14 preceding siblings ...)
  2020-12-01 12:09 ` [PATCH v5 15/16] refcount.h: fix a kernel-doc markup Mauro Carvalho Chehab
@ 2020-12-01 12:09 ` Mauro Carvalho Chehab
  2020-12-01 15:06   ` kernel test robot
  2020-12-01 15:25   ` kernel test robot
  15 siblings, 2 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 12:09 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, linux-kernel

Kernel-doc currently expects that the kernel-doc markup to come
just before the function/enum/struct/union/typedef prototype.

Yet, if it find things like:

	/**
	 * refcount_add - add a value to a refcount
	 * @i: the value to add to the refcount
	 * @r: the refcount
	 */
	static inline void __refcount_add(int i, refcount_t *r, int *oldp);
	static inline void refcount_add(int i, refcount_t *r);

Kernel-doc will do the wrong thing:

	foobar.h:6: warning: Function parameter or member 'oldp' not described in '__refcount_add'
	.. c:function:: void __refcount_add (int i, refcount_t *r, int *oldp)

	   add a value to a refcount

	**Parameters**

	``int i``
	  the value to add to the refcount

	``refcount_t *r``
	  the refcount

	``int *oldp``
	  *undescribed*

Basically, it will document "__refcount_add" with the kernel-doc
markup for refcount_add.

If both functions have the same arguments, this won't even
produce any warning!

Add a logic to check if the kernel-doc identifier matches the actual
name of the C function or data structure that will be documented.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 scripts/kernel-doc | 62 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 46 insertions(+), 16 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 9b6ddeb097e9..919acae23fad 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -353,64 +353,67 @@ my $lineprefix="";
 
 # Parser states
 use constant {
     STATE_NORMAL        => 0,        # normal code
     STATE_NAME          => 1,        # looking for function name
     STATE_BODY_MAYBE    => 2,        # body - or maybe more description
     STATE_BODY          => 3,        # the body of the comment
     STATE_BODY_WITH_BLANK_LINE => 4, # the body, which has a blank line
     STATE_PROTO         => 5,        # scanning prototype
     STATE_DOCBLOCK      => 6,        # documentation block
     STATE_INLINE        => 7,        # gathering doc outside main block
 };
 my $state;
 my $in_doc_sect;
 my $leading_space;
 
 # Inline documentation state
 use constant {
     STATE_INLINE_NA     => 0, # not applicable ($state != STATE_INLINE)
     STATE_INLINE_NAME   => 1, # looking for member name (@foo:)
     STATE_INLINE_TEXT   => 2, # looking for member documentation
     STATE_INLINE_END    => 3, # done
     STATE_INLINE_ERROR  => 4, # error - Comment without header was found.
                               # Spit a warning as it's not
                               # proper kernel-doc and ignore the rest.
 };
 my $inline_doc_state;
 
 #declaration types: can be
 # 'function', 'struct', 'union', 'enum', 'typedef'
 my $decl_type;
 
+# Name of the kernel-doc identifier for non-DOC markups
+my $identifier;
+
 my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.
 my $doc_end = '\*/';
 my $doc_com = '\s*\*\s*';
 my $doc_com_body = '\s*\* ?';
 my $doc_decl = $doc_com . '(\w+)';
 # @params and a strictly limited set of supported section names
 my $doc_sect = $doc_com .
     '\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:(.*)';
 my $doc_content = $doc_com_body . '(.*)';
 my $doc_block = $doc_com . 'DOC:\s*(.*)?';
 my $doc_inline_start = '^\s*/\*\*\s*$';
 my $doc_inline_sect = '\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)';
 my $doc_inline_end = '^\s*\*/\s*$';
 my $doc_inline_oneline = '^\s*/\*\*\s*(@[\w\s]+):\s*(.*)\s*\*/\s*$';
 my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;';
 
 my %parameterdescs;
 my %parameterdesc_start_lines;
 my @parameterlist;
 my %sections;
 my @sectionlist;
 my %section_start_lines;
 my $sectcheck;
 my $struct_actual;
 
 my $contents = "";
 my $new_start_line = 0;
 
 # the canonical section names. see also $doc_sect above.
 my $section_default = "Description";	# default section
 my $section_intro = "Introduction";
 my $section = $section_default;
@@ -1174,64 +1177,69 @@ sub output_declaration {
 ##
 # generic output function - calls the right one based on current output mode.
 sub output_blockhead {
     no strict 'refs';
     my $func = "output_blockhead_" . $output_mode;
     &$func(@_);
     $section_counter++;
 }
 
 ##
 # takes a declaration (struct, union, enum, typedef) and
 # invokes the right handler. NOT called for functions.
 sub dump_declaration($$) {
     no strict 'refs';
     my ($prototype, $file) = @_;
     my $func = "dump_" . $decl_type;
     &$func(@_);
 }
 
 sub dump_union($$) {
     dump_struct(@_);
 }
 
 sub dump_struct($$) {
     my $x = shift;
     my $file = shift;
 
     if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|____cacheline_aligned_in_smp|____cacheline_aligned|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/) {
 	my $decl_type = $1;
 	$declaration_name = $2;
 	my $members = $3;
 
+	if ($identifier ne $declaration_name) {
+	    print STDERR "${file}:$.: warning: expecting prototype for $decl_type $identifier. Prototype was for $decl_type $declaration_name instead\n";
+	    return;
+	}
+
 	# ignore members marked private:
 	$members =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gosi;
 	$members =~ s/\/\*\s*private:.*//gosi;
 	# strip comments:
 	$members =~ s/\/\*.*?\*\///gos;
 	# strip attributes
 	$members =~ s/\s*__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)/ /gi;
 	$members =~ s/\s*__aligned\s*\([^;]*\)/ /gos;
 	$members =~ s/\s*__packed\s*/ /gos;
 	$members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos;
 	$members =~ s/\s*____cacheline_aligned_in_smp/ /gos;
 	$members =~ s/\s*____cacheline_aligned/ /gos;
 
 	# replace DECLARE_BITMAP
 	$members =~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos;
 	$members =~ s/DECLARE_BITMAP\s*\(([^,)]+),\s*([^,)]+)\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos;
 	# replace DECLARE_HASHTABLE
 	$members =~ s/DECLARE_HASHTABLE\s*\(([^,)]+),\s*([^,)]+)\)/unsigned long $1\[1 << (($2) - 1)\]/gos;
 	# replace DECLARE_KFIFO
 	$members =~ s/DECLARE_KFIFO\s*\(([^,)]+),\s*([^,)]+),\s*([^,)]+)\)/$2 \*$1/gos;
 	# replace DECLARE_KFIFO_PTR
 	$members =~ s/DECLARE_KFIFO_PTR\s*\(([^,)]+),\s*([^,)]+)\)/$2 \*$1/gos;
 
 	my $declaration = $members;
 
 	# Split nested struct/union elements as newer ones
 	while ($members =~ m/(struct|union)([^\{\};]+)\{([^\{\}]*)\}([^\{\}\;]*)\;/) {
 		my $newmember;
 		my $maintype = $1;
 		my $ids = $4;
 		my $content = $3;
 		foreach my $id(split /,/, $ids) {
@@ -1362,150 +1370,165 @@ sub show_warnings($$) {
 			return 0;
 		}
 	}
 	if ($output_selection == OUTPUT_INCLUDE) {
 		if (defined($function_table{$name})) {
 			return 1;
 		} else {
 			return 0;
 		}
 	}
 	die("Please add the new output type at show_warnings()");
 }
 
 sub dump_enum($$) {
     my $x = shift;
     my $file = shift;
     my $members;
 
 
     $x =~ s@/\*.*?\*/@@gos;	# strip comments.
     # strip #define macros inside enums
     $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
 
     if ($x =~ /typedef\s+enum\s*\{(.*)\}\s*(\w*)\s*;/) {
 	$declaration_name = $2;
 	$members = $1;
     } elsif ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) {
 	$declaration_name = $1;
 	$members = $2;
     }
 
     if ($members) {
+	if ($identifier ne $declaration_name) {
+	    print STDERR "${file}:$.: warning: expecting prototype for enum $identifier. Prototype was for enum $declaration_name instead\n";
+	    return;
+	}
+
 	my %_members;
 
 	$members =~ s/\s+$//;
 
 	foreach my $arg (split ',', $members) {
 	    $arg =~ s/^\s*(\w+).*/$1/;
 	    push @parameterlist, $arg;
 	    if (!$parameterdescs{$arg}) {
 		$parameterdescs{$arg} = $undescribed;
 	        if (show_warnings("enum", $declaration_name)) {
 			print STDERR "${file}:$.: warning: Enum value '$arg' not described in enum '$declaration_name'\n";
 		}
 	    }
 	    $_members{$arg} = 1;
 	}
 
 	while (my ($k, $v) = each %parameterdescs) {
 	    if (!exists($_members{$k})) {
 	        if (show_warnings("enum", $declaration_name)) {
 		     print STDERR "${file}:$.: warning: Excess enum value '$k' description in '$declaration_name'\n";
 		}
 	    }
         }
 
 	output_declaration($declaration_name,
 			   'enum',
 			   {'enum' => $declaration_name,
 			    'module' => $modulename,
 			    'parameterlist' => \@parameterlist,
 			    'parameterdescs' => \%parameterdescs,
 			    'sectionlist' => \@sectionlist,
 			    'sections' => \%sections,
 			    'purpose' => $declaration_purpose
 			   });
     } else {
 	print STDERR "${file}:$.: error: Cannot parse enum!\n";
 	++$errors;
     }
 }
 
 my $typedef_type = qr { ((?:\s+[\w\*]+){1,8})\s* }x;
 my $typedef_ident = qr { \*?\s*(\w\S+)\s* }x;
 my $typedef_args = qr { \s*\((.*)\); }x;
 
 my $typedef1 = qr { typedef$typedef_type\($typedef_ident\)$typedef_args }x;
 my $typedef2 = qr { typedef$typedef_type$typedef_ident$typedef_args }x;
 
 sub dump_typedef($$) {
     my $x = shift;
     my $file = shift;
 
     $x =~ s@/\*.*?\*/@@gos;	# strip comments.
 
     # Parse function typedef prototypes
     if ($x =~ $typedef1 || $x =~ $typedef2) {
 	$return_type = $1;
 	$declaration_name = $2;
 	my $args = $3;
 	$return_type =~ s/^\s+//;
 
+	if ($identifier ne $declaration_name) {
+	    print STDERR "${file}:$.: warning: expecting prototype for typedef $identifier. Prototype was for typedef $declaration_name instead\n";
+	    return;
+	}
+
 	create_parameterlist($args, ',', $file, $declaration_name);
 
 	output_declaration($declaration_name,
 			   'function',
 			   {'function' => $declaration_name,
 			    'typedef' => 1,
 			    'module' => $modulename,
 			    'functiontype' => $return_type,
 			    'parameterlist' => \@parameterlist,
 			    'parameterdescs' => \%parameterdescs,
 			    'parametertypes' => \%parametertypes,
 			    'sectionlist' => \@sectionlist,
 			    'sections' => \%sections,
 			    'purpose' => $declaration_purpose
 			   });
 	return;
     }
 
     while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) {
 	$x =~ s/\(*.\)\s*;$/;/;
 	$x =~ s/\[*.\]\s*;$/;/;
     }
 
     if ($x =~ /typedef.*\s+(\w+)\s*;/) {
 	$declaration_name = $1;
 
+	if ($identifier ne $declaration_name) {
+	    print STDERR "${file}:$.: warning: expecting prototype for typedef $identifier. Prototype was for typedef $declaration_name instead\n";
+	    return;
+	}
+
 	output_declaration($declaration_name,
 			   'typedef',
 			   {'typedef' => $declaration_name,
 			    'module' => $modulename,
 			    'sectionlist' => \@sectionlist,
 			    'sections' => \%sections,
 			    'purpose' => $declaration_purpose
 			   });
     }
     else {
 	print STDERR "${file}:$.: error: Cannot parse typedef!\n";
 	++$errors;
     }
 }
 
 sub save_struct_actual($) {
     my $actual = shift;
 
     # strip all spaces from the actual param so that it looks like one string item
     $actual =~ s/\s*//g;
     $struct_actual = $struct_actual . $actual . " ";
 }
 
 sub create_parameterlist($$$$) {
     my $args = shift;
     my $splitter = shift;
     my $file = shift;
     my $declaration_name = shift;
     my $type;
     my $param;
 
     # temporarily replace commas inside function pointer definition
@@ -1767,64 +1790,69 @@ sub dump_function($$) {
         # Function-like macros are not allowed to have spaces between
         # declaration_name and opening parenthesis (notice the \s+).
         $return_type = $1;
         $declaration_name = $2;
         $noret = 1;
     } elsif ($prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
 	$prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
 	$prototype =~ m/^(\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
 	$prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
 	$prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
 	$prototype =~ m/^(\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+\s+\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+\s+\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
 	$prototype =~ m/^(\w+\s+\w+\s*\*+\s*\w+\s*\*+\s*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/)  {
 	$return_type = $1;
 	$declaration_name = $2;
 	my $args = $3;
 
 	create_parameterlist($args, ',', $file, $declaration_name);
     } else {
 	print STDERR "${file}:$.: warning: cannot understand function prototype: '$prototype'\n";
 	return;
     }
 
+    if ($identifier ne $declaration_name) {
+	print STDERR "${file}:$.: warning: expecting prototype for $identifier(). Prototype was for $declaration_name() instead\n";
+	return;
+    }
+
     my $prms = join " ", @parameterlist;
     check_sections($file, $declaration_name, "function", $sectcheck, $prms);
 
     # This check emits a lot of warnings at the moment, because many
     # functions don't have a 'Return' doc section. So until the number
     # of warnings goes sufficiently down, the check is only performed in
     # verbose mode.
     # TODO: always perform the check.
     if ($verbose && !$noret) {
 	    check_return_section($file, $declaration_name, $return_type);
     }
 
     # The function parser can be called with a typedef parameter.
     # Handle it.
     if ($return_type =~ /typedef/) {
 	output_declaration($declaration_name,
 			   'function',
 			   {'function' => $declaration_name,
 			    'typedef' => 1,
 			    'module' => $modulename,
 			    'functiontype' => $return_type,
 			    'parameterlist' => \@parameterlist,
 			    'parameterdescs' => \%parameterdescs,
 			    'parametertypes' => \%parametertypes,
 			    'sectionlist' => \@sectionlist,
 			    'sections' => \%sections,
 			    'purpose' => $declaration_purpose
 			   });
     } else {
 	output_declaration($declaration_name,
 			   'function',
 			   {'function' => $declaration_name,
@@ -1849,64 +1877,65 @@ sub reset_state {
     @sectionlist = ();
     $sectcheck = "";
     $struct_actual = "";
     $prototype = "";
 
     $state = STATE_NORMAL;
     $inline_doc_state = STATE_INLINE_NA;
 }
 
 sub tracepoint_munge($) {
 	my $file = shift;
 	my $tracepointname = 0;
 	my $tracepointargs = 0;
 
 	if ($prototype =~ m/TRACE_EVENT\((.*?),/) {
 		$tracepointname = $1;
 	}
 	if ($prototype =~ m/DEFINE_SINGLE_EVENT\((.*?),/) {
 		$tracepointname = $1;
 	}
 	if ($prototype =~ m/DEFINE_EVENT\((.*?),(.*?),/) {
 		$tracepointname = $2;
 	}
 	$tracepointname =~ s/^\s+//; #strip leading whitespace
 	if ($prototype =~ m/TP_PROTO\((.*?)\)/) {
 		$tracepointargs = $1;
 	}
 	if (($tracepointname eq 0) || ($tracepointargs eq 0)) {
 		print STDERR "${file}:$.: warning: Unrecognized tracepoint format: \n".
 			     "$prototype\n";
 	} else {
 		$prototype = "static inline void trace_$tracepointname($tracepointargs)";
+		$identifier = "trace_$identifier";
 	}
 }
 
 sub syscall_munge() {
 	my $void = 0;
 
 	$prototype =~ s@[\r\n]+@ @gos; # strip newlines/CR's
 ##	if ($prototype =~ m/SYSCALL_DEFINE0\s*\(\s*(a-zA-Z0-9_)*\s*\)/) {
 	if ($prototype =~ m/SYSCALL_DEFINE0/) {
 		$void = 1;
 ##		$prototype = "long sys_$1(void)";
 	}
 
 	$prototype =~ s/SYSCALL_DEFINE.*\(/long sys_/; # fix return type & func name
 	if ($prototype =~ m/long (sys_.*?),/) {
 		$prototype =~ s/,/\(/;
 	} elsif ($void) {
 		$prototype =~ s/\)/\(void\)/;
 	}
 
 	# now delete all of the odd-number commas in $prototype
 	# so that arg types & arg names don't have a comma between them
 	my $count = 0;
 	my $len = length($prototype);
 	if ($void) {
 		$len = 0;	# skip the for-loop
 	}
 	for (my $ix = 0; $ix < $len; $ix++) {
 		if (substr($prototype, $ix, 1) eq ',') {
 			$count++;
 			if ($count % 2 == 1) {
 				substr($prototype, $ix, 1) = ' ';
@@ -2012,122 +2041,123 @@ sub process_export_file($) {
 	++$errors;
 	return;
     }
 
     while (<IN>) {
 	if (/$export_symbol/) {
 	    next if (defined($nosymbol_table{$2}));
 	    $function_table{$2} = 1;
 	}
     }
 
     close(IN);
 }
 
 #
 # Parsers for the various processing states.
 #
 # STATE_NORMAL: looking for the /** to begin everything.
 #
 sub process_normal() {
     if (/$doc_start/o) {
 	$state = STATE_NAME;	# next line is always the function name
 	$in_doc_sect = 0;
 	$declaration_start_line = $. + 1;
     }
 }
 
 #
 # STATE_NAME: Looking for the "name - description" line
 #
 sub process_name($$) {
     my $file = shift;
-    my $identifier;
     my $descr;
 
     if (/$doc_block/o) {
 	$state = STATE_DOCBLOCK;
 	$contents = "";
 	$new_start_line = $.;
 
 	if ( $1 eq "" ) {
 	    $section = $section_intro;
 	} else {
 	    $section = $1;
 	}
-    }
-    elsif (/$doc_decl/o) {
+    } elsif (/$doc_decl/o) {
 	$identifier = $1;
-	if (/\s*([\w\s]+?)(\(\))?\s*-/) {
+	if (/\s*([\w\s]+?)(\(\))?\s*([-:].*)?$/) {
 	    $identifier = $1;
 	}
+	if ($identifier =~ m/^(struct|union|enum|typedef)\b\s*(\S*)/) {
+	    $decl_type = $1;
+	    $identifier = $2;
+	} else {
+	    $decl_type = 'function';
+	    $identifier =~ s/^define\s+//;
+	}
+	$identifier =~ s/\s+$//;
 
 	$state = STATE_BODY;
 	# if there's no @param blocks need to set up default section
 	# here
 	$contents = "";
 	$section = $section_default;
 	$new_start_line = $. + 1;
-	if (/-(.*)/) {
+	if (/[-:](.*)/) {
 	    # strip leading/trailing/multiple spaces
 	    $descr= $1;
 	    $descr =~ s/^\s*//;
 	    $descr =~ s/\s*$//;
 	    $descr =~ s/\s+/ /g;
 	    $declaration_purpose = $descr;
 	    $state = STATE_BODY_MAYBE;
 	} else {
 	    $declaration_purpose = "";
 	}
 
 	if (($declaration_purpose eq "") && $verbose) {
 	    print STDERR "${file}:$.: warning: missing initial short description on line:\n";
 	    print STDERR $_;
 	    ++$warnings;
 	}
 
-	if ($identifier =~ m/^struct\b/) {
-	    $decl_type = 'struct';
-	} elsif ($identifier =~ m/^union\b/) {
-	    $decl_type = 'union';
-	} elsif ($identifier =~ m/^enum\b/) {
-	    $decl_type = 'enum';
-	} elsif ($identifier =~ m/^typedef\b/) {
-	    $decl_type = 'typedef';
-	} else {
-	    $decl_type = 'function';
+	if ($identifier eq "") {
+	    print STDERR "${file}:$.: warning: wrong kernel-doc identifier on line:\n";
+	    print STDERR $_;
+	    ++$warnings;
+	    $state = STATE_NORMAL;
 	}
 
 	if ($verbose) {
-	    print STDERR "${file}:$.: info: Scanning doc for $identifier\n";
+	    print STDERR "${file}:$.: info: Scanning doc for $decl_type $identifier\n";
 	}
     } else {
 	print STDERR "${file}:$.: warning: Cannot understand $_ on line $.",
 	    " - I thought it was a doc line\n";
 	++$warnings;
 	$state = STATE_NORMAL;
     }
 }
 
 
 #
 # STATE_BODY and STATE_BODY_MAYBE: the bulk of a kerneldoc comment.
 #
 sub process_body($$) {
     my $file = shift;
 
     # Until all named variable macro parameters are
     # documented using the bare name (`x`) rather than with
     # dots (`x...`), strip the dots:
     if ($section =~ /\w\.\.\.$/) {
 	$section =~ s/\.\.\.$//;
 
 	if ($verbose) {
 	    print STDERR "${file}:$.: warning: Variable macro arguments should be documented without dots\n";
 	    ++$warnings;
 	}
     }
 
     if ($state == STATE_BODY_WITH_BLANK_LINE && /^\s*\*\s?\S/) {
 	dump_section($file, $section, $contents);
 	$section = $section_default;
 	$new_start_line = $.;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 05/16] fs: fix kernel-doc markups
  2020-12-01 12:08 ` [PATCH v5 05/16] fs: fix kernel-doc markups Mauro Carvalho Chehab
@ 2020-12-01 12:43   ` Christoph Hellwig
  2020-12-01 14:06     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 31+ messages in thread
From: Christoph Hellwig @ 2020-12-01 12:43 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Jonathan Corbet, Alexander Viro,
	linux-fsdevel, linux-kernel

On Tue, Dec 01, 2020 at 01:08:58PM +0100, Mauro Carvalho Chehab wrote:
> Two markups are at the wrong place. Kernel-doc only
> support having the comment just before the identifier.
> 
> Also, some identifiers have different names between their
> prototypes and the kernel-doc markup.

This patch looks really weird, having 30-ish unchanged lines as the
unified diff context.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 07/16] completion: drop init_completion define
  2020-12-01 12:09 ` [PATCH v5 07/16] completion: drop init_completion define Mauro Carvalho Chehab
@ 2020-12-01 12:54   ` Peter Zijlstra
  2020-12-01 14:03     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 31+ messages in thread
From: Peter Zijlstra @ 2020-12-01 12:54 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Jonathan Corbet, Joel Fernandes (Google),
	Davidlohr Bueso, Greg Kroah-Hartman, Ingo Molnar,
	Thomas Gleixner, linux-kernel

On Tue, Dec 01, 2020 at 01:09:00PM +0100, Mauro Carvalho Chehab wrote:
> Changeset cd8084f91c02 ("locking/lockdep: Apply crossrelease to completions")
> added a CONFIG_LOCKDEP_COMPLETE (that was later renamed to
> CONFIG_LOCKDEP_COMPLETIONS).
> 
> Such changeset renamed the init_completion, and add a macro
> that would either run a modified version or the original code.
> 
> However, such code reported too many false positives. So, it
> ended being dropped later on by
> changeset e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks").
> 
> Yet, the define remained there as just:
> 
> 	 #define init_completion(x) __init_completion(x)
> 
> Get rid of the define, and return __init_completion() function
> to its original name.
> 
> Fixes: e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks")
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---

Your patch is weird, did you add -C 1000 or something?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 07/16] completion: drop init_completion define
  2020-12-01 12:54   ` Peter Zijlstra
@ 2020-12-01 14:03     ` Mauro Carvalho Chehab
  2020-12-02  8:13       ` Peter Zijlstra
  0 siblings, 1 reply; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 14:03 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Linux Doc Mailing List, Jonathan Corbet, Joel Fernandes (Google),
	Davidlohr Bueso, Greg Kroah-Hartman, Ingo Molnar,
	Thomas Gleixner, linux-kernel

Em Tue, 1 Dec 2020 13:54:45 +0100
Peter Zijlstra <peterz@infradead.org> escreveu:

> On Tue, Dec 01, 2020 at 01:09:00PM +0100, Mauro Carvalho Chehab wrote:
> > Changeset cd8084f91c02 ("locking/lockdep: Apply crossrelease to completions")
> > added a CONFIG_LOCKDEP_COMPLETE (that was later renamed to
> > CONFIG_LOCKDEP_COMPLETIONS).
> > 
> > Such changeset renamed the init_completion, and add a macro
> > that would either run a modified version or the original code.
> > 
> > However, such code reported too many false positives. So, it
> > ended being dropped later on by
> > changeset e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks").
> > 
> > Yet, the define remained there as just:
> > 
> > 	 #define init_completion(x) __init_completion(x)
> > 
> > Get rid of the define, and return __init_completion() function
> > to its original name.
> > 
> > Fixes: e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks")
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> > ---  
> 
> Your patch is weird, did you add -C 1000 or something?

Per a past review request, I used -U32 on this particular series, in order
to be able to display the function name and the kernel-doc markup at
the same time.

I'm enclosing the patch with -U3.

Thanks,
Mauro

[PATCH] completion: drop init_completion define

Changeset cd8084f91c02 ("locking/lockdep: Apply crossrelease to completions")
added a CONFIG_LOCKDEP_COMPLETE (that was later renamed to
CONFIG_LOCKDEP_COMPLETIONS).

Such changeset renamed the init_completion, and add a macro
that would either run a modified version or the original code.

However, such code reported too many false positives. So, it
ended being dropped later on by
changeset e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks").

Yet, the define remained there as just:

	 #define init_completion(x) __init_completion(x)

Get rid of the define, and return __init_completion() function
to its original name.

Fixes: e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks")

diff --git a/include/linux/completion.h b/include/linux/completion.h
index bf8e77001f18..51d9ab079629 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -28,8 +28,7 @@ struct completion {
 	struct swait_queue_head wait;
 };
 
-#define init_completion_map(x, m) __init_completion(x)
-#define init_completion(x) __init_completion(x)
+#define init_completion_map(x, m) init_completion(x)
 static inline void complete_acquire(struct completion *x) {}
 static inline void complete_release(struct completion *x) {}
 
@@ -82,7 +81,7 @@ static inline void complete_release(struct completion *x) {}
  * This inline function will initialize a dynamically created completion
  * structure.
  */
-static inline void __init_completion(struct completion *x)
+static inline void init_completion(struct completion *x)
 {
 	x->done = 0;
 	init_swait_queue_head(&x->wait);


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 05/16] fs: fix kernel-doc markups
  2020-12-01 12:43   ` Christoph Hellwig
@ 2020-12-01 14:06     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 31+ messages in thread
From: Mauro Carvalho Chehab @ 2020-12-01 14:06 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Linux Doc Mailing List, Jonathan Corbet, Alexander Viro,
	linux-fsdevel, linux-kernel

Em Tue, 1 Dec 2020 12:43:41 +0000
Christoph Hellwig <hch@infradead.org> escreveu:

> On Tue, Dec 01, 2020 at 01:08:58PM +0100, Mauro Carvalho Chehab wrote:
> > Two markups are at the wrong place. Kernel-doc only
> > support having the comment just before the identifier.
> > 
> > Also, some identifiers have different names between their
> > prototypes and the kernel-doc markup.  
> 
> This patch looks really weird, having 30-ish unchanged lines as the
> unified diff context.

That was due to a past review request for this series.

With -U32, all kernel-doc markups and the corresponding function names
can be seen at the patch.

I'm enclosing the same patch with the usual -U3.

Thanks,
Mauro

[PATCH] fs: fix kernel-doc markups

Two markups are at the wrong place. Kernel-doc only
support having the comment just before the identifier.

Also, some identifiers have different names between their
prototypes and the kernel-doc markup.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

diff --git a/fs/dcache.c b/fs/dcache.c
index ea0485861d93..6eabb48a49fc 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -456,23 +456,6 @@ static void d_lru_shrink_move(struct list_lru_one *lru, struct dentry *dentry,
 	list_lru_isolate_move(lru, &dentry->d_lru, list);
 }
 
-/**
- * d_drop - drop a dentry
- * @dentry: dentry to drop
- *
- * d_drop() unhashes the entry from the parent dentry hashes, so that it won't
- * be found through a VFS lookup any more. Note that this is different from
- * deleting the dentry - d_delete will try to mark the dentry negative if
- * possible, giving a successful _negative_ lookup, while d_drop will
- * just make the cache lookup fail.
- *
- * d_drop() is used mainly for stuff that wants to invalidate a dentry for some
- * reason (NFS timeouts or autofs deletes).
- *
- * __d_drop requires dentry->d_lock
- * ___d_drop doesn't mark dentry as "unhashed"
- *   (dentry->d_hash.pprev will be LIST_POISON2, not NULL).
- */
 static void ___d_drop(struct dentry *dentry)
 {
 	struct hlist_bl_head *b;
@@ -501,6 +484,23 @@ void __d_drop(struct dentry *dentry)
 }
 EXPORT_SYMBOL(__d_drop);
 
+/**
+ * d_drop - drop a dentry
+ * @dentry: dentry to drop
+ *
+ * d_drop() unhashes the entry from the parent dentry hashes, so that it won't
+ * be found through a VFS lookup any more. Note that this is different from
+ * deleting the dentry - d_delete will try to mark the dentry negative if
+ * possible, giving a successful _negative_ lookup, while d_drop will
+ * just make the cache lookup fail.
+ *
+ * d_drop() is used mainly for stuff that wants to invalidate a dentry for some
+ * reason (NFS timeouts or autofs deletes).
+ *
+ * __d_drop requires dentry->d_lock
+ * ___d_drop doesn't mark dentry as "unhashed"
+ *   (dentry->d_hash.pprev will be LIST_POISON2, not NULL).
+ */
 void d_drop(struct dentry *dentry)
 {
 	spin_lock(&dentry->d_lock);
@@ -989,20 +989,6 @@ struct dentry *d_find_any_alias(struct inode *inode)
 }
 EXPORT_SYMBOL(d_find_any_alias);
 
-/**
- * d_find_alias - grab a hashed alias of inode
- * @inode: inode in question
- *
- * If inode has a hashed alias, or is a directory and has any alias,
- * acquire the reference to alias and return it. Otherwise return NULL.
- * Notice that if inode is a directory there can be only one alias and
- * it can be unhashed only if it has no children, or if it is the root
- * of a filesystem, or if the directory was renamed and d_revalidate
- * was the first vfs operation to notice.
- *
- * If the inode has an IS_ROOT, DCACHE_DISCONNECTED alias, then prefer
- * any other hashed alias over that one.
- */
 static struct dentry *__d_find_alias(struct inode *inode)
 {
 	struct dentry *alias;
@@ -1022,6 +1008,20 @@ static struct dentry *__d_find_alias(struct inode *inode)
 	return NULL;
 }
 
+/**
+ * d_find_alias - grab a hashed alias of inode
+ * @inode: inode in question
+ *
+ * If inode has a hashed alias, or is a directory and has any alias,
+ * acquire the reference to alias and return it. Otherwise return NULL.
+ * Notice that if inode is a directory there can be only one alias and
+ * it can be unhashed only if it has no children, or if it is the root
+ * of a filesystem, or if the directory was renamed and d_revalidate
+ * was the first vfs operation to notice.
+ *
+ * If the inode has an IS_ROOT, DCACHE_DISCONNECTED alias, then prefer
+ * any other hashed alias over that one.
+ */
 struct dentry *d_find_alias(struct inode *inode)
 {
 	struct dentry *de = NULL;
diff --git a/fs/inode.c b/fs/inode.c
index 9d78c37b00b8..aad3dcf2e259 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1496,7 +1496,7 @@ struct inode *find_inode_rcu(struct super_block *sb, unsigned long hashval,
 EXPORT_SYMBOL(find_inode_rcu);
 
 /**
- * find_inode_by_rcu - Find an inode in the inode cache
+ * find_inode_by_ino_rcu - Find an inode in the inode cache
  * @sb:		Super block of file system to search
  * @ino:	The inode number to match
  *
@@ -1778,7 +1778,7 @@ static int update_time(struct inode *inode, struct timespec64 *time, int flags)
 }
 
 /**
- *	touch_atime	-	update the access time
+ *	atime_needs_update	-	update the access time
  *	@path: the &struct path to update
  *	@inode: inode to update
  *
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 03a369ccd28c..cb11a34fb871 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -669,7 +669,8 @@ void seq_puts(struct seq_file *m, const char *s)
 EXPORT_SYMBOL(seq_puts);
 
 /**
- * A helper routine for putting decimal numbers without rich format of printf().
+ * seq_put_decimal_ull_width - A helper routine for putting decimal numbers
+ * 			       without rich format of printf().
  * only 'unsigned long long' is supported.
  * @m: seq_file identifying the buffer to which data should be written
  * @delimiter: a string which is printed before the number
@@ -1044,7 +1045,7 @@ struct hlist_node *seq_hlist_next_rcu(void *v,
 EXPORT_SYMBOL(seq_hlist_next_rcu);
 
 /**
- * seq_hlist_start_precpu - start an iteration of a percpu hlist array
+ * seq_hlist_start_percpu - start an iteration of a percpu hlist array
  * @head: pointer to percpu array of struct hlist_heads
  * @cpu:  pointer to cpu "cursor"
  * @pos:  start position of sequence
diff --git a/fs/super.c b/fs/super.c
index 98bb0629ee10..912636bbda9e 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1771,12 +1771,6 @@ int freeze_super(struct super_block *sb)
 }
 EXPORT_SYMBOL(freeze_super);
 
-/**
- * thaw_super -- unlock filesystem
- * @sb: the super to thaw
- *
- * Unlocks the filesystem and marks it writeable again after freeze_super().
- */
 static int thaw_super_locked(struct super_block *sb)
 {
 	int error;
@@ -1812,6 +1806,12 @@ static int thaw_super_locked(struct super_block *sb)
 	return 0;
 }
 
+/**
+ * thaw_super -- unlock filesystem
+ * @sb: the super to thaw
+ *
+ * Unlocks the filesystem and marks it writeable again after freeze_super().
+ */
 int thaw_super(struct super_block *sb)
 {
 	down_write(&sb->s_umount);

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 16/16] scripts: kernel-doc: validate kernel-doc markup with the actual names
  2020-12-01 12:09 ` [PATCH v5 16/16] scripts: kernel-doc: validate kernel-doc markup with the actual names Mauro Carvalho Chehab
@ 2020-12-01 15:06   ` kernel test robot
  2020-12-01 15:25   ` kernel test robot
  1 sibling, 0 replies; 31+ messages in thread
From: kernel test robot @ 2020-12-01 15:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Doc Mailing List, Jonathan Corbet
  Cc: kbuild-all, linux-media, Mauro Carvalho Chehab, linux-kernel

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

Hi Mauro,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20201201]
[cannot apply to lwn/docs-next tip/sched/core hsi/for-next linus/master v5.10-rc6 v5.10-rc5 v5.10-rc4 v5.10-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/HSI-fix-a-kernel-doc-markup/20201201-210930
base:    0eedceafd3a63fd082743c914853ef4b9247dbe6
config: parisc-randconfig-s032-20201201 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-170-g3bc348f6-dirty
        # https://github.com/0day-ci/linux/commit/7c52ba119279c74e6c7e968e3fa7290bd0f3b837
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Mauro-Carvalho-Chehab/HSI-fix-a-kernel-doc-markup/20201201-210930
        git checkout 7c52ba119279c74e6c7e968e3fa7290bd0f3b837
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=parisc 

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

All warnings (new ones prefixed by >>):

   arch/parisc/kernel/firmware.c:144: warning: Function parameter or member 'addr' not described in 'convert_to_wide'
   arch/parisc/kernel/firmware.c:144: warning: Excess function parameter 'address' description in 'convert_to_wide'
   arch/parisc/kernel/firmware.c:260: warning: Function parameter or member 'led_info' not described in 'pdc_chassis_info'
   arch/parisc/kernel/firmware.c:260: warning: Excess function parameter 'result' description in 'pdc_chassis_info'
   arch/parisc/kernel/firmware.c:284: warning: Function parameter or member 'state' not described in 'pdc_pat_chassis_send_log'
   arch/parisc/kernel/firmware.c:284: warning: Function parameter or member 'data' not described in 'pdc_pat_chassis_send_log'
   arch/parisc/kernel/firmware.c:284: warning: Excess function parameter 'retval' description in 'pdc_pat_chassis_send_log'
   arch/parisc/kernel/firmware.c:304: warning: Function parameter or member 'disp' not described in 'pdc_chassis_disp'
   arch/parisc/kernel/firmware.c:304: warning: Excess function parameter 'retval' description in 'pdc_chassis_disp'
>> arch/parisc/kernel/firmware.c:320: warning: expecting prototype for pdc_cpu_rendenzvous(). Prototype was for __pdc_cpu_rendezvous() instead
   arch/parisc/kernel/firmware.c:333: warning: Function parameter or member 'warn' not described in 'pdc_chassis_warn'
   arch/parisc/kernel/firmware.c:333: warning: Excess function parameter 'retval' description in 'pdc_chassis_warn'
   arch/parisc/kernel/firmware.c:519: warning: Function parameter or member 'versions' not described in 'pdc_model_versions'
   arch/parisc/kernel/firmware.c:519: warning: Excess function parameter 'cpu_id' description in 'pdc_model_versions'
   arch/parisc/kernel/firmware.c:963: warning: Function parameter or member 'hpa' not described in 'pdc_pci_config_read'
   arch/parisc/kernel/firmware.c:963: warning: Function parameter or member 'cfg_addr' not described in 'pdc_pci_config_read'
   arch/parisc/kernel/firmware.c:987: warning: Function parameter or member 'hpa' not described in 'pdc_pci_config_write'
   arch/parisc/kernel/firmware.c:987: warning: Function parameter or member 'cfg_addr' not described in 'pdc_pci_config_write'
   arch/parisc/kernel/firmware.c:987: warning: Function parameter or member 'val' not described in 'pdc_pci_config_write'
   arch/parisc/kernel/firmware.c:1464: warning: Function parameter or member 'actual_len' not described in 'pdc_pat_pd_get_addr_map'
   arch/parisc/kernel/firmware.c:1464: warning: Excess function parameter 'actlen' description in 'pdc_pat_pd_get_addr_map'
>> arch/parisc/kernel/firmware.c:1487: warning: expecting prototype for pdc_pat_pd_get_PDC_interface_revisions(). Prototype was for pdc_pat_pd_get_pdc_revisions() instead
   arch/parisc/kernel/firmware.c:1539: warning: Function parameter or member 'val' not described in 'pdc_pat_io_pci_cfg_write'
   arch/parisc/kernel/firmware.c:1539: warning: Excess function parameter 'value' description in 'pdc_pat_io_pci_cfg_write'
>> arch/parisc/kernel/firmware.c:1557: warning: expecting prototype for pdc_pat_mem_pdc_info(). Prototype was for pdc_pat_mem_pdt_info() instead
--
   arch/parisc/kernel/pdc_chassis.c:47: warning: Function parameter or member 'str' not described in 'pdc_chassis_setup'
   arch/parisc/kernel/pdc_chassis.c:64: warning: Excess function parameter 'pdc_chassis_old' description in 'pdc_chassis_checkold'
   arch/parisc/kernel/pdc_chassis.c:88: warning: Function parameter or member 'this' not described in 'pdc_chassis_panic_event'
   arch/parisc/kernel/pdc_chassis.c:88: warning: Function parameter or member 'event' not described in 'pdc_chassis_panic_event'
   arch/parisc/kernel/pdc_chassis.c:88: warning: Function parameter or member 'ptr' not described in 'pdc_chassis_panic_event'
   arch/parisc/kernel/pdc_chassis.c:108: warning: Function parameter or member 'this' not described in 'pdc_chassis_reboot_event'
   arch/parisc/kernel/pdc_chassis.c:108: warning: Function parameter or member 'event' not described in 'pdc_chassis_reboot_event'
   arch/parisc/kernel/pdc_chassis.c:108: warning: Function parameter or member 'ptr' not described in 'pdc_chassis_reboot_event'
>> arch/parisc/kernel/pdc_chassis.c:108: warning: expecting prototype for parisc_reboot_event(). Prototype was for pdc_chassis_reboot_event() instead
   arch/parisc/kernel/pdc_chassis.c:162: warning: Function parameter or member 'message' not described in 'pdc_chassis_send_status'
   arch/parisc/kernel/pdc_chassis.c:162: warning: Excess function parameter 'retval' description in 'pdc_chassis_send_status'
--
>> arch/parisc/kernel/processor.c:67: warning: expecting prototype for init_cpu_profiler(). Prototype was for init_percpu_prof() instead
--
   drivers/tty/serial/mux.c:118: warning: Function parameter or member 'port' not described in 'mux_set_mctrl'
   drivers/tty/serial/mux.c:118: warning: Excess function parameter 'ports' description in 'mux_set_mctrl'
>> drivers/tty/serial/mux.c:371: warning: expecting prototype for mux_drv_poll(). Prototype was for mux_poll() instead

vim +320 arch/parisc/kernel/firmware.c

^1da177e4c3f415 Linus Torvalds 2005-04-16  134  
^1da177e4c3f415 Linus Torvalds 2005-04-16  135  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  136   * convert_to_wide - Convert the return buffer addresses into kernel addresses.
^1da177e4c3f415 Linus Torvalds 2005-04-16  137   * @address: The return buffer from PDC.
^1da177e4c3f415 Linus Torvalds 2005-04-16  138   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  139   * This function is used to convert the return buffer addresses retrieved from PDC
^1da177e4c3f415 Linus Torvalds 2005-04-16  140   * into kernel addresses when the PDC address size and kernel address size are
^1da177e4c3f415 Linus Torvalds 2005-04-16  141   * different.
^1da177e4c3f415 Linus Torvalds 2005-04-16  142   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  143  static void convert_to_wide(unsigned long *addr)
^1da177e4c3f415 Linus Torvalds 2005-04-16 @144  {
a8f44e3889b6868 Helge Deller   2007-01-28  145  #ifdef CONFIG_64BIT
^1da177e4c3f415 Linus Torvalds 2005-04-16  146  	int i;
^1da177e4c3f415 Linus Torvalds 2005-04-16  147  	unsigned int *p = (unsigned int *)addr;
^1da177e4c3f415 Linus Torvalds 2005-04-16  148  
^1da177e4c3f415 Linus Torvalds 2005-04-16  149  	if (unlikely(parisc_narrow_firmware)) {
8a5aa00e6b9630d Helge Deller   2017-08-04  150  		for (i = (NUM_PDC_RESULT-1); i >= 0; --i)
^1da177e4c3f415 Linus Torvalds 2005-04-16  151  			addr[i] = p[i];
^1da177e4c3f415 Linus Torvalds 2005-04-16  152  	}
^1da177e4c3f415 Linus Torvalds 2005-04-16  153  #endif
^1da177e4c3f415 Linus Torvalds 2005-04-16  154  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  155  
24b574d052a1996 Kyle McMartin  2008-07-29  156  #ifdef CONFIG_64BIT
60ffef065dd40b9 Paul Gortmaker 2013-06-17  157  void set_firmware_width_unlocked(void)
24b574d052a1996 Kyle McMartin  2008-07-29  158  {
24b574d052a1996 Kyle McMartin  2008-07-29  159  	int ret;
24b574d052a1996 Kyle McMartin  2008-07-29  160  
24b574d052a1996 Kyle McMartin  2008-07-29  161  	ret = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES,
24b574d052a1996 Kyle McMartin  2008-07-29  162  		__pa(pdc_result), 0);
24b574d052a1996 Kyle McMartin  2008-07-29  163  	convert_to_wide(pdc_result);
24b574d052a1996 Kyle McMartin  2008-07-29  164  	if (pdc_result[0] != NARROW_FIRMWARE)
24b574d052a1996 Kyle McMartin  2008-07-29  165  		parisc_narrow_firmware = 0;
24b574d052a1996 Kyle McMartin  2008-07-29  166  }
24b574d052a1996 Kyle McMartin  2008-07-29  167  	
^1da177e4c3f415 Linus Torvalds 2005-04-16  168  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  169   * set_firmware_width - Determine if the firmware is wide or narrow.
^1da177e4c3f415 Linus Torvalds 2005-04-16  170   * 
24b574d052a1996 Kyle McMartin  2008-07-29  171   * This function must be called before any pdc_* function that uses the
24b574d052a1996 Kyle McMartin  2008-07-29  172   * convert_to_wide function.
^1da177e4c3f415 Linus Torvalds 2005-04-16  173   */
60ffef065dd40b9 Paul Gortmaker 2013-06-17  174  void set_firmware_width(void)
^1da177e4c3f415 Linus Torvalds 2005-04-16  175  {
09690b18b7b9696 Kyle McMartin  2006-10-05  176  	unsigned long flags;
09690b18b7b9696 Kyle McMartin  2006-10-05  177  	spin_lock_irqsave(&pdc_lock, flags);
24b574d052a1996 Kyle McMartin  2008-07-29  178  	set_firmware_width_unlocked();
09690b18b7b9696 Kyle McMartin  2006-10-05  179  	spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  180  }
24b574d052a1996 Kyle McMartin  2008-07-29  181  #else
60ffef065dd40b9 Paul Gortmaker 2013-06-17  182  void set_firmware_width_unlocked(void)
60ffef065dd40b9 Paul Gortmaker 2013-06-17  183  {
24b574d052a1996 Kyle McMartin  2008-07-29  184  	return;
24b574d052a1996 Kyle McMartin  2008-07-29  185  }
24b574d052a1996 Kyle McMartin  2008-07-29  186  
60ffef065dd40b9 Paul Gortmaker 2013-06-17  187  void set_firmware_width(void)
60ffef065dd40b9 Paul Gortmaker 2013-06-17  188  {
24b574d052a1996 Kyle McMartin  2008-07-29  189  	return;
24b574d052a1996 Kyle McMartin  2008-07-29  190  }
24b574d052a1996 Kyle McMartin  2008-07-29  191  #endif /*CONFIG_64BIT*/
^1da177e4c3f415 Linus Torvalds 2005-04-16  192  
f5213b2c40f5749 Helge Deller   2017-08-20  193  
f5213b2c40f5749 Helge Deller   2017-08-20  194  #if !defined(BOOTLOADER)
^1da177e4c3f415 Linus Torvalds 2005-04-16  195  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  196   * pdc_emergency_unlock - Unlock the linux pdc lock
^1da177e4c3f415 Linus Torvalds 2005-04-16  197   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  198   * This call unlocks the linux pdc lock in case we need some PDC functions
^1da177e4c3f415 Linus Torvalds 2005-04-16  199   * (like pdc_add_valid) during kernel stack dump.
^1da177e4c3f415 Linus Torvalds 2005-04-16  200   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  201  void pdc_emergency_unlock(void)
^1da177e4c3f415 Linus Torvalds 2005-04-16  202  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  203   	/* Spinlock DEBUG code freaks out if we unconditionally unlock */
^1da177e4c3f415 Linus Torvalds 2005-04-16  204          if (spin_is_locked(&pdc_lock))
^1da177e4c3f415 Linus Torvalds 2005-04-16  205  		spin_unlock(&pdc_lock);
^1da177e4c3f415 Linus Torvalds 2005-04-16  206  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  207  
^1da177e4c3f415 Linus Torvalds 2005-04-16  208  
^1da177e4c3f415 Linus Torvalds 2005-04-16  209  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  210   * pdc_add_valid - Verify address can be accessed without causing a HPMC.
^1da177e4c3f415 Linus Torvalds 2005-04-16  211   * @address: Address to be verified.
^1da177e4c3f415 Linus Torvalds 2005-04-16  212   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  213   * This PDC call attempts to read from the specified address and verifies
^1da177e4c3f415 Linus Torvalds 2005-04-16  214   * if the address is valid.
^1da177e4c3f415 Linus Torvalds 2005-04-16  215   * 
^1da177e4c3f415 Linus Torvalds 2005-04-16  216   * The return value is PDC_OK (0) in case accessing this address is valid.
^1da177e4c3f415 Linus Torvalds 2005-04-16  217   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  218  int pdc_add_valid(unsigned long address)
^1da177e4c3f415 Linus Torvalds 2005-04-16  219  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  220          int retval;
09690b18b7b9696 Kyle McMartin  2006-10-05  221  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  222  
09690b18b7b9696 Kyle McMartin  2006-10-05  223          spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  224          retval = mem_pdc_call(PDC_ADD_VALID, PDC_ADD_VALID_VERIFY, address);
09690b18b7b9696 Kyle McMartin  2006-10-05  225          spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  226  
^1da177e4c3f415 Linus Torvalds 2005-04-16  227          return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  228  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  229  EXPORT_SYMBOL(pdc_add_valid);
^1da177e4c3f415 Linus Torvalds 2005-04-16  230  
77089c5274fe2f7 Helge Deller   2017-09-17  231  /**
77089c5274fe2f7 Helge Deller   2017-09-17  232   * pdc_instr - Get instruction that invokes PDCE_CHECK in HPMC handler.
77089c5274fe2f7 Helge Deller   2017-09-17  233   * @instr: Pointer to variable which will get instruction opcode.
77089c5274fe2f7 Helge Deller   2017-09-17  234   *
77089c5274fe2f7 Helge Deller   2017-09-17  235   * The return value is PDC_OK (0) in case call succeeded.
77089c5274fe2f7 Helge Deller   2017-09-17  236   */
77089c5274fe2f7 Helge Deller   2017-09-17  237  int __init pdc_instr(unsigned int *instr)
77089c5274fe2f7 Helge Deller   2017-09-17  238  {
77089c5274fe2f7 Helge Deller   2017-09-17  239  	int retval;
77089c5274fe2f7 Helge Deller   2017-09-17  240  	unsigned long flags;
77089c5274fe2f7 Helge Deller   2017-09-17  241  
77089c5274fe2f7 Helge Deller   2017-09-17  242  	spin_lock_irqsave(&pdc_lock, flags);
77089c5274fe2f7 Helge Deller   2017-09-17  243  	retval = mem_pdc_call(PDC_INSTR, 0UL, __pa(pdc_result));
77089c5274fe2f7 Helge Deller   2017-09-17  244  	convert_to_wide(pdc_result);
77089c5274fe2f7 Helge Deller   2017-09-17  245  	*instr = pdc_result[0];
77089c5274fe2f7 Helge Deller   2017-09-17  246  	spin_unlock_irqrestore(&pdc_lock, flags);
77089c5274fe2f7 Helge Deller   2017-09-17  247  
77089c5274fe2f7 Helge Deller   2017-09-17  248  	return retval;
77089c5274fe2f7 Helge Deller   2017-09-17  249  }
77089c5274fe2f7 Helge Deller   2017-09-17  250  
^1da177e4c3f415 Linus Torvalds 2005-04-16  251  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  252   * pdc_chassis_info - Return chassis information.
^1da177e4c3f415 Linus Torvalds 2005-04-16  253   * @result: The return buffer.
^1da177e4c3f415 Linus Torvalds 2005-04-16  254   * @chassis_info: The memory buffer address.
^1da177e4c3f415 Linus Torvalds 2005-04-16  255   * @len: The size of the memory buffer address.
^1da177e4c3f415 Linus Torvalds 2005-04-16  256   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  257   * An HVERSION dependent call for returning the chassis information.
^1da177e4c3f415 Linus Torvalds 2005-04-16  258   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  259  int __init pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len)
^1da177e4c3f415 Linus Torvalds 2005-04-16  260  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  261          int retval;
09690b18b7b9696 Kyle McMartin  2006-10-05  262  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  263  
09690b18b7b9696 Kyle McMartin  2006-10-05  264          spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  265          memcpy(&pdc_result, chassis_info, sizeof(*chassis_info));
^1da177e4c3f415 Linus Torvalds 2005-04-16  266          memcpy(&pdc_result2, led_info, len);
^1da177e4c3f415 Linus Torvalds 2005-04-16  267          retval = mem_pdc_call(PDC_CHASSIS, PDC_RETURN_CHASSIS_INFO,
^1da177e4c3f415 Linus Torvalds 2005-04-16  268                                __pa(pdc_result), __pa(pdc_result2), len);
^1da177e4c3f415 Linus Torvalds 2005-04-16  269          memcpy(chassis_info, pdc_result, sizeof(*chassis_info));
^1da177e4c3f415 Linus Torvalds 2005-04-16  270          memcpy(led_info, pdc_result2, len);
09690b18b7b9696 Kyle McMartin  2006-10-05  271          spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  272  
^1da177e4c3f415 Linus Torvalds 2005-04-16  273          return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  274  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  275  
^1da177e4c3f415 Linus Torvalds 2005-04-16  276  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  277   * pdc_pat_chassis_send_log - Sends a PDC PAT CHASSIS log message.
^1da177e4c3f415 Linus Torvalds 2005-04-16  278   * @retval: -1 on error, 0 on success. Other value are PDC errors
^1da177e4c3f415 Linus Torvalds 2005-04-16  279   * 
^1da177e4c3f415 Linus Torvalds 2005-04-16  280   * Must be correctly formatted or expect system crash
^1da177e4c3f415 Linus Torvalds 2005-04-16  281   */
a8f44e3889b6868 Helge Deller   2007-01-28  282  #ifdef CONFIG_64BIT
^1da177e4c3f415 Linus Torvalds 2005-04-16  283  int pdc_pat_chassis_send_log(unsigned long state, unsigned long data)
^1da177e4c3f415 Linus Torvalds 2005-04-16  284  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  285  	int retval = 0;
09690b18b7b9696 Kyle McMartin  2006-10-05  286  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  287          
^1da177e4c3f415 Linus Torvalds 2005-04-16  288  	if (!is_pdc_pat())
^1da177e4c3f415 Linus Torvalds 2005-04-16  289  		return -1;
^1da177e4c3f415 Linus Torvalds 2005-04-16  290  
09690b18b7b9696 Kyle McMartin  2006-10-05  291  	spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  292  	retval = mem_pdc_call(PDC_PAT_CHASSIS_LOG, PDC_PAT_CHASSIS_WRITE_LOG, __pa(&state), __pa(&data));
09690b18b7b9696 Kyle McMartin  2006-10-05  293  	spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  294  
^1da177e4c3f415 Linus Torvalds 2005-04-16  295  	return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  296  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  297  #endif
^1da177e4c3f415 Linus Torvalds 2005-04-16  298  
^1da177e4c3f415 Linus Torvalds 2005-04-16  299  /**
8ffaeaf42e91930 Thibaut Varene 2006-05-03  300   * pdc_chassis_disp - Updates chassis code
^1da177e4c3f415 Linus Torvalds 2005-04-16  301   * @retval: -1 on error, 0 on success
^1da177e4c3f415 Linus Torvalds 2005-04-16  302   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  303  int pdc_chassis_disp(unsigned long disp)
^1da177e4c3f415 Linus Torvalds 2005-04-16  304  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  305  	int retval = 0;
09690b18b7b9696 Kyle McMartin  2006-10-05  306  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  307  
09690b18b7b9696 Kyle McMartin  2006-10-05  308  	spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  309  	retval = mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_DISP, disp);
09690b18b7b9696 Kyle McMartin  2006-10-05  310  	spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  311  
^1da177e4c3f415 Linus Torvalds 2005-04-16  312  	return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  313  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  314  
507efd63d98c443 Sven Schnelle  2019-09-08  315  /**
507efd63d98c443 Sven Schnelle  2019-09-08  316   * pdc_cpu_rendenzvous - Stop currently executing CPU
507efd63d98c443 Sven Schnelle  2019-09-08  317   * @retval: -1 on error, 0 on success
507efd63d98c443 Sven Schnelle  2019-09-08  318   */
507efd63d98c443 Sven Schnelle  2019-09-08  319  int __pdc_cpu_rendezvous(void)
507efd63d98c443 Sven Schnelle  2019-09-08 @320  {
507efd63d98c443 Sven Schnelle  2019-09-08  321  	if (is_pdc_pat())
507efd63d98c443 Sven Schnelle  2019-09-08  322  		return mem_pdc_call(PDC_PAT_CPU, PDC_PAT_CPU_RENDEZVOUS);
507efd63d98c443 Sven Schnelle  2019-09-08  323  	else
507efd63d98c443 Sven Schnelle  2019-09-08  324  		return mem_pdc_call(PDC_PROC, 1, 0);
507efd63d98c443 Sven Schnelle  2019-09-08  325  }
507efd63d98c443 Sven Schnelle  2019-09-08  326  
507efd63d98c443 Sven Schnelle  2019-09-08  327  
8ffaeaf42e91930 Thibaut Varene 2006-05-03  328  /**
8ffaeaf42e91930 Thibaut Varene 2006-05-03  329   * pdc_chassis_warn - Fetches chassis warnings
8ffaeaf42e91930 Thibaut Varene 2006-05-03  330   * @retval: -1 on error, 0 on success
8ffaeaf42e91930 Thibaut Varene 2006-05-03  331   */
8ffaeaf42e91930 Thibaut Varene 2006-05-03  332  int pdc_chassis_warn(unsigned long *warn)
8ffaeaf42e91930 Thibaut Varene 2006-05-03  333  {
8ffaeaf42e91930 Thibaut Varene 2006-05-03  334  	int retval = 0;
09690b18b7b9696 Kyle McMartin  2006-10-05  335  	unsigned long flags;
8ffaeaf42e91930 Thibaut Varene 2006-05-03  336  
09690b18b7b9696 Kyle McMartin  2006-10-05  337  	spin_lock_irqsave(&pdc_lock, flags);
8ffaeaf42e91930 Thibaut Varene 2006-05-03  338  	retval = mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_WARN, __pa(pdc_result));
8ffaeaf42e91930 Thibaut Varene 2006-05-03  339  	*warn = pdc_result[0];
09690b18b7b9696 Kyle McMartin  2006-10-05  340  	spin_unlock_irqrestore(&pdc_lock, flags);
8ffaeaf42e91930 Thibaut Varene 2006-05-03  341  
8ffaeaf42e91930 Thibaut Varene 2006-05-03  342  	return retval;
8ffaeaf42e91930 Thibaut Varene 2006-05-03  343  }
8ffaeaf42e91930 Thibaut Varene 2006-05-03  344  
60ffef065dd40b9 Paul Gortmaker 2013-06-17  345  int pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info)
24b574d052a1996 Kyle McMartin  2008-07-29  346  {
24b574d052a1996 Kyle McMartin  2008-07-29  347  	int ret;
24b574d052a1996 Kyle McMartin  2008-07-29  348  
24b574d052a1996 Kyle McMartin  2008-07-29  349  	ret = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(pdc_result));
24b574d052a1996 Kyle McMartin  2008-07-29  350  	convert_to_wide(pdc_result);
24b574d052a1996 Kyle McMartin  2008-07-29  351  	pdc_coproc_info->ccr_functional = pdc_result[0];
24b574d052a1996 Kyle McMartin  2008-07-29  352  	pdc_coproc_info->ccr_present = pdc_result[1];
24b574d052a1996 Kyle McMartin  2008-07-29  353  	pdc_coproc_info->revision = pdc_result[17];
24b574d052a1996 Kyle McMartin  2008-07-29  354  	pdc_coproc_info->model = pdc_result[18];
24b574d052a1996 Kyle McMartin  2008-07-29  355  
24b574d052a1996 Kyle McMartin  2008-07-29  356  	return ret;
24b574d052a1996 Kyle McMartin  2008-07-29  357  }
24b574d052a1996 Kyle McMartin  2008-07-29  358  
^1da177e4c3f415 Linus Torvalds 2005-04-16  359  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  360   * pdc_coproc_cfg - To identify coprocessors attached to the processor.
^1da177e4c3f415 Linus Torvalds 2005-04-16  361   * @pdc_coproc_info: Return buffer address.
^1da177e4c3f415 Linus Torvalds 2005-04-16  362   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  363   * This PDC call returns the presence and status of all the coprocessors
^1da177e4c3f415 Linus Torvalds 2005-04-16  364   * attached to the processor.
^1da177e4c3f415 Linus Torvalds 2005-04-16  365   */
60ffef065dd40b9 Paul Gortmaker 2013-06-17  366  int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info)
^1da177e4c3f415 Linus Torvalds 2005-04-16  367  {
24b574d052a1996 Kyle McMartin  2008-07-29  368  	int ret;
09690b18b7b9696 Kyle McMartin  2006-10-05  369  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  370  
09690b18b7b9696 Kyle McMartin  2006-10-05  371  	spin_lock_irqsave(&pdc_lock, flags);
24b574d052a1996 Kyle McMartin  2008-07-29  372  	ret = pdc_coproc_cfg_unlocked(pdc_coproc_info);
09690b18b7b9696 Kyle McMartin  2006-10-05  373  	spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  374  
24b574d052a1996 Kyle McMartin  2008-07-29  375  	return ret;
^1da177e4c3f415 Linus Torvalds 2005-04-16  376  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  377  
^1da177e4c3f415 Linus Torvalds 2005-04-16  378  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  379   * pdc_iodc_read - Read data from the modules IODC.
^1da177e4c3f415 Linus Torvalds 2005-04-16  380   * @actcnt: The actual number of bytes.
^1da177e4c3f415 Linus Torvalds 2005-04-16  381   * @hpa: The HPA of the module for the iodc read.
^1da177e4c3f415 Linus Torvalds 2005-04-16  382   * @index: The iodc entry point.
^1da177e4c3f415 Linus Torvalds 2005-04-16  383   * @iodc_data: A buffer memory for the iodc options.
^1da177e4c3f415 Linus Torvalds 2005-04-16  384   * @iodc_data_size: Size of the memory buffer.
^1da177e4c3f415 Linus Torvalds 2005-04-16  385   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  386   * This PDC call reads from the IODC of the module specified by the hpa
^1da177e4c3f415 Linus Torvalds 2005-04-16  387   * argument.
^1da177e4c3f415 Linus Torvalds 2005-04-16  388   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  389  int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index,
^1da177e4c3f415 Linus Torvalds 2005-04-16  390  		  void *iodc_data, unsigned int iodc_data_size)
^1da177e4c3f415 Linus Torvalds 2005-04-16  391  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  392  	int retval;
09690b18b7b9696 Kyle McMartin  2006-10-05  393  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  394  
09690b18b7b9696 Kyle McMartin  2006-10-05  395  	spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  396  	retval = mem_pdc_call(PDC_IODC, PDC_IODC_READ, __pa(pdc_result), hpa, 
^1da177e4c3f415 Linus Torvalds 2005-04-16  397  			      index, __pa(pdc_result2), iodc_data_size);
^1da177e4c3f415 Linus Torvalds 2005-04-16  398  	convert_to_wide(pdc_result);
^1da177e4c3f415 Linus Torvalds 2005-04-16  399  	*actcnt = pdc_result[0];
^1da177e4c3f415 Linus Torvalds 2005-04-16  400  	memcpy(iodc_data, pdc_result2, iodc_data_size);
09690b18b7b9696 Kyle McMartin  2006-10-05  401  	spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  402  
^1da177e4c3f415 Linus Torvalds 2005-04-16  403  	return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  404  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  405  EXPORT_SYMBOL(pdc_iodc_read);
^1da177e4c3f415 Linus Torvalds 2005-04-16  406  
^1da177e4c3f415 Linus Torvalds 2005-04-16  407  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  408   * pdc_system_map_find_mods - Locate unarchitected modules.
^1da177e4c3f415 Linus Torvalds 2005-04-16  409   * @pdc_mod_info: Return buffer address.
^1da177e4c3f415 Linus Torvalds 2005-04-16  410   * @mod_path: pointer to dev path structure.
^1da177e4c3f415 Linus Torvalds 2005-04-16  411   * @mod_index: fixed address module index.
^1da177e4c3f415 Linus Torvalds 2005-04-16  412   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  413   * To locate and identify modules which reside at fixed I/O addresses, which
^1da177e4c3f415 Linus Torvalds 2005-04-16  414   * do not self-identify via architected bus walks.
^1da177e4c3f415 Linus Torvalds 2005-04-16  415   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  416  int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info,
^1da177e4c3f415 Linus Torvalds 2005-04-16  417  			     struct pdc_module_path *mod_path, long mod_index)
^1da177e4c3f415 Linus Torvalds 2005-04-16  418  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  419  	int retval;
09690b18b7b9696 Kyle McMartin  2006-10-05  420  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  421  
09690b18b7b9696 Kyle McMartin  2006-10-05  422  	spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  423  	retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_MODULE, __pa(pdc_result), 
^1da177e4c3f415 Linus Torvalds 2005-04-16  424  			      __pa(pdc_result2), mod_index);
^1da177e4c3f415 Linus Torvalds 2005-04-16  425  	convert_to_wide(pdc_result);
^1da177e4c3f415 Linus Torvalds 2005-04-16  426  	memcpy(pdc_mod_info, pdc_result, sizeof(*pdc_mod_info));
^1da177e4c3f415 Linus Torvalds 2005-04-16  427  	memcpy(mod_path, pdc_result2, sizeof(*mod_path));
09690b18b7b9696 Kyle McMartin  2006-10-05  428  	spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  429  
^1da177e4c3f415 Linus Torvalds 2005-04-16  430  	pdc_mod_info->mod_addr = f_extend(pdc_mod_info->mod_addr);
^1da177e4c3f415 Linus Torvalds 2005-04-16  431  	return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  432  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  433  
^1da177e4c3f415 Linus Torvalds 2005-04-16  434  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  435   * pdc_system_map_find_addrs - Retrieve additional address ranges.
^1da177e4c3f415 Linus Torvalds 2005-04-16  436   * @pdc_addr_info: Return buffer address.
^1da177e4c3f415 Linus Torvalds 2005-04-16  437   * @mod_index: Fixed address module index.
^1da177e4c3f415 Linus Torvalds 2005-04-16  438   * @addr_index: Address range index.
^1da177e4c3f415 Linus Torvalds 2005-04-16  439   * 
^1da177e4c3f415 Linus Torvalds 2005-04-16  440   * Retrieve additional information about subsequent address ranges for modules
^1da177e4c3f415 Linus Torvalds 2005-04-16  441   * with multiple address ranges.  
^1da177e4c3f415 Linus Torvalds 2005-04-16  442   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  443  int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info, 
^1da177e4c3f415 Linus Torvalds 2005-04-16  444  			      long mod_index, long addr_index)
^1da177e4c3f415 Linus Torvalds 2005-04-16  445  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  446  	int retval;
09690b18b7b9696 Kyle McMartin  2006-10-05  447  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  448  
09690b18b7b9696 Kyle McMartin  2006-10-05  449  	spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  450  	retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_ADDRESS, __pa(pdc_result),
^1da177e4c3f415 Linus Torvalds 2005-04-16  451  			      mod_index, addr_index);
^1da177e4c3f415 Linus Torvalds 2005-04-16  452  	convert_to_wide(pdc_result);
^1da177e4c3f415 Linus Torvalds 2005-04-16  453  	memcpy(pdc_addr_info, pdc_result, sizeof(*pdc_addr_info));
09690b18b7b9696 Kyle McMartin  2006-10-05  454  	spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  455  
^1da177e4c3f415 Linus Torvalds 2005-04-16  456  	pdc_addr_info->mod_addr = f_extend(pdc_addr_info->mod_addr);
^1da177e4c3f415 Linus Torvalds 2005-04-16  457  	return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  458  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  459  
^1da177e4c3f415 Linus Torvalds 2005-04-16  460  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  461   * pdc_model_info - Return model information about the processor.
^1da177e4c3f415 Linus Torvalds 2005-04-16  462   * @model: The return buffer.
^1da177e4c3f415 Linus Torvalds 2005-04-16  463   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  464   * Returns the version numbers, identifiers, and capabilities from the processor module.
^1da177e4c3f415 Linus Torvalds 2005-04-16  465   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  466  int pdc_model_info(struct pdc_model *model) 
^1da177e4c3f415 Linus Torvalds 2005-04-16  467  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  468  	int retval;
09690b18b7b9696 Kyle McMartin  2006-10-05  469  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  470  
09690b18b7b9696 Kyle McMartin  2006-10-05  471  	spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  472  	retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_INFO, __pa(pdc_result), 0);
^1da177e4c3f415 Linus Torvalds 2005-04-16  473  	convert_to_wide(pdc_result);
^1da177e4c3f415 Linus Torvalds 2005-04-16  474  	memcpy(model, pdc_result, sizeof(*model));
09690b18b7b9696 Kyle McMartin  2006-10-05  475  	spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  476  
^1da177e4c3f415 Linus Torvalds 2005-04-16  477  	return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  478  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  479  
^1da177e4c3f415 Linus Torvalds 2005-04-16  480  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  481   * pdc_model_sysmodel - Get the system model name.
^1da177e4c3f415 Linus Torvalds 2005-04-16  482   * @name: A char array of at least 81 characters.
^1da177e4c3f415 Linus Torvalds 2005-04-16  483   *
ec1fdc24c2ae012 Kyle McMartin  2006-06-21  484   * Get system model name from PDC ROM (e.g. 9000/715 or 9000/778/B160L).
ec1fdc24c2ae012 Kyle McMartin  2006-06-21  485   * Using OS_ID_HPUX will return the equivalent of the 'modelname' command
ec1fdc24c2ae012 Kyle McMartin  2006-06-21  486   * on HP/UX.
^1da177e4c3f415 Linus Torvalds 2005-04-16  487   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  488  int pdc_model_sysmodel(char *name)
^1da177e4c3f415 Linus Torvalds 2005-04-16  489  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  490          int retval;
09690b18b7b9696 Kyle McMartin  2006-10-05  491  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  492  
09690b18b7b9696 Kyle McMartin  2006-10-05  493          spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  494          retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_SYSMODEL, __pa(pdc_result),
^1da177e4c3f415 Linus Torvalds 2005-04-16  495                                OS_ID_HPUX, __pa(name));
^1da177e4c3f415 Linus Torvalds 2005-04-16  496          convert_to_wide(pdc_result);
^1da177e4c3f415 Linus Torvalds 2005-04-16  497  
^1da177e4c3f415 Linus Torvalds 2005-04-16  498          if (retval == PDC_OK) {
^1da177e4c3f415 Linus Torvalds 2005-04-16  499                  name[pdc_result[0]] = '\0'; /* add trailing '\0' */
^1da177e4c3f415 Linus Torvalds 2005-04-16  500          } else {
^1da177e4c3f415 Linus Torvalds 2005-04-16  501                  name[0] = 0;
^1da177e4c3f415 Linus Torvalds 2005-04-16  502          }
09690b18b7b9696 Kyle McMartin  2006-10-05  503          spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  504  
^1da177e4c3f415 Linus Torvalds 2005-04-16  505          return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  506  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  507  
^1da177e4c3f415 Linus Torvalds 2005-04-16  508  /**
^1da177e4c3f415 Linus Torvalds 2005-04-16  509   * pdc_model_versions - Identify the version number of each processor.
^1da177e4c3f415 Linus Torvalds 2005-04-16  510   * @cpu_id: The return buffer.
^1da177e4c3f415 Linus Torvalds 2005-04-16  511   * @id: The id of the processor to check.
^1da177e4c3f415 Linus Torvalds 2005-04-16  512   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  513   * Returns the version number for each processor component.
^1da177e4c3f415 Linus Torvalds 2005-04-16  514   *
^1da177e4c3f415 Linus Torvalds 2005-04-16  515   * This comment was here before, but I do not know what it means :( -RB
^1da177e4c3f415 Linus Torvalds 2005-04-16  516   * id: 0 = cpu revision, 1 = boot-rom-version
^1da177e4c3f415 Linus Torvalds 2005-04-16  517   */
^1da177e4c3f415 Linus Torvalds 2005-04-16  518  int pdc_model_versions(unsigned long *versions, int id)
^1da177e4c3f415 Linus Torvalds 2005-04-16 @519  {
^1da177e4c3f415 Linus Torvalds 2005-04-16  520          int retval;
09690b18b7b9696 Kyle McMartin  2006-10-05  521  	unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16  522  
09690b18b7b9696 Kyle McMartin  2006-10-05  523          spin_lock_irqsave(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  524          retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_VERSIONS, __pa(pdc_result), id);
^1da177e4c3f415 Linus Torvalds 2005-04-16  525          convert_to_wide(pdc_result);
^1da177e4c3f415 Linus Torvalds 2005-04-16  526          *versions = pdc_result[0];
09690b18b7b9696 Kyle McMartin  2006-10-05  527          spin_unlock_irqrestore(&pdc_lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16  528  
^1da177e4c3f415 Linus Torvalds 2005-04-16  529          return retval;
^1da177e4c3f415 Linus Torvalds 2005-04-16  530  }
^1da177e4c3f415 Linus Torvalds 2005-04-16  531  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24728 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 16/16] scripts: kernel-doc: validate kernel-doc markup with the actual names
  2020-12-01 12:09 ` [PATCH v5 16/16] scripts: kernel-doc: validate kernel-doc markup with the actual names Mauro Carvalho Chehab
  2020-12-01 15:06   ` kernel test robot
@ 2020-12-01 15:25   ` kernel test robot
  1 sibling, 0 replies; 31+ messages in thread
From: kernel test robot @ 2020-12-01 15:25 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Doc Mailing List, Jonathan Corbet
  Cc: kbuild-all, linux-media, Mauro Carvalho Chehab, linux-kernel

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

Hi Mauro,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20201201]
[cannot apply to lwn/docs-next tip/sched/core hsi/for-next linus/master v5.10-rc6 v5.10-rc5 v5.10-rc4 v5.10-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/HSI-fix-a-kernel-doc-markup/20201201-210930
base:    0eedceafd3a63fd082743c914853ef4b9247dbe6
config: x86_64-randconfig-s021-20201201 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-170-g3bc348f6-dirty
        # https://github.com/0day-ci/linux/commit/7c52ba119279c74e6c7e968e3fa7290bd0f3b837
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Mauro-Carvalho-Chehab/HSI-fix-a-kernel-doc-markup/20201201-210930
        git checkout 7c52ba119279c74e6c7e968e3fa7290bd0f3b837
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> mm/vmscan.c:1614: warning: wrong kernel-doc identifier on line:
    * Isolating page from the lruvec to fill in @dst list by nr_to_scan times.
--
>> drivers/hv/vmbus_drv.c:1536: warning: expecting prototype for __vmbus_child_driver_register(). Prototype was for __vmbus_driver_register() instead
--
   drivers/rtc/class.c:326: warning: Function parameter or member 'data' not described in 'devm_rtc_unregister_device'
>> drivers/rtc/class.c:326: warning: expecting prototype for rtc_device_unregister(). Prototype was for devm_rtc_unregister_device() instead

vim +1614 mm/vmscan.c

b4536f0c829c85 Michal Hocko            2017-01-10  1612  
f4b7e272b5c042 Andrey Ryabinin         2019-03-05  1613  /**
f46cdc387708fb Hugh Dickins            2020-11-24 @1614   * Isolating page from the lruvec to fill in @dst list by nr_to_scan times.
f46cdc387708fb Hugh Dickins            2020-11-24  1615   *
f46cdc387708fb Hugh Dickins            2020-11-24  1616   * lruvec->lru_lock is heavily contended.  Some of the functions that
^1da177e4c3f41 Linus Torvalds          2005-04-16  1617   * shrink the lists perform better by taking out a batch of pages
^1da177e4c3f41 Linus Torvalds          2005-04-16  1618   * and working on them outside the LRU lock.
^1da177e4c3f41 Linus Torvalds          2005-04-16  1619   *
^1da177e4c3f41 Linus Torvalds          2005-04-16  1620   * For pagecache intensive workloads, this function is the hottest
^1da177e4c3f41 Linus Torvalds          2005-04-16  1621   * spot in the kernel (apart from copy_*_user functions).
^1da177e4c3f41 Linus Torvalds          2005-04-16  1622   *
f46cdc387708fb Hugh Dickins            2020-11-24  1623   * Lru_lock must be held before calling this function.
^1da177e4c3f41 Linus Torvalds          2005-04-16  1624   *
791b48b642324c Minchan Kim             2017-05-12  1625   * @nr_to_scan:	The number of eligible pages to look through on the list.
5dc35979e444b5 Konstantin Khlebnikov   2012-05-29  1626   * @lruvec:	The LRU vector to pull pages from.
^1da177e4c3f41 Linus Torvalds          2005-04-16  1627   * @dst:	The temp list to put pages on to.
f626012db08b9e Hugh Dickins            2012-01-12  1628   * @nr_scanned:	The number of pages that were scanned.
fe2c2a10666313 Rik van Riel            2012-03-21  1629   * @sc:		The scan_control struct for this reclaim session
3cb9945179bd04 Konstantin Khlebnikov   2012-05-29  1630   * @lru:	LRU list id for isolating
^1da177e4c3f41 Linus Torvalds          2005-04-16  1631   *
^1da177e4c3f41 Linus Torvalds          2005-04-16  1632   * returns how many pages were moved onto *@dst.
^1da177e4c3f41 Linus Torvalds          2005-04-16  1633   */
69e05944af39fc Andrew Morton           2006-03-22  1634  static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
5dc35979e444b5 Konstantin Khlebnikov   2012-05-29  1635  		struct lruvec *lruvec, struct list_head *dst,
fe2c2a10666313 Rik van Riel            2012-03-21  1636  		unsigned long *nr_scanned, struct scan_control *sc,
a9e7c39fa9fd90 Kirill Tkhai            2019-03-05  1637  		enum lru_list lru)
^1da177e4c3f41 Linus Torvalds          2005-04-16  1638  {
75b00af77ed5b5 Hugh Dickins            2012-05-29  1639  	struct list_head *src = &lruvec->lists[lru];
69e05944af39fc Andrew Morton           2006-03-22  1640  	unsigned long nr_taken = 0;
599d0c954f91d0 Mel Gorman              2016-07-28  1641  	unsigned long nr_zone_taken[MAX_NR_ZONES] = { 0 };
7cc30fcfd2a894 Mel Gorman              2016-07-28  1642  	unsigned long nr_skipped[MAX_NR_ZONES] = { 0, };
3db65812d68883 Johannes Weiner         2017-05-03  1643  	unsigned long skipped = 0;
791b48b642324c Minchan Kim             2017-05-12  1644  	unsigned long scan, total_scan, nr_pages;
b2e18757f2c9d1 Mel Gorman              2016-07-28  1645  	LIST_HEAD(pages_skipped);
a9e7c39fa9fd90 Kirill Tkhai            2019-03-05  1646  	isolate_mode_t mode = (sc->may_unmap ? 0 : ISOLATE_UNMAPPED);
^1da177e4c3f41 Linus Torvalds          2005-04-16  1647  
98879b3b9edc16 Yang Shi                2019-07-11  1648  	total_scan = 0;
791b48b642324c Minchan Kim             2017-05-12  1649  	scan = 0;
98879b3b9edc16 Yang Shi                2019-07-11  1650  	while (scan < nr_to_scan && !list_empty(src)) {
5ad333eb66ff1e Andy Whitcroft          2007-07-17  1651  		struct page *page;
5ad333eb66ff1e Andy Whitcroft          2007-07-17  1652  
^1da177e4c3f41 Linus Torvalds          2005-04-16  1653  		page = lru_to_page(src);
^1da177e4c3f41 Linus Torvalds          2005-04-16  1654  		prefetchw_prev_lru_page(page, src, flags);
^1da177e4c3f41 Linus Torvalds          2005-04-16  1655  
d8c6546b1aea84 Matthew Wilcox (Oracle  2019-09-23  1656) 		nr_pages = compound_nr(page);
98879b3b9edc16 Yang Shi                2019-07-11  1657  		total_scan += nr_pages;
98879b3b9edc16 Yang Shi                2019-07-11  1658  
b2e18757f2c9d1 Mel Gorman              2016-07-28  1659  		if (page_zonenum(page) > sc->reclaim_idx) {
b2e18757f2c9d1 Mel Gorman              2016-07-28  1660  			list_move(&page->lru, &pages_skipped);
98879b3b9edc16 Yang Shi                2019-07-11  1661  			nr_skipped[page_zonenum(page)] += nr_pages;
b2e18757f2c9d1 Mel Gorman              2016-07-28  1662  			continue;
b2e18757f2c9d1 Mel Gorman              2016-07-28  1663  		}
b2e18757f2c9d1 Mel Gorman              2016-07-28  1664  
791b48b642324c Minchan Kim             2017-05-12  1665  		/*
791b48b642324c Minchan Kim             2017-05-12  1666  		 * Do not count skipped pages because that makes the function
791b48b642324c Minchan Kim             2017-05-12  1667  		 * return with no isolated pages if the LRU mostly contains
791b48b642324c Minchan Kim             2017-05-12  1668  		 * ineligible pages.  This causes the VM to not reclaim any
791b48b642324c Minchan Kim             2017-05-12  1669  		 * pages, triggering a premature OOM.
98879b3b9edc16 Yang Shi                2019-07-11  1670  		 *
98879b3b9edc16 Yang Shi                2019-07-11  1671  		 * Account all tail pages of THP.  This would not cause
98879b3b9edc16 Yang Shi                2019-07-11  1672  		 * premature OOM since __isolate_lru_page() returns -EBUSY
98879b3b9edc16 Yang Shi                2019-07-11  1673  		 * only when the page is being freed somewhere else.
791b48b642324c Minchan Kim             2017-05-12  1674  		 */
98879b3b9edc16 Yang Shi                2019-07-11  1675  		scan += nr_pages;
0499e1a60797d4 Alex Shi                2020-11-24  1676  		if (!__isolate_lru_page_prepare(page, mode)) {
0499e1a60797d4 Alex Shi                2020-11-24  1677  			/* It is being freed elsewhere */
0499e1a60797d4 Alex Shi                2020-11-24  1678  			list_move(&page->lru, src);
0499e1a60797d4 Alex Shi                2020-11-24  1679  			continue;
0499e1a60797d4 Alex Shi                2020-11-24  1680  		}
ce8d4ae1c160d4 Alex Shi                2020-11-24  1681  		/*
ce8d4ae1c160d4 Alex Shi                2020-11-24  1682  		 * Be careful not to clear PageLRU until after we're
ce8d4ae1c160d4 Alex Shi                2020-11-24  1683  		 * sure the page is not being freed elsewhere -- the
ce8d4ae1c160d4 Alex Shi                2020-11-24  1684  		 * page release code relies on it.
ce8d4ae1c160d4 Alex Shi                2020-11-24  1685  		 */
0499e1a60797d4 Alex Shi                2020-11-24  1686  		if (unlikely(!get_page_unless_zero(page))) {
0499e1a60797d4 Alex Shi                2020-11-24  1687  			list_move(&page->lru, src);
0499e1a60797d4 Alex Shi                2020-11-24  1688  			continue;
0499e1a60797d4 Alex Shi                2020-11-24  1689  		}
ce8d4ae1c160d4 Alex Shi                2020-11-24  1690  
ce8d4ae1c160d4 Alex Shi                2020-11-24  1691  		if (!TestClearPageLRU(page)) {
0499e1a60797d4 Alex Shi                2020-11-24  1692  			/* Another thread is already isolating this page */
ce8d4ae1c160d4 Alex Shi                2020-11-24  1693  			put_page(page);
0499e1a60797d4 Alex Shi                2020-11-24  1694  			list_move(&page->lru, src);
0499e1a60797d4 Alex Shi                2020-11-24  1695  			continue;
ce8d4ae1c160d4 Alex Shi                2020-11-24  1696  		}
ce8d4ae1c160d4 Alex Shi                2020-11-24  1697  
599d0c954f91d0 Mel Gorman              2016-07-28  1698  		nr_taken += nr_pages;
599d0c954f91d0 Mel Gorman              2016-07-28  1699  		nr_zone_taken[page_zonenum(page)] += nr_pages;
5ad333eb66ff1e Andy Whitcroft          2007-07-17  1700  		list_move(&page->lru, dst);
^1da177e4c3f41 Linus Torvalds          2005-04-16  1701  	}
^1da177e4c3f41 Linus Torvalds          2005-04-16  1702  
b2e18757f2c9d1 Mel Gorman              2016-07-28  1703  	/*
b2e18757f2c9d1 Mel Gorman              2016-07-28  1704  	 * Splice any skipped pages to the start of the LRU list. Note that
b2e18757f2c9d1 Mel Gorman              2016-07-28  1705  	 * this disrupts the LRU order when reclaiming for lower zones but
b2e18757f2c9d1 Mel Gorman              2016-07-28  1706  	 * we cannot splice to the tail. If we did then the SWAP_CLUSTER_MAX
b2e18757f2c9d1 Mel Gorman              2016-07-28  1707  	 * scanning would soon rescan the same pages to skip and put the
b2e18757f2c9d1 Mel Gorman              2016-07-28  1708  	 * system at risk of premature OOM.
b2e18757f2c9d1 Mel Gorman              2016-07-28  1709  	 */
7cc30fcfd2a894 Mel Gorman              2016-07-28  1710  	if (!list_empty(&pages_skipped)) {
7cc30fcfd2a894 Mel Gorman              2016-07-28  1711  		int zid;
7cc30fcfd2a894 Mel Gorman              2016-07-28  1712  
3db65812d68883 Johannes Weiner         2017-05-03  1713  		list_splice(&pages_skipped, src);
7cc30fcfd2a894 Mel Gorman              2016-07-28  1714  		for (zid = 0; zid < MAX_NR_ZONES; zid++) {
7cc30fcfd2a894 Mel Gorman              2016-07-28  1715  			if (!nr_skipped[zid])
7cc30fcfd2a894 Mel Gorman              2016-07-28  1716  				continue;
7cc30fcfd2a894 Mel Gorman              2016-07-28  1717  
7cc30fcfd2a894 Mel Gorman              2016-07-28  1718  			__count_zid_vm_events(PGSCAN_SKIP, zid, nr_skipped[zid]);
1265e3a69f1ea9 Michal Hocko            2017-02-22  1719  			skipped += nr_skipped[zid];
7cc30fcfd2a894 Mel Gorman              2016-07-28  1720  		}
7cc30fcfd2a894 Mel Gorman              2016-07-28  1721  	}
791b48b642324c Minchan Kim             2017-05-12  1722  	*nr_scanned = total_scan;
1265e3a69f1ea9 Michal Hocko            2017-02-22  1723  	trace_mm_vmscan_lru_isolate(sc->reclaim_idx, sc->order, nr_to_scan,
791b48b642324c Minchan Kim             2017-05-12  1724  				    total_scan, skipped, nr_taken, mode, lru);
b4536f0c829c85 Michal Hocko            2017-01-10  1725  	update_lru_sizes(lruvec, lru, nr_zone_taken);
^1da177e4c3f41 Linus Torvalds          2005-04-16  1726  	return nr_taken;
^1da177e4c3f41 Linus Torvalds          2005-04-16  1727  }
^1da177e4c3f41 Linus Torvalds          2005-04-16  1728  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33834 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 14/16] selftests: kselftest_harness.h: partially fix kernel-doc markups
  2020-12-01 12:09 ` [PATCH v5 14/16] selftests: kselftest_harness.h: partially fix kernel-doc markups Mauro Carvalho Chehab
@ 2020-12-01 21:17   ` Kees Cook
  0 siblings, 0 replies; 31+ messages in thread
From: Kees Cook @ 2020-12-01 21:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Jonathan Corbet, Andy Lutomirski,
	Shuah Khan, Will Drewry, linux-kernel, linux-kselftest

On Tue, Dec 01, 2020 at 01:09:07PM +0100, Mauro Carvalho Chehab wrote:
> The kernel-doc markups on this file are weird: they don't
> follow what's specified at:
> 
> 	Documentation/doc-guide/kernel-doc.rst
> 
> In particular, markups should use this format:
>         identifier - description
> 
> and not this:
> 	identifier(args)
> 
> The way the definitions are inside this file cause the
> parser to completely miss the identifier name of each
> function.
> 
> This prevents improving the script to do some needed validation
> tests.
> 
> Address this part. Yet, furter changes are needed in order
> for it to fully follow the specs.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  tools/testing/selftests/kselftest_harness.h | 22 ++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index edce85420d19..99920466076a 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
> @@ -50,325 +50,325 @@
>  #ifndef __KSELFTEST_HARNESS_H
>  #define __KSELFTEST_HARNESS_H
>  
>  #ifndef _GNU_SOURCE
>  #define _GNU_SOURCE
>  #endif
>  #include <asm/types.h>
>  #include <errno.h>
>  #include <stdbool.h>
>  #include <stdint.h>
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
>  #include <sys/mman.h>
>  #include <sys/types.h>
>  #include <sys/wait.h>
>  #include <unistd.h>
>  
>  #include "kselftest.h"
>  
>  #define TEST_TIMEOUT_DEFAULT 30
>  
>  /* Utilities exposed to the test definitions */
>  #ifndef TH_LOG_STREAM
>  #  define TH_LOG_STREAM stderr
>  #endif
>  
>  #ifndef TH_LOG_ENABLED
>  #  define TH_LOG_ENABLED 1
>  #endif
>  
>  /**
> - * TH_LOG(fmt, ...)
> + * TH_LOG()
>   *
>   * @fmt: format string
>   * @...: optional arguments
>   *
>   * .. code-block:: c
>   *
>   *     TH_LOG(format, ...)
>   *
>   * Optional debug logging function available for use in tests.
>   * Logging may be enabled or disabled by defining TH_LOG_ENABLED.
>   * E.g., #define TH_LOG_ENABLED 1
>   *
>   * If no definition is provided, logging is enabled by default.
>   *
>   * If there is no way to print an error message for the process running the
>   * test (e.g. not allowed to write to stderr), it is still possible to get the
>   * ASSERT_* number for which the test failed.  This behavior can be enabled by
>   * writing `_metadata->no_print = true;` before the check sequence that is
>   * unable to print.  When an error occur, instead of printing an error message
>   * and calling `abort(3)`, the test process call `_exit(2)` with the assert
>   * number as argument, which is then printed by the parent process.
>   */
>  #define TH_LOG(fmt, ...) do { \
>  	if (TH_LOG_ENABLED) \
>  		__TH_LOG(fmt, ##__VA_ARGS__); \
>  } while (0)
>  
>  /* Unconditional logger for internal use. */
>  #define __TH_LOG(fmt, ...) \
>  		fprintf(TH_LOG_STREAM, "# %s:%d:%s:" fmt "\n", \
>  			__FILE__, __LINE__, _metadata->name, ##__VA_ARGS__)
>  
>  /**
> - * SKIP(statement, fmt, ...)
> + * SKIP()
>   *
>   * @statement: statement to run after reporting SKIP
>   * @fmt: format string
>   * @...: optional arguments

Please add something like this to retain the "prototype" details:

 * .. code-block:: c
 *
 *     SKIP(statement, fmt, ...);

With that added, sure, looks good:

Acked-by: Kees Cook <keescook@chromium.org>

Thanks!

>   *
>   * Optional debug logging function available for use in tests.
>   *
>   * This forces a "pass" after reporting why something is being skipped
>   * and runs "statement", which is usually "return" or "goto skip".
>   */
>  #define SKIP(statement, fmt, ...) do { \
>  	snprintf(_metadata->results->reason, \
>  		 sizeof(_metadata->results->reason), fmt, ##__VA_ARGS__); \
>  	if (TH_LOG_ENABLED) { \
>  		fprintf(TH_LOG_STREAM, "#      SKIP      %s\n", \
>  			_metadata->results->reason); \
>  	} \
>  	_metadata->passed = 1; \
>  	_metadata->skip = 1; \
>  	_metadata->trigger = 0; \
>  	statement; \
>  } while (0)
>  
>  /**
> - * TEST(test_name) - Defines the test function and creates the registration
> + * TEST() - Defines the test function and creates the registration
>   * stub
>   *
>   * @test_name: test name
>   *
>   * .. code-block:: c
>   *
>   *     TEST(name) { implementation }
>   *
>   * Defines a test by name.
>   * Names must be unique and tests must not be run in parallel.  The
>   * implementation containing block is a function and scoping should be treated
>   * as such.  Returning early may be performed with a bare "return;" statement.
>   *
>   * EXPECT_* and ASSERT_* are valid in a TEST() { } context.
>   */
>  #define TEST(test_name) __TEST_IMPL(test_name, -1)
>  
>  /**
> - * TEST_SIGNAL(test_name, signal)
> + * TEST_SIGNAL()
>   *
>   * @test_name: test name
>   * @signal: signal number
>   *
>   * .. code-block:: c
>   *
>   *     TEST_SIGNAL(name, signal) { implementation }
>   *
>   * Defines a test by name and the expected term signal.
>   * Names must be unique and tests must not be run in parallel.  The
>   * implementation containing block is a function and scoping should be treated
>   * as such.  Returning early may be performed with a bare "return;" statement.
>   *
>   * EXPECT_* and ASSERT_* are valid in a TEST() { } context.
>   */
>  #define TEST_SIGNAL(test_name, signal) __TEST_IMPL(test_name, signal)
>  
>  #define __TEST_IMPL(test_name, _signal) \
>  	static void test_name(struct __test_metadata *_metadata); \
>  	static inline void wrapper_##test_name( \
>  		struct __test_metadata *_metadata, \
>  		struct __fixture_variant_metadata *variant) \
>  	{ \
>  		test_name(_metadata); \
>  	} \
>  	static struct __test_metadata _##test_name##_object = \
>  		{ .name = #test_name, \
>  		  .fn = &wrapper_##test_name, \
>  		  .fixture = &_fixture_global, \
>  		  .termsig = _signal, \
>  		  .timeout = TEST_TIMEOUT_DEFAULT, }; \
>  	static void __attribute__((constructor)) _register_##test_name(void) \
>  	{ \
>  		__register_test(&_##test_name##_object); \
>  	} \
>  	static void test_name( \
>  		struct __test_metadata __attribute__((unused)) *_metadata)
>  
>  /**
> - * FIXTURE_DATA(datatype_name) - Wraps the struct name so we have one less
> + * FIXTURE_DATA() - Wraps the struct name so we have one less
>   * argument to pass around
>   *
>   * @datatype_name: datatype name
>   *
>   * .. code-block:: c
>   *
>   *     FIXTURE_DATA(datatype_name)
>   *
>   * Almost always, you want just FIXTURE() instead (see below).
>   * This call may be used when the type of the fixture data
>   * is needed.  In general, this should not be needed unless
>   * the *self* is being passed to a helper directly.
>   */
>  #define FIXTURE_DATA(datatype_name) struct _test_data_##datatype_name
>  
>  /**
> - * FIXTURE(fixture_name) - Called once per fixture to setup the data and
> + * FIXTURE() - Called once per fixture to setup the data and
>   * register
>   *
>   * @fixture_name: fixture name
>   *
>   * .. code-block:: c
>   *
>   *     FIXTURE(fixture_name) {
>   *       type property1;
>   *       ...
>   *     };
>   *
>   * Defines the data provided to TEST_F()-defined tests as *self*.  It should be
>   * populated and cleaned up using FIXTURE_SETUP() and FIXTURE_TEARDOWN().
>   */
>  #define FIXTURE(fixture_name) \
>  	FIXTURE_VARIANT(fixture_name); \
>  	static struct __fixture_metadata _##fixture_name##_fixture_object = \
>  		{ .name =  #fixture_name, }; \
>  	static void __attribute__((constructor)) \
>  	_register_##fixture_name##_data(void) \
>  	{ \
>  		__register_fixture(&_##fixture_name##_fixture_object); \
>  	} \
>  	FIXTURE_DATA(fixture_name)
>  
>  /**
> - * FIXTURE_SETUP(fixture_name) - Prepares the setup function for the fixture.
> + * FIXTURE_SETUP() - Prepares the setup function for the fixture.
>   * *_metadata* is included so that EXPECT_* and ASSERT_* work correctly.
>   *
>   * @fixture_name: fixture name
>   *
>   * .. code-block:: c
>   *
>   *     FIXTURE_SETUP(fixture_name) { implementation }
>   *
>   * Populates the required "setup" function for a fixture.  An instance of the
>   * datatype defined with FIXTURE_DATA() will be exposed as *self* for the
>   * implementation.
>   *
>   * ASSERT_* are valid for use in this context and will prempt the execution
>   * of any dependent fixture tests.
>   *
>   * A bare "return;" statement may be used to return early.
>   */
>  #define FIXTURE_SETUP(fixture_name) \
>  	void fixture_name##_setup( \
>  		struct __test_metadata __attribute__((unused)) *_metadata, \
>  		FIXTURE_DATA(fixture_name) __attribute__((unused)) *self, \
>  		const FIXTURE_VARIANT(fixture_name) \
>  			__attribute__((unused)) *variant)
>  
>  /**
> - * FIXTURE_TEARDOWN(fixture_name)
> + * FIXTURE_TEARDOWN()
>   * *_metadata* is included so that EXPECT_* and ASSERT_* work correctly.
>   *
>   * @fixture_name: fixture name
>   *
>   * .. code-block:: c
>   *
>   *     FIXTURE_TEARDOWN(fixture_name) { implementation }
>   *
>   * Populates the required "teardown" function for a fixture.  An instance of the
>   * datatype defined with FIXTURE_DATA() will be exposed as *self* for the
>   * implementation to clean up.
>   *
>   * A bare "return;" statement may be used to return early.
>   */
>  #define FIXTURE_TEARDOWN(fixture_name) \
>  	void fixture_name##_teardown( \
>  		struct __test_metadata __attribute__((unused)) *_metadata, \
>  		FIXTURE_DATA(fixture_name) __attribute__((unused)) *self)
>  
>  /**
> - * FIXTURE_VARIANT(fixture_name) - Optionally called once per fixture
> + * FIXTURE_VARIANT() - Optionally called once per fixture
>   * to declare fixture variant
>   *
>   * @fixture_name: fixture name
>   *
>   * .. code-block:: c
>   *
>   *     FIXTURE_VARIANT(fixture_name) {
>   *       type property1;
>   *       ...
>   *     };
>   *
>   * Defines type of constant parameters provided to FIXTURE_SETUP() and TEST_F()
>   * as *variant*. Variants allow the same tests to be run with different
>   * arguments.
>   */
>  #define FIXTURE_VARIANT(fixture_name) struct _fixture_variant_##fixture_name
>  
>  /**
> - * FIXTURE_VARIANT_ADD(fixture_name, variant_name) - Called once per fixture
> + * FIXTURE_VARIANT_ADD() - Called once per fixture
>   * variant to setup and register the data
>   *
>   * @fixture_name: fixture name
>   * @variant_name: name of the parameter set
>   *
>   * .. code-block:: c
>   *
>   *     FIXTURE_VARIANT_ADD(fixture_name, variant_name) {
>   *       .property1 = val1,
>   *       ...
>   *     };
>   *
>   * Defines a variant of the test fixture, provided to FIXTURE_SETUP() and
>   * TEST_F() as *variant*. Tests of each fixture will be run once for each
>   * variant.
>   */
>  #define FIXTURE_VARIANT_ADD(fixture_name, variant_name) \
>  	extern FIXTURE_VARIANT(fixture_name) \
>  		_##fixture_name##_##variant_name##_variant; \
>  	static struct __fixture_variant_metadata \
>  		_##fixture_name##_##variant_name##_object = \
>  		{ .name = #variant_name, \
>  		  .data = &_##fixture_name##_##variant_name##_variant}; \
>  	static void __attribute__((constructor)) \
>  		_register_##fixture_name##_##variant_name(void) \
>  	{ \
>  		__register_fixture_variant(&_##fixture_name##_fixture_object, \
>  			&_##fixture_name##_##variant_name##_object);	\
>  	} \
>  	FIXTURE_VARIANT(fixture_name) \
>  		_##fixture_name##_##variant_name##_variant =
>  
>  /**
> - * TEST_F(fixture_name, test_name) - Emits test registration and helpers for
> + * TEST_F() - Emits test registration and helpers for
>   * fixture-based test cases
>   *
>   * @fixture_name: fixture name
>   * @test_name: test name
>   *
>   * .. code-block:: c
>   *
>   *     TEST_F(fixture, name) { implementation }
>   *
>   * Defines a test that depends on a fixture (e.g., is part of a test case).
>   * Very similar to TEST() except that *self* is the setup instance of fixture's
>   * datatype exposed for use by the implementation.
>   *
>   * Warning: use of ASSERT_* here will skip TEARDOWN.
>   */
>  /* TODO(wad) register fixtures on dedicated test lists. */
>  #define TEST_F(fixture_name, test_name) \
>  	__TEST_F_IMPL(fixture_name, test_name, -1, TEST_TIMEOUT_DEFAULT)
>  
>  #define TEST_F_SIGNAL(fixture_name, test_name, signal) \
>  	__TEST_F_IMPL(fixture_name, test_name, signal, TEST_TIMEOUT_DEFAULT)
>  
>  #define TEST_F_TIMEOUT(fixture_name, test_name, timeout) \
>  	__TEST_F_IMPL(fixture_name, test_name, -1, timeout)
>  
>  #define __TEST_F_IMPL(fixture_name, test_name, signal, tmout) \
>  	static void fixture_name##_##test_name( \
>  		struct __test_metadata *_metadata, \
>  		FIXTURE_DATA(fixture_name) *self, \
>  		const FIXTURE_VARIANT(fixture_name) *variant); \
>  	static inline void wrapper_##fixture_name##_##test_name( \
>  		struct __test_metadata *_metadata, \
> -- 
> 2.28.0
> 

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 15/16] refcount.h: fix a kernel-doc markup
  2020-12-01 12:09 ` [PATCH v5 15/16] refcount.h: fix a kernel-doc markup Mauro Carvalho Chehab
@ 2020-12-01 21:17   ` Kees Cook
  2020-12-02  8:14   ` Peter Zijlstra
  1 sibling, 0 replies; 31+ messages in thread
From: Kees Cook @ 2020-12-01 21:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Jonathan Corbet, Jann Horn,
	Peter Zijlstra, Will Deacon, linux-kernel

On Tue, Dec 01, 2020 at 01:09:08PM +0100, Mauro Carvalho Chehab wrote:
> The kernel-doc markup is wrong: it is asking the tool to document
> struct refcount_struct, instead of documenting typedef refcount_t.
> 
> Fix it.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Acked-by: Kees Cook <keescook@chromium.org>


-- 
Kees Cook

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 07/16] completion: drop init_completion define
  2020-12-01 14:03     ` Mauro Carvalho Chehab
@ 2020-12-02  8:13       ` Peter Zijlstra
  0 siblings, 0 replies; 31+ messages in thread
From: Peter Zijlstra @ 2020-12-02  8:13 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Jonathan Corbet, Joel Fernandes (Google),
	Davidlohr Bueso, Greg Kroah-Hartman, Ingo Molnar,
	Thomas Gleixner, linux-kernel

On Tue, Dec 01, 2020 at 03:03:01PM +0100, Mauro Carvalho Chehab wrote:

> [PATCH] completion: drop init_completion define
> 
> Changeset cd8084f91c02 ("locking/lockdep: Apply crossrelease to completions")
> added a CONFIG_LOCKDEP_COMPLETE (that was later renamed to
> CONFIG_LOCKDEP_COMPLETIONS).
> 
> Such changeset renamed the init_completion, and add a macro
> that would either run a modified version or the original code.
> 
> However, such code reported too many false positives. So, it
> ended being dropped later on by
> changeset e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks").
> 
> Yet, the define remained there as just:
> 
> 	 #define init_completion(x) __init_completion(x)
> 
> Get rid of the define, and return __init_completion() function
> to its original name.
> 
> Fixes: e966eaeeb623 ("locking/lockdep: Remove the cross-release locking checks")

Thanks! should show up in tip/locking/core soonish..

> diff --git a/include/linux/completion.h b/include/linux/completion.h
> index bf8e77001f18..51d9ab079629 100644
> --- a/include/linux/completion.h
> +++ b/include/linux/completion.h
> @@ -28,8 +28,7 @@ struct completion {
>  	struct swait_queue_head wait;
>  };
>  
> -#define init_completion_map(x, m) __init_completion(x)
> -#define init_completion(x) __init_completion(x)
> +#define init_completion_map(x, m) init_completion(x)
>  static inline void complete_acquire(struct completion *x) {}
>  static inline void complete_release(struct completion *x) {}
>  
> @@ -82,7 +81,7 @@ static inline void complete_release(struct completion *x) {}
>   * This inline function will initialize a dynamically created completion
>   * structure.
>   */
> -static inline void __init_completion(struct completion *x)
> +static inline void init_completion(struct completion *x)
>  {
>  	x->done = 0;
>  	init_swait_queue_head(&x->wait);
> 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 13/16] sched: fix kernel-doc markup
  2020-12-01 12:09 ` [PATCH v5 13/16] sched: fix " Mauro Carvalho Chehab
@ 2020-12-02  8:13   ` Peter Zijlstra
  2020-12-02 14:10   ` Thomas Gleixner
  1 sibling, 0 replies; 31+ messages in thread
From: Peter Zijlstra @ 2020-12-02  8:13 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Jonathan Corbet, Ben Segall,
	Daniel Bristot de Oliveira, Dietmar Eggemann, Ingo Molnar,
	Juri Lelli, Mel Gorman, Steven Rostedt, Vincent Guittot,
	linux-kernel

On Tue, Dec 01, 2020 at 01:09:06PM +0100, Mauro Carvalho Chehab wrote:
> Kernel-doc requires that a kernel-doc markup to be immediately
> below the function prototype, as otherwise it will rename it.
> So, move sys_sched_yield() markup to the right place.
> 
> Also fix the cpu_util() markup: Kernel-doc markups
> should use this format:
>         identifier - description
> 
> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Thanks!

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 15/16] refcount.h: fix a kernel-doc markup
  2020-12-01 12:09 ` [PATCH v5 15/16] refcount.h: fix a kernel-doc markup Mauro Carvalho Chehab
  2020-12-01 21:17   ` Kees Cook
@ 2020-12-02  8:14   ` Peter Zijlstra
  1 sibling, 0 replies; 31+ messages in thread
From: Peter Zijlstra @ 2020-12-02  8:14 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Jonathan Corbet, Jann Horn, Kees Cook,
	Will Deacon, linux-kernel

On Tue, Dec 01, 2020 at 01:09:08PM +0100, Mauro Carvalho Chehab wrote:
> The kernel-doc markup is wrong: it is asking the tool to document
> struct refcount_struct, instead of documenting typedef refcount_t.
> 
> Fix it.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Thanks!

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 13/16] sched: fix kernel-doc markup
  2020-12-01 12:09 ` [PATCH v5 13/16] sched: fix " Mauro Carvalho Chehab
  2020-12-02  8:13   ` Peter Zijlstra
@ 2020-12-02 14:10   ` Thomas Gleixner
  1 sibling, 0 replies; 31+ messages in thread
From: Thomas Gleixner @ 2020-12-02 14:10 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Ben Segall, Daniel Bristot de Oliveira,
	Dietmar Eggemann, Ingo Molnar, Juri Lelli, Mel Gorman,
	Peter Zijlstra, Steven Rostedt, Vincent Guittot, linux-kernel

On Tue, Dec 01 2020 at 13:09, Mauro Carvalho Chehab wrote:

> Kernel-doc requires that a kernel-doc markup to be immediately
> below the function prototype, as otherwise it will rename it.

below?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 01/16] HSI: fix a kernel-doc markup
  2020-12-01 12:08 ` [PATCH v5 01/16] HSI: fix a kernel-doc markup Mauro Carvalho Chehab
@ 2020-12-02 21:38   ` Sebastian Reichel
  0 siblings, 0 replies; 31+ messages in thread
From: Sebastian Reichel @ 2020-12-02 21:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Jonathan Corbet, linux-kernel

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

Hi,

On Tue, Dec 01, 2020 at 01:08:54PM +0100, Mauro Carvalho Chehab wrote:
> A function has a different name between their prototype
> and its kernel-doc markup.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---

Thanks, queued to HSI tree.

-- Sebastian

> [...]
>  /**
> - * hsi_unregister_port - Unregister an HSI port
> + * hsi_port_unregister_clients - Unregister an HSI port
>   * @port: The HSI port to unregister
>   */
>  void hsi_port_unregister_clients(struct hsi_port *port)
>  {
>  	device_for_each_child(&port->device, NULL, hsi_remove_client);
>  }
>  EXPORT_SYMBOL_GPL(hsi_port_unregister_clients);
> [...]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v5 02/16] IB: fix kernel-doc markups
  2020-12-01 12:08 ` [PATCH v5 02/16] IB: fix kernel-doc markups Mauro Carvalho Chehab
@ 2020-12-07 19:46   ` Jason Gunthorpe
  0 siblings, 0 replies; 31+ messages in thread
From: Jason Gunthorpe @ 2020-12-07 19:46 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Jonathan Corbet, Gustavo A. R. Silva,
	Håkon Bugge, Bart Van Assche, Chuck Lever,
	Dennis Dalessandro, Divya Indi, Doug Ledford, Gal Pressman,
	Leon Romanovsky, Maor Gottlieb, Max Gurtovoy, Mike Marciniszyn,
	Moni Shoua, Parav Pandit, Sagi Grimberg, Ursula Braun, Xi Wang,
	Yamin Friedman, linux-kernel, linux-rdma, target-devel

On Tue, Dec 01, 2020 at 01:08:55PM +0100, Mauro Carvalho Chehab wrote:
> Some functions have different names between their prototypes
> and the kernel-doc markup.
> 
> Others need to be fixed, as kernel-doc markups should use this format:
>         identifier - description
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  drivers/infiniband/core/cm.c                         |  5 +++--
>  drivers/infiniband/core/cq.c                         |  4 ++--
>  drivers/infiniband/core/iwpm_util.h                  |  2 +-
>  drivers/infiniband/core/sa_query.c                   |  3 ++-
>  drivers/infiniband/core/verbs.c                      |  4 ++--
>  drivers/infiniband/sw/rdmavt/ah.c                    |  2 +-
>  drivers/infiniband/sw/rdmavt/mcast.c                 | 12 ++++++------
>  drivers/infiniband/sw/rdmavt/qp.c                    |  8 ++++----
>  drivers/infiniband/ulp/iser/iscsi_iser.c             |  2 +-
>  drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h     |  2 +-
>  .../infiniband/ulp/opa_vnic/opa_vnic_vema_iface.c    |  2 +-
>  drivers/infiniband/ulp/srpt/ib_srpt.h                |  2 +-
>  include/rdma/ib_verbs.h                              | 11 +++++++++++
>  13 files changed, 36 insertions(+), 23 deletions(-)

I've taken this to the RDMA tree, thanks

Jason

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2020-12-07 19:47 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 12:08 [PATCH v5 00/16]Fix several bad kernel-doc markups Mauro Carvalho Chehab
2020-12-01 12:08 ` [PATCH v5 01/16] HSI: fix a kernel-doc markup Mauro Carvalho Chehab
2020-12-02 21:38   ` Sebastian Reichel
2020-12-01 12:08 ` [PATCH v5 02/16] IB: fix kernel-doc markups Mauro Carvalho Chehab
2020-12-07 19:46   ` Jason Gunthorpe
2020-12-01 12:08 ` [PATCH v5 03/16] parport: fix a kernel-doc markup Mauro Carvalho Chehab
2020-12-01 12:08 ` [PATCH v5 04/16] rapidio: fix kernel-doc a markup Mauro Carvalho Chehab
2020-12-01 12:08 ` [PATCH v5 05/16] fs: fix kernel-doc markups Mauro Carvalho Chehab
2020-12-01 12:43   ` Christoph Hellwig
2020-12-01 14:06     ` Mauro Carvalho Chehab
2020-12-01 12:08 ` [PATCH v5 06/16] pstore/zone: fix a kernel-doc markup Mauro Carvalho Chehab
2020-12-01 12:09 ` [PATCH v5 07/16] completion: drop init_completion define Mauro Carvalho Chehab
2020-12-01 12:54   ` Peter Zijlstra
2020-12-01 14:03     ` Mauro Carvalho Chehab
2020-12-02  8:13       ` Peter Zijlstra
2020-12-01 12:09 ` [PATCH v5 08/16] firmware: stratix10-svc: fix kernel-doc markups Mauro Carvalho Chehab
2020-12-01 12:09 ` [PATCH v5 09/16] connector: fix a kernel-doc markup Mauro Carvalho Chehab
2020-12-01 12:09 ` [PATCH v5 10/16] lib/crc7: " Mauro Carvalho Chehab
2020-12-01 12:09 ` [PATCH v5 11/16] memblock: fix kernel-doc markups Mauro Carvalho Chehab
2020-12-01 12:09 ` [PATCH v5 12/16] w1: fix a kernel-doc markup Mauro Carvalho Chehab
2020-12-01 12:09 ` [PATCH v5 13/16] sched: fix " Mauro Carvalho Chehab
2020-12-02  8:13   ` Peter Zijlstra
2020-12-02 14:10   ` Thomas Gleixner
2020-12-01 12:09 ` [PATCH v5 14/16] selftests: kselftest_harness.h: partially fix kernel-doc markups Mauro Carvalho Chehab
2020-12-01 21:17   ` Kees Cook
2020-12-01 12:09 ` [PATCH v5 15/16] refcount.h: fix a kernel-doc markup Mauro Carvalho Chehab
2020-12-01 21:17   ` Kees Cook
2020-12-02  8:14   ` Peter Zijlstra
2020-12-01 12:09 ` [PATCH v5 16/16] scripts: kernel-doc: validate kernel-doc markup with the actual names Mauro Carvalho Chehab
2020-12-01 15:06   ` kernel test robot
2020-12-01 15:25   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).