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

Emmanuil Chatzipetru chatzi.emanuel at gmail.com
Wed Jan 4 16:08:19 UTC 2017


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 at gmail.com>
---
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) {
-- 
2.1.4



More information about the devel mailing list