X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fiscsi%2Fpdu.c;h=819065e71800f29a3df4d383ff0b933c6d19fffa;hb=cdffdf5d61f8330cfc3467e73a84876eb3928e9b;hp=e073ebab198b1a3ed4ed8a61904853d9023c2747;hpb=cb522f25cada0d3429c69d0fbaa5bd337a422cdd;p=ccan diff --git a/ccan/iscsi/pdu.c b/ccan/iscsi/pdu.c index e073ebab..819065e7 100644 --- a/ccan/iscsi/pdu.c +++ b/ccan/iscsi/pdu.c @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2010 by Ronnie Sahlberg This program is free software; you can redistribute it and/or modify @@ -88,7 +88,7 @@ void iscsi_free_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) } -int iscsi_add_data(struct iscsi_data *data, unsigned char *dptr, int dsize, int pdualignment) +int iscsi_add_data(struct iscsi_data *data, const unsigned char *dptr, int dsize, int pdualignment) { int len, aligned; unsigned char *buf; @@ -104,7 +104,7 @@ int iscsi_add_data(struct iscsi_data *data, unsigned char *dptr, int dsize, int aligned = (aligned+3)&0xfffffffc; } buf = malloc(aligned); - if (buf == NULL) { + if (buf == NULL) { printf("failed to allocate buffer for %d bytes\n", len); return -2; } @@ -123,11 +123,8 @@ int iscsi_add_data(struct iscsi_data *data, unsigned char *dptr, int dsize, int return 0; } -int iscsi_pdu_add_data(struct iscsi_context *iscsi, struct iscsi_pdu *pdu, unsigned char *dptr, int dsize) +int iscsi_pdu_add_data(struct iscsi_context *iscsi, struct iscsi_pdu *pdu, const unsigned char *dptr, int dsize) { - int len, aligned; - unsigned char *buf; - if (pdu == NULL) { printf("trying to add data to NULL pdu\n"); return -1; @@ -244,7 +241,7 @@ int iscsi_process_pdu(struct iscsi_context *iscsi, const unsigned char *hdr, int } break; default: - printf("Dont know how to handle opcode %d\n", opcode); + printf("Don't know how to handle opcode %d\n", opcode); return -2; }