From patchwork Wed Nov 30 22:48:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 9455067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 582536071E for ; Wed, 30 Nov 2016 22:56:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BD76284B4 for ; Wed, 30 Nov 2016 22:56:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 406D6284B8; Wed, 30 Nov 2016 22:56:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBB08284B4 for ; Wed, 30 Nov 2016 22:56:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751566AbcK3W4P (ORCPT ); Wed, 30 Nov 2016 17:56:15 -0500 Received: from mail-wj0-f180.google.com ([209.85.210.180]:34903 "EHLO mail-wj0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbcK3W4P (ORCPT ); Wed, 30 Nov 2016 17:56:15 -0500 Received: by mail-wj0-f180.google.com with SMTP id v7so189013308wjy.2 for ; Wed, 30 Nov 2016 14:56:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id; bh=QR7+j6AAdy5Gv0D1GvJUoodnse5qN/gBjiOdwrr9w0E=; b=Jt5AFTi6JBMEyGKXX1YfYugErUZw9R3hOZrRXY6uCyXJCIYUxm7xifcelgkw9SGxrF PFO047JsI/UW9MGNsVZ0LqrB3GUa8EqHYwipsAu+Loz+xEMbtgx7TRzC1FM1eT8Wl9j2 IAYTQMax/J+Zwuns053pGA7tO92vrXQvhuFow= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QR7+j6AAdy5Gv0D1GvJUoodnse5qN/gBjiOdwrr9w0E=; b=QcL4JESUdOLuaRmOeTqUJWj0YoACwe4poh/eRrp1XR3yP3PHrMDepKcl9jE0gPCCgg H7AEGCyjEQFsw+yrSjaAp6kajySpLJ3V1YCcCVnh1MHwkQbRGeSL00shDjCihDU4jKhd /dC43sflDZLfxV3Ud9icfEtL1pgqos0Dc+CxWGmJlRnH4tOxaNmKzzv049kiwEb4DFxt 3gPImWBktACR5UTdSy4cevEcav4hA2eEHeEsgm4dtSORzWTdcwXTdeG5f+5GTRm3guFp k72TcBa0Od26Cni8TtFgigCKR5Ka8RW0wnLJTqH4JXhjd2owb0BHSONCfp+pICwpi9hY BdaA== X-Gm-Message-State: AKaTC03lZQpKIXw2vDyYb1fvijYc2C5n4/X03R0V1XLa6eZ0OSWQPc1IiZZaeFal2t97og== X-Received: by 10.194.141.141 with SMTP id ro13mr30283920wjb.76.1480546148576; Wed, 30 Nov 2016 14:49:08 -0800 (PST) Received: from lvps87-230-87-209.dedicated.hosteurope.de (wildmoose.dk. [87.230.87.209]) by smtp.gmail.com with ESMTPSA id 63sm10123938wmg.2.2016.11.30.14.49.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Nov 2016 14:49:08 -0800 (PST) From: Rasmus Villemoes To: Srinivas Pandruvada , Jiri Kosina , Benjamin Tissoires Cc: Rasmus Villemoes , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: intel_ish-hid: use %pUL for uuid formatting Date: Wed, 30 Nov 2016 23:48:46 +0100 Message-Id: <1480546127-3539-1-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We have the %pU printf extension for doing exactly this. Saves some .text, and is likely also a little faster. Signed-off-by: Rasmus Villemoes Reviewed-by: Benjamin Tissoires Acked-by: Srinivas Pandruvada --- drivers/hid/intel-ish-hid/ishtp/bus.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c index 256521509d20..f4cbc744e657 100644 --- a/drivers/hid/intel-ish-hid/ishtp/bus.c +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c @@ -585,14 +585,7 @@ int ishtp_bus_new_client(struct ishtp_device *dev) */ i = dev->fw_client_presentation_num - 1; device_uuid = dev->fw_clients[i].props.protocol_name; - dev_name = kasprintf(GFP_KERNEL, - "{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - device_uuid.b[3], device_uuid.b[2], device_uuid.b[1], - device_uuid.b[0], device_uuid.b[5], device_uuid.b[4], - device_uuid.b[7], device_uuid.b[6], device_uuid.b[8], - device_uuid.b[9], device_uuid.b[10], device_uuid.b[11], - device_uuid.b[12], device_uuid.b[13], device_uuid.b[14], - device_uuid.b[15]); + dev_name = kasprintf(GFP_KERNEL, "{%pUL}", device_uuid.b); if (!dev_name) return -ENOMEM;