Skip to content

Commit 3f330db

Browse files
committed
net: reformat kdoc return statements
kernel-doc -Wall warns about missing Return: statement for non-void functions. We have a number of kdocs in our headers which are missing the colon, IOW they use * Return some value or * Returns some value Having the colon makes some sense, it should help kdoc parser avoid false positives. So add them. This is mostly done with a sed script, and removing the unnecessary cases (mostly the comments which aren't kdoc). Acked-by: Johannes Berg <[email protected]> Acked-by: Richard Cochran <[email protected]> Acked-by: Sergey Ryazanov <[email protected]> Reviewed-by: Edward Cree <[email protected]> Acked-by: Alexandra Winter <[email protected]> Acked-by: Pablo Neira Ayuso <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ca78588 commit 3f330db

File tree

21 files changed

+101
-101
lines changed

21 files changed

+101
-101
lines changed

include/linux/etherdevice.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static const u8 eth_ipv6_mcast_addr_base[ETH_ALEN] __aligned(2) =
8181
* is_link_local_ether_addr - Determine if given Ethernet address is link-local
8282
* @addr: Pointer to a six-byte array containing the Ethernet address
8383
*
84-
* Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
84+
* Return: true if address is link local reserved addr (01:80:c2:00:00:0X) per
8585
* IEEE 802.1Q 8.6.3 Frame filtering.
8686
*
8787
* Please note: addr must be aligned to u16.
@@ -104,7 +104,7 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
104104
* is_zero_ether_addr - Determine if give Ethernet address is all zeros.
105105
* @addr: Pointer to a six-byte array containing the Ethernet address
106106
*
107-
* Return true if the address is all zeroes.
107+
* Return: true if the address is all zeroes.
108108
*
109109
* Please note: addr must be aligned to u16.
110110
*/
@@ -123,7 +123,7 @@ static inline bool is_zero_ether_addr(const u8 *addr)
123123
* is_multicast_ether_addr - Determine if the Ethernet address is a multicast.
124124
* @addr: Pointer to a six-byte array containing the Ethernet address
125125
*
126-
* Return true if the address is a multicast address.
126+
* Return: true if the address is a multicast address.
127127
* By definition the broadcast address is also a multicast address.
128128
*/
129129
static inline bool is_multicast_ether_addr(const u8 *addr)
@@ -157,7 +157,7 @@ static inline bool is_multicast_ether_addr_64bits(const u8 *addr)
157157
* is_local_ether_addr - Determine if the Ethernet address is locally-assigned one (IEEE 802).
158158
* @addr: Pointer to a six-byte array containing the Ethernet address
159159
*
160-
* Return true if the address is a local address.
160+
* Return: true if the address is a local address.
161161
*/
162162
static inline bool is_local_ether_addr(const u8 *addr)
163163
{
@@ -168,7 +168,7 @@ static inline bool is_local_ether_addr(const u8 *addr)
168168
* is_broadcast_ether_addr - Determine if the Ethernet address is broadcast
169169
* @addr: Pointer to a six-byte array containing the Ethernet address
170170
*
171-
* Return true if the address is the broadcast address.
171+
* Return: true if the address is the broadcast address.
172172
*
173173
* Please note: addr must be aligned to u16.
174174
*/
@@ -183,7 +183,7 @@ static inline bool is_broadcast_ether_addr(const u8 *addr)
183183
* is_unicast_ether_addr - Determine if the Ethernet address is unicast
184184
* @addr: Pointer to a six-byte array containing the Ethernet address
185185
*
186-
* Return true if the address is a unicast address.
186+
* Return: true if the address is a unicast address.
187187
*/
188188
static inline bool is_unicast_ether_addr(const u8 *addr)
189189
{
@@ -197,7 +197,7 @@ static inline bool is_unicast_ether_addr(const u8 *addr)
197197
* Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
198198
* a multicast address, and is not FF:FF:FF:FF:FF:FF.
199199
*
200-
* Return true if the address is valid.
200+
* Return: true if the address is valid.
201201
*
202202
* Please note: addr must be aligned to u16.
203203
*/
@@ -214,7 +214,7 @@ static inline bool is_valid_ether_addr(const u8 *addr)
214214
*
215215
* Check that the value from the Ethertype/length field is a valid Ethertype.
216216
*
217-
* Return true if the valid is an 802.3 supported Ethertype.
217+
* Return: true if the valid is an 802.3 supported Ethertype.
218218
*/
219219
static inline bool eth_proto_is_802_3(__be16 proto)
220220
{
@@ -458,7 +458,7 @@ static inline bool ether_addr_is_ip_mcast(const u8 *addr)
458458
* ether_addr_to_u64 - Convert an Ethernet address into a u64 value.
459459
* @addr: Pointer to a six-byte array containing the Ethernet address
460460
*
461-
* Return a u64 value of the address
461+
* Return: a u64 value of the address
462462
*/
463463
static inline u64 ether_addr_to_u64(const u8 *addr)
464464
{

include/linux/ethtool.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ struct ethtool_link_ksettings {
257257
* @mode : one of the ETHTOOL_LINK_MODE_*_BIT
258258
* (not atomic, no bound checking)
259259
*
260-
* Returns true/false.
260+
* Returns: true/false.
261261
*/
262262
#define ethtool_link_ksettings_test_link_mode(ptr, name, mode) \
263263
test_bit(ETHTOOL_LINK_MODE_ ## mode ## _BIT, (ptr)->link_modes.name)
@@ -1199,7 +1199,7 @@ ethtool_params_from_link_mode(struct ethtool_link_ksettings *link_ksettings,
11991199
* @dev: pointer to net_device structure
12001200
* @vclock_index: pointer to pointer of vclock index
12011201
*
1202-
* Return number of phc vclocks
1202+
* Return: number of phc vclocks
12031203
*/
12041204
int ethtool_get_phc_vclocks(struct net_device *dev, int **vclock_index);
12051205

@@ -1253,7 +1253,7 @@ static inline int ethtool_mm_frag_size_min_to_add(u32 val_min, u32 *val_add,
12531253
* ethtool_get_ts_info_by_layer - Obtains time stamping capabilities from the MAC or PHY layer.
12541254
* @dev: pointer to net_device structure
12551255
* @info: buffer to hold the result
1256-
* Returns zero on success, non-zero otherwise.
1256+
* Returns: zero on success, non-zero otherwise.
12571257
*/
12581258
int ethtool_get_ts_info_by_layer(struct net_device *dev,
12591259
struct kernel_ethtool_ts_info *info);

include/linux/if_vlan.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ static inline bool vlan_uses_dev(const struct net_device *dev)
310310
* eth_type_vlan - check for valid vlan ether type.
311311
* @ethertype: ether type to check
312312
*
313-
* Returns true if the ether type is a vlan ether type.
313+
* Returns: true if the ether type is a vlan ether type.
314314
*/
315315
static inline bool eth_type_vlan(__be16 ethertype)
316316
{
@@ -341,9 +341,9 @@ static inline bool vlan_hw_offload_capable(netdev_features_t features,
341341
* @mac_len: MAC header length including outer vlan headers
342342
*
343343
* Inserts the VLAN tag into @skb as part of the payload at offset mac_len
344-
* Returns error if skb_cow_head fails.
345-
*
346344
* Does not change skb->protocol so this function can be used during receive.
345+
*
346+
* Returns: error if skb_cow_head fails.
347347
*/
348348
static inline int __vlan_insert_inner_tag(struct sk_buff *skb,
349349
__be16 vlan_proto, u16 vlan_tci,
@@ -390,9 +390,9 @@ static inline int __vlan_insert_inner_tag(struct sk_buff *skb,
390390
* @vlan_tci: VLAN TCI to insert
391391
*
392392
* Inserts the VLAN tag into @skb as part of the payload
393-
* Returns error if skb_cow_head fails.
394-
*
395393
* Does not change skb->protocol so this function can be used during receive.
394+
*
395+
* Returns: error if skb_cow_head fails.
396396
*/
397397
static inline int __vlan_insert_tag(struct sk_buff *skb,
398398
__be16 vlan_proto, u16 vlan_tci)
@@ -533,7 +533,7 @@ static inline void __vlan_hwaccel_put_tag(struct sk_buff *skb,
533533
* @skb: skbuff to query
534534
* @vlan_tci: buffer to store value
535535
*
536-
* Returns error if the skb is not of VLAN type
536+
* Returns: error if the skb is not of VLAN type
537537
*/
538538
static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
539539
{
@@ -551,7 +551,7 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
551551
* @skb: skbuff to query
552552
* @vlan_tci: buffer to store value
553553
*
554-
* Returns error if @skb->vlan_tci is not set correctly
554+
* Returns: error if @skb->vlan_tci is not set correctly
555555
*/
556556
static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
557557
u16 *vlan_tci)
@@ -570,7 +570,7 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
570570
* @skb: skbuff to query
571571
* @vlan_tci: buffer to store value
572572
*
573-
* Returns error if the skb is not VLAN tagged
573+
* Returns: error if the skb is not VLAN tagged
574574
*/
575575
static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
576576
{
@@ -587,7 +587,7 @@ static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
587587
* @type: first vlan protocol
588588
* @depth: buffer to store length of eth and vlan tags in bytes
589589
*
590-
* Returns the EtherType of the packet, regardless of whether it is
590+
* Returns: the EtherType of the packet, regardless of whether it is
591591
* vlan encapsulated (normal or hardware accelerated) or not.
592592
*/
593593
static inline __be16 __vlan_get_protocol(const struct sk_buff *skb, __be16 type,
@@ -629,7 +629,7 @@ static inline __be16 __vlan_get_protocol(const struct sk_buff *skb, __be16 type,
629629
* vlan_get_protocol - get protocol EtherType.
630630
* @skb: skbuff to query
631631
*
632-
* Returns the EtherType of the packet, regardless of whether it is
632+
* Returns: the EtherType of the packet, regardless of whether it is
633633
* vlan encapsulated (normal or hardware accelerated) or not.
634634
*/
635635
static inline __be16 vlan_get_protocol(const struct sk_buff *skb)
@@ -710,7 +710,7 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb,
710710
* Expects the skb to contain a VLAN tag in the payload, and to have skb->data
711711
* pointing at the MAC header.
712712
*
713-
* Returns a new pointer to skb->data, or NULL on failure to pull.
713+
* Returns: a new pointer to skb->data, or NULL on failure to pull.
714714
*/
715715
static inline void *vlan_remove_tag(struct sk_buff *skb, u16 *vlan_tci)
716716
{
@@ -727,7 +727,7 @@ static inline void *vlan_remove_tag(struct sk_buff *skb, u16 *vlan_tci)
727727
* skb_vlan_tagged - check if skb is vlan tagged.
728728
* @skb: skbuff to query
729729
*
730-
* Returns true if the skb is tagged, regardless of whether it is hardware
730+
* Returns: true if the skb is tagged, regardless of whether it is hardware
731731
* accelerated or not.
732732
*/
733733
static inline bool skb_vlan_tagged(const struct sk_buff *skb)
@@ -743,7 +743,7 @@ static inline bool skb_vlan_tagged(const struct sk_buff *skb)
743743
* skb_vlan_tagged_multi - check if skb is vlan tagged with multiple headers.
744744
* @skb: skbuff to query
745745
*
746-
* Returns true if the skb is tagged with multiple vlan headers, regardless
746+
* Returns: true if the skb is tagged with multiple vlan headers, regardless
747747
* of whether it is hardware accelerated or not.
748748
*/
749749
static inline bool skb_vlan_tagged_multi(struct sk_buff *skb)
@@ -774,7 +774,7 @@ static inline bool skb_vlan_tagged_multi(struct sk_buff *skb)
774774
* @skb: skbuff to query
775775
* @features: features to be checked
776776
*
777-
* Returns features without unsafe ones if the skb has multiple tags.
777+
* Returns: features without unsafe ones if the skb has multiple tags.
778778
*/
779779
static inline netdev_features_t vlan_features_check(struct sk_buff *skb,
780780
netdev_features_t features)

include/linux/netdevice.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ static inline bool napi_prefer_busy_poll(struct napi_struct *n)
509509
* is scheduled for example in the context of delayed timer
510510
* that can be skipped if a NAPI is already scheduled.
511511
*
512-
* Return True if NAPI is scheduled, False otherwise.
512+
* Return: True if NAPI is scheduled, False otherwise.
513513
*/
514514
static inline bool napi_is_scheduled(struct napi_struct *n)
515515
{
@@ -524,7 +524,7 @@ bool napi_schedule_prep(struct napi_struct *n);
524524
*
525525
* Schedule NAPI poll routine to be called if it is not already
526526
* running.
527-
* Return true if we schedule a NAPI or false if not.
527+
* Return: true if we schedule a NAPI or false if not.
528528
* Refer to napi_schedule_prep() for additional reason on why
529529
* a NAPI might not be scheduled.
530530
*/
@@ -558,7 +558,7 @@ static inline void napi_schedule_irqoff(struct napi_struct *n)
558558
* Mark NAPI processing as complete. Should only be called if poll budget
559559
* has not been completely consumed.
560560
* Prefer over napi_complete().
561-
* Return false if device should avoid rearming interrupts.
561+
* Return: false if device should avoid rearming interrupts.
562562
*/
563563
bool napi_complete_done(struct napi_struct *n, int work_done);
564564

@@ -3851,7 +3851,7 @@ static inline bool netif_attr_test_mask(unsigned long j,
38513851
* @online_mask: bitmask for CPUs/Rx queues that are online
38523852
* @nr_bits: number of bits in the bitmask
38533853
*
3854-
* Returns true if a CPU/Rx queue is online.
3854+
* Returns: true if a CPU/Rx queue is online.
38553855
*/
38563856
static inline bool netif_attr_test_online(unsigned long j,
38573857
const unsigned long *online_mask,
@@ -3871,7 +3871,8 @@ static inline bool netif_attr_test_online(unsigned long j,
38713871
* @srcp: the cpumask/Rx queue mask pointer
38723872
* @nr_bits: number of bits in the bitmask
38733873
*
3874-
* Returns >= nr_bits if no further CPUs/Rx queues set.
3874+
* Returns: next (after n) CPU/Rx queue index in the mask;
3875+
* >= nr_bits if no further CPUs/Rx queues set.
38753876
*/
38763877
static inline unsigned int netif_attrmask_next(int n, const unsigned long *srcp,
38773878
unsigned int nr_bits)
@@ -3893,7 +3894,8 @@ static inline unsigned int netif_attrmask_next(int n, const unsigned long *srcp,
38933894
* @src2p: the second CPUs/Rx queues mask pointer
38943895
* @nr_bits: number of bits in the bitmask
38953896
*
3896-
* Returns >= nr_bits if no further CPUs/Rx queues set in both.
3897+
* Returns: next (after n) CPU/Rx queue index set in both masks;
3898+
* >= nr_bits if no further CPUs/Rx queues set in both.
38973899
*/
38983900
static inline int netif_attrmask_next_and(int n, const unsigned long *src1p,
38993901
const unsigned long *src2p,

include/linux/netfilter/x_tables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ extern struct static_key xt_tee_enabled;
357357
* Begin packet processing : all readers must wait the end
358358
* 1) Must be called with preemption disabled
359359
* 2) softirqs must be disabled too (or we should use this_cpu_add())
360-
* Returns :
360+
* Returns:
361361
* 1 if no recursion on this cpu
362362
* 0 if recursion detected
363363
*/

include/linux/netfilter_netdev.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ static inline bool nf_hook_egress_active(void)
6666
* @rc: result code which shall be returned by __dev_queue_xmit() on failure
6767
* @dev: netdev whose egress hooks shall be applied to @skb
6868
*
69-
* Returns @skb on success or %NULL if the packet was consumed or filtered.
7069
* Caller must hold rcu_read_lock.
7170
*
7271
* On ingress, packets are classified first by tc, then by netfilter.
@@ -81,6 +80,8 @@ static inline bool nf_hook_egress_active(void)
8180
* called recursively by tunnel drivers such as vxlan, the flag is reverted to
8281
* false after sch_handle_egress(). This ensures that netfilter is applied
8382
* both on the overlay and underlying network.
83+
*
84+
* Returns: @skb on success or %NULL if the packet was consumed or filtered.
8485
*/
8586
static inline struct sk_buff *nf_hook_egress(struct sk_buff *skb, int *rc,
8687
struct net_device *dev)

include/linux/ptp_clock_kernel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static inline u64 adjust_by_scaled_ppm(u64 base, long scaled_ppm)
307307
* @info: Structure describing the new clock.
308308
* @parent: Pointer to the parent device of the new clock.
309309
*
310-
* Returns a valid pointer on success or PTR_ERR on failure. If PHC
310+
* Returns: a valid pointer on success or PTR_ERR on failure. If PHC
311311
* support is missing at the configuration level, this function
312312
* returns NULL, and drivers are expected to gracefully handle that
313313
* case separately.
@@ -445,7 +445,7 @@ int ptp_get_vclocks_index(int pclock_index, int **vclock_index);
445445
* @hwtstamp: timestamp
446446
* @vclock_index: phc index of ptp vclock.
447447
*
448-
* Returns converted timestamp, or 0 on error.
448+
* Returns: converted timestamp, or 0 on error.
449449
*/
450450
ktime_t ptp_convert_timestamp(const ktime_t *hwtstamp, int vclock_index);
451451
#else

include/linux/rfkill.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ bool rfkill_soft_blocked(struct rfkill *rfkill);
241241
* rfkill_find_type - Helper for finding rfkill type by name
242242
* @name: the name of the type
243243
*
244-
* Returns enum rfkill_type that corresponds to the name.
244+
* Returns: enum rfkill_type that corresponds to the name.
245245
*/
246246
enum rfkill_type rfkill_find_type(const char *name);
247247

include/linux/rtnetlink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static inline bool lockdep_rtnl_is_held(void)
7878
* rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL
7979
* @p: The pointer to read, prior to dereferencing
8080
*
81-
* Return the value of the specified RCU-protected pointer, but omit
81+
* Return: the value of the specified RCU-protected pointer, but omit
8282
* the READ_ONCE(), because caller holds RTNL.
8383
*/
8484
#define rtnl_dereference(p) \

0 commit comments

Comments
 (0)