Re: [PATCH 4/6] crypto: digest: Split memory vs. file code into separate functions

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

 



Hi Andrey.

> +static int digest_update_from_fd(struct digest *d, int fd,
> +				 ulong start, ulong size)
> +{
> +	unsigned char *buf = xmalloc(PAGE_SIZE);
> +	int ret = 0;
> +
> +	ret = lseek(fd, start, SEEK_SET);
> +	if (ret == -1) {
> +		perror("lseek");
> +		goto out_free;
> +	}
lseek return (off_t)-1 - should ret be of type off_t to make this correct?

The code looks more readable with the two helper functions.
So +1 from me.

	Sam

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux