mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 04:09:18 -04:00
Merge branch 'rds-fix-semantic-annotations'
Ujwal Kundur says: ==================== rds: Fix semantic annotations This patchset addresses all semantic warnings flagged by Sparse for net/rds. v1:https://lore.kernel.org/20250810171155.3263-1-ujwal.kundur@gmail.com ==================== Link: https://patch.msgid.link/20250820175550.498-1-ujwal.kundur@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -242,7 +242,7 @@ static __poll_t rds_poll(struct file *file, struct socket *sock,
|
||||
if (rs->rs_snd_bytes < rds_sk_sndbuf(rs))
|
||||
mask |= (EPOLLOUT | EPOLLWRNORM);
|
||||
if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
|
||||
mask |= POLLERR;
|
||||
mask |= EPOLLERR;
|
||||
read_unlock_irqrestore(&rs->rs_recv_lock, flags);
|
||||
|
||||
/* clear state any time we wake a seen-congested socket */
|
||||
|
||||
@@ -57,16 +57,17 @@ static struct hlist_head *rds_conn_bucket(const struct in6_addr *laddr,
|
||||
static u32 rds6_hash_secret __read_mostly;
|
||||
static u32 rds_hash_secret __read_mostly;
|
||||
|
||||
u32 lhash, fhash, hash;
|
||||
__be32 lhash, fhash;
|
||||
u32 hash;
|
||||
|
||||
net_get_random_once(&rds_hash_secret, sizeof(rds_hash_secret));
|
||||
net_get_random_once(&rds6_hash_secret, sizeof(rds6_hash_secret));
|
||||
|
||||
lhash = (__force u32)laddr->s6_addr32[3];
|
||||
lhash = laddr->s6_addr32[3];
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
fhash = __ipv6_addr_jhash(faddr, rds6_hash_secret);
|
||||
fhash = (__force __be32)__ipv6_addr_jhash(faddr, rds6_hash_secret);
|
||||
#else
|
||||
fhash = (__force u32)faddr->s6_addr32[3];
|
||||
fhash = faddr->s6_addr32[3];
|
||||
#endif
|
||||
hash = __inet_ehashfn(lhash, 0, fhash, 0, rds_hash_secret);
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ static unsigned int rds_exthdr_size[__RDS_EXTHDR_MAX] = {
|
||||
[RDS_EXTHDR_VERSION] = sizeof(struct rds_ext_header_version),
|
||||
[RDS_EXTHDR_RDMA] = sizeof(struct rds_ext_header_rdma),
|
||||
[RDS_EXTHDR_RDMA_DEST] = sizeof(struct rds_ext_header_rdma_dest),
|
||||
[RDS_EXTHDR_NPATHS] = sizeof(u16),
|
||||
[RDS_EXTHDR_GEN_NUM] = sizeof(u32),
|
||||
[RDS_EXTHDR_NPATHS] = sizeof(__be16),
|
||||
[RDS_EXTHDR_GEN_NUM] = sizeof(__be32),
|
||||
};
|
||||
|
||||
void rds_message_addref(struct rds_message *rm)
|
||||
|
||||
@@ -93,7 +93,7 @@ enum {
|
||||
|
||||
/* Max number of multipaths per RDS connection. Must be a power of 2 */
|
||||
#define RDS_MPATH_WORKERS 8
|
||||
#define RDS_MPATH_HASH(rs, n) (jhash_1word((rs)->rs_bound_port, \
|
||||
#define RDS_MPATH_HASH(rs, n) (jhash_1word(ntohs((rs)->rs_bound_port), \
|
||||
(rs)->rs_hash_initval) & ((n) - 1))
|
||||
|
||||
#define IS_CANONICAL(laddr, faddr) (htonl(laddr) < htonl(faddr))
|
||||
|
||||
@@ -202,8 +202,8 @@ static void rds_recv_hs_exthdrs(struct rds_header *hdr,
|
||||
unsigned int pos = 0, type, len;
|
||||
union {
|
||||
struct rds_ext_header_version version;
|
||||
u16 rds_npaths;
|
||||
u32 rds_gen_num;
|
||||
__be16 rds_npaths;
|
||||
__be32 rds_gen_num;
|
||||
} buffer;
|
||||
u32 new_peer_gen_num = 0;
|
||||
|
||||
|
||||
@@ -1454,8 +1454,8 @@ rds_send_probe(struct rds_conn_path *cp, __be16 sport,
|
||||
|
||||
if (RDS_HS_PROBE(be16_to_cpu(sport), be16_to_cpu(dport)) &&
|
||||
cp->cp_conn->c_trans->t_mp_capable) {
|
||||
u16 npaths = cpu_to_be16(RDS_MPATH_WORKERS);
|
||||
u32 my_gen_num = cpu_to_be32(cp->cp_conn->c_my_gen_num);
|
||||
__be16 npaths = cpu_to_be16(RDS_MPATH_WORKERS);
|
||||
__be32 my_gen_num = cpu_to_be32(cp->cp_conn->c_my_gen_num);
|
||||
|
||||
rds_message_add_extension(&rm->m_inc.i_hdr,
|
||||
RDS_EXTHDR_NPATHS, &npaths,
|
||||
|
||||
Reference in New Issue
Block a user