From patchwork Thu Jan 9 20:21:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Heiny X-Patchwork-Id: 3463131 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 622BF9F2E9 for ; Thu, 9 Jan 2014 20:21:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 832E820200 for ; Thu, 9 Jan 2014 20:21:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92429201F2 for ; Thu, 9 Jan 2014 20:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756617AbaAIUVj (ORCPT ); Thu, 9 Jan 2014 15:21:39 -0500 Received: from us-mx2.synaptics.com ([192.147.44.131]:31117 "EHLO us-mx2.synaptics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756533AbaAIUVj (ORCPT ); Thu, 9 Jan 2014 15:21:39 -0500 Received: from unknown (HELO securemail.synaptics.com) ([172.20.21.135]) by us-mx2.synaptics.com with ESMTP; 09 Jan 2014 12:21:37 -0800 Received: from USW-OWA1.synaptics-inc.local ([10.20.24.16]) by securemail.synaptics.com (PGP Universal service); Thu, 09 Jan 2014 12:11:00 -0800 X-PGP-Universal: processed; by securemail.synaptics.com on Thu, 09 Jan 2014 12:11:00 -0800 Received: from brontomerus.synaptics.com (10.3.20.103) by USW-OWA1.synaptics-inc.local (10.20.24.15) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 9 Jan 2014 12:21:42 -0800 From: Christopher Heiny To: Dmitry Torokhov CC: Linux Input , Christopher Heiny , Andrew Duggan , Vincent Huang , Vivian Ly , Daniel Rosenberg , Jean Delvare , Joerie de Gram , Linus Walleij , Benjamin Tissoires Subject: [PATCH] input: synaptics-rmi4 - fix F01 DOM formatting Date: Thu, 9 Jan 2014 12:21:33 -0800 Message-ID: <1389298893-4043-1-git-send-email-cheiny@synaptics.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.3.20.103] X-Brightmail-Tracker: AAAAAQAAAWE= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use a sensible format string for the date of manufacture formatting. Signed-off-by: Christopher Heiny Cc: Dmitry Torokhov Cc: Benjamin Tissoires --- drivers/input/rmi4/rmi_f01.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c index 1cb11ea..9e6a578 100644 --- a/drivers/input/rmi4/rmi_f01.c +++ b/drivers/input/rmi4/rmi_f01.c @@ -50,7 +50,7 @@ struct f01_basic_properties { bool has_lts; bool has_adjustable_doze; bool has_adjustable_doze_holdoff; - char dom[9]; /* YYYYMMDD + '\0' */ + char dom[11]; /* YYYY/MM/DD + '\0' */ u8 product_id[RMI_PRODUCT_ID_LENGTH + 1]; u16 productinfo; }; @@ -190,8 +190,7 @@ static int rmi_f01_read_properties(struct rmi_device *rmi_dev, props->has_adjustable_doze_holdoff = basic_query[1] & RMI_F01_QRY1_HAS_ADJ_DOZE_HOFF; - snprintf(props->dom, sizeof(props->dom), - "20%02x%02x%02x", + snprintf(props->dom, sizeof(props->dom), "20%02d/%02d/%02d", basic_query[5] & RMI_F01_QRY5_YEAR_MASK, basic_query[6] & RMI_F01_QRY6_MONTH_MASK, basic_query[7] & RMI_F01_QRY7_DAY_MASK);