From patchwork Thu Apr 1 14:54:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12178857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9297AC43460 for ; Thu, 1 Apr 2021 18:02:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59587611F1 for ; Thu, 1 Apr 2021 18:02:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236590AbhDASCn (ORCPT ); Thu, 1 Apr 2021 14:02:43 -0400 Received: from mga02.intel.com ([134.134.136.20]:34705 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235115AbhDAR4S (ORCPT ); Thu, 1 Apr 2021 13:56:18 -0400 IronPort-SDR: QQrT7Lv3r93+6Tp7g9Nh8UreNouC3Jn3bb1EAHkzpJJ3dRVHyjlElH4cdcOIiOtTidDcYkNj9r be282oNTgxbw== X-IronPort-AV: E=McAfee;i="6000,8403,9941"; a="179392886" X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="179392886" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2021 07:54:49 -0700 IronPort-SDR: s6iDBroVq39H0T6xw7Oqd0VieF9lpLSatZ+p1i8nN+EMCq0EG2q2BMKeQzQiOFnU7PA14ciBo3 TXNXU4XE9W6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="456013958" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 01 Apr 2021 07:54:47 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D2C9222B; Thu, 1 Apr 2021 17:55:02 +0300 (EEST) From: Andy Shevchenko To: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko Subject: [PATCH v1 1/2] iio: trigger: Replace explicit casting and wrong specifier with proper one Date: Thu, 1 Apr 2021 17:54:56 +0300 Message-Id: <20210401145457.12255-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org By unknown reason device name is set with an index casted from int to unsigned long while at the same time with "%ld" specifier. Both parts seems wrong to me, thus replace replace explicit casting and wrong specifier with proper one, i.e. "%u". Signed-off-by: Andy Shevchenko --- drivers/iio/industrialio-trigger.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index 32ac1bec25e3..77fca24147b2 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -75,8 +75,7 @@ int __iio_trigger_register(struct iio_trigger *trig_info, return trig_info->id; /* Set the name used for the sysfs directory etc */ - dev_set_name(&trig_info->dev, "trigger%ld", - (unsigned long) trig_info->id); + dev_set_name(&trig_info->dev, "trigger%u", trig_info->id); ret = device_add(&trig_info->dev); if (ret)