Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc fixes for qrild #21

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/qmi_tlv.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ struct qmi_tlv *qmi_tlv_init(uint16_t txn, uint32_t msg_id, uint32_t msg_type)

struct qmi_tlv *qmi_tlv_decode(void *buf, size_t len)
{
struct qmi_header *pkt = buf;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash this commit into the previous one.

struct qmi_tlv *tlv;

tlv = malloc(sizeof(struct qmi_tlv));
Expand Down Expand Up @@ -247,13 +246,13 @@ void qmi_tlv_dump(struct qmi_tlv *tlv) {
char line[LINE_LENGTH * 4 + 1];

pkt = tlv->buf;
pkt_data = &pkt[1];
pkt_data = &pkt[0];

printf("<<< Message:\n");
printf("<<< type : %u\n", pkt->type);
printf("<<< msg_len : %u\n", pkt->msg_len);
printf("<<< msg_id : 0x%04x\n", pkt->msg_id);
printf("<<< txn_id : %u\n", pkt->txn_id);
printf("<<< msg_len : 0x%1$04x (%1$u)\n", pkt->msg_len);
printf("<<< msg_id : 0x%1$04x (%1$u)\n", pkt->msg_id);
printf("<<< txn_id : 0x%1$04x (%1$u)\n", pkt->txn_id);
printf("<<< TLVs:\n");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pass struct FILE to the function and use fprintf + fflush at the end.

while (offset < tlv->size - sizeof(struct qmi_header)) {
item = pkt_data + offset;
Expand Down