Re: [PATCH v3 2/2] staging: greybus: log: Fix line over 80 characters.

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

 



On Wed, Jan 04, 2017 at 05:08:19PM +0100, Emmanuil Chatzipetru wrote:
> Fix coding style issue caught by checkpatch.pl related to the following
> warning:
> 	- CHECK: WARNING: line over 80 characters
> This is done by dropping a redundant cast and by replacing the format specifier
> in dev_err(); to "%zu" instead of "%d", in order to silence the warnings of the
> compiler.
> 
> Also, while at it, drop the redundant cast in the comparison as well to maintain
> consistency.
> 
> Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@xxxxxxxxx>

Acked-by: Johan Hovold <johan@xxxxxxxxxx>

> ---
> v2: As Johan suggested, is better to keep the already two-tab indendation
> to be persisent.  Therefore, the 80 line characters limit is fixed by removing
> the cast and use "%zu" for format specifier, to remove compiler warnings.
>     - Moreover, the cast in the comparison is redundant and thus, removed.
> v3: Update the commit message to be more explanatory according to Johan's
> comments.
>    - Also, resend both patches this time as a series.
> 
>  drivers/staging/greybus/log.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/greybus/log.c b/drivers/staging/greybus/log.c
> index 1a18ab1ff8aa..5c5bedaf69a6 100644
> --- a/drivers/staging/greybus/log.c
> +++ b/drivers/staging/greybus/log.c
> @@ -37,9 +37,9 @@ static int gb_log_request_handler(struct gb_operation *op)
>  	}
>  	receive = op->request->payload;
>  	len = le16_to_cpu(receive->len);
> -	if (len != (int)(op->request->payload_size - sizeof(*receive))) {
> -		dev_err(dev, "log request wrong size %d vs %d\n", len,
> -				(int)(op->request->payload_size - sizeof(*receive)));
> +	if (len != (op->request->payload_size - sizeof(*receive))) {
> +		dev_err(dev, "log request wrong size %d vs %zu\n", len,
> +				(op->request->payload_size - sizeof(*receive)));
>  		return -EINVAL;
>  	}
>  	if (len == 0) {
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux