Re: [PATCH v9 04/25] RDMA/rtrs: core: lib functions shared between client and server modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 1, 2020 at 1:47 AM Bart Van Assche <bvanassche@xxxxxxx> wrote:
>
> On 2020-02-21 02:47, Jack Wang wrote:
> > +     wr = (struct ib_recv_wr) {
> > +     .wr_cqe  = &iu->cqe,
> > +     .sg_list = &list,
> > +     .num_sge = 1,
> > +     };
>
> The indentation of the above code looks weird to me.
>
> > +     wr = (struct ib_recv_wr) {
> > +     .wr_cqe  = cqe,
> > +     };
>
> Same comment here.
>
> > +     wr = (struct ib_send_wr) {
> > +     .wr_cqe     = &iu->cqe,
> > +     .sg_list    = &list,
> > +     .num_sge    = 1,
> > +     .opcode     = IB_WR_SEND,
> > +     .send_flags = IB_SEND_SIGNALED,
> > +     };
>
> And here.
>
> > +     wr = (struct ib_rdma_wr) {
> > +     .wr.wr_cqe        = &iu->cqe,
> > +     .wr.sg_list       = sge,
> > +     .wr.num_sge       = num_sge,
> > +     .rkey             = rkey,
> > +     .remote_addr      = rdma_addr,
> > +     .wr.opcode        = IB_WR_RDMA_WRITE_WITH_IMM,
> > +     .wr.ex.imm_data = cpu_to_be32(imm_data),
> > +     .wr.send_flags  = flags,
> > +     };
>
> And here too.
>
> > +     /*
> > +      * If one of the sges has 0 size, the operation will fail with an
> > +      * length error
> > +      */
>
> "an length error" -> "a length error"?
>
> > +     wr = (struct ib_send_wr) {
> > +     .wr_cqe = cqe,
> > +     .send_flags     = flags,
> > +     .opcode = IB_WR_RDMA_WRITE_WITH_IMM,
> > +     .ex.imm_data    = cpu_to_be32(imm_data),
> > +     };
>
> Please indent struct members.
>
> > +int sockaddr_to_str(const struct sockaddr *addr, char *buf, size_t len)
> > +{
> > +     int cnt;
> > +
> > +     switch (addr->sa_family) {
> > +     case AF_IB:
> > +             cnt = scnprintf(buf, len, "gid:%pI6",
> > +                     &((struct sockaddr_ib *)addr)->sib_addr.sib_raw);
> > +             return cnt;
> > +     case AF_INET:
> > +             cnt = scnprintf(buf, len, "ip:%pI4",
> > +                     &((struct sockaddr_in *)addr)->sin_addr);
> > +             return cnt;
> > +     case AF_INET6:
> > +             cnt = scnprintf(buf, len, "ip:%pI6c",
> > +                       &((struct sockaddr_in6 *)addr)->sin6_addr);
> > +             return cnt;
> > +     }
> > +     cnt = scnprintf(buf, len, "<invalid address family>");
> > +     pr_err("Invalid address family\n");
> > +     return cnt;
> > +}
> > +EXPORT_SYMBOL(sockaddr_to_str);
>
> Please remove the 'cnt' variable from the above function.
>
> Thanks,
>
> Bart.

Will fix them all,

Thanks!



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux