From patchwork Fri Oct 26 22:30:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 10657925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71CB315A7 for ; Fri, 26 Oct 2018 22:31:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D86B2C979 for ; Fri, 26 Oct 2018 22:31:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5050E2C97D; Fri, 26 Oct 2018 22:31:05 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 EA71C2C979 for ; Fri, 26 Oct 2018 22:31:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728002AbeJ0HJx (ORCPT ); Sat, 27 Oct 2018 03:09:53 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:36943 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727751AbeJ0HJw (ORCPT ); Sat, 27 Oct 2018 03:09:52 -0400 Received: by mail-ed1-f65.google.com with SMTP id c15-v6so2588339eds.4 for ; Fri, 26 Oct 2018 15:31:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zJIDvZWQFuIBCXaIKbeoEcOs8MmNJNtvZlWs+1E5HfA=; b=H9BTetLft9V5V4ESyzKfGllytJ4z+khljpXpqr3kljXNQIDh3L6oiVRRmMXhe3h9In pefPH0hptoN7o1h8QWVPPcZcUOXRajMsSk5x2Kh4vPrG+LSjp9na/Ol4OlarqrT4fKRn OC+qHtaNanbRfIS7Sbsk59sT2s4FZ3/DLo67k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zJIDvZWQFuIBCXaIKbeoEcOs8MmNJNtvZlWs+1E5HfA=; b=XF87XGgLwDNJAx0IzeIEs4DHToUy86KUk/sEvVMLZcKQaFalpoqDYi18MJrOxlGkkq h4gktOUSQzAwwtVI2ngqkTcTEPaVzPmpzrxBUSJmabRqALJyndczvCE5ynwuZEfcreJ+ tTznFY7WDQKKfdJLRL+mT/Afcjkcebu7qcA5YJRCU3Krr/tCsVRPlPpBGjIHZ/gpOklx vyaysMhgwunvyB4heEhJQlMBiMAqWlIftLy/kSBDp6aRbVTg4hTpwUCn4DbYz6f5kZip mpXuXi/cP11J0RLLw/pNe/Zy6fN4WI3Svcg9Uut2p+Ok0D5XayVxHyBVJUEHQZqpxknu kAoQ== X-Gm-Message-State: AGRZ1gLrb7FeRmwa/S06MPs7rkyWzHcjz0T/6RjCk8aeMIVOGT4hCCMx 31rhNW0w5evo2nGgxzG1yFmLOQ== X-Google-Smtp-Source: AJdET5dTfKTcrNnoqLrO9ZB3zSo9ipB/ad0ncZf4WtmC/RMPf8raH6Wm2W4HXQPnj1losgD4q65fgA== X-Received: by 2002:a17:906:4c89:: with SMTP id q9-v6mr3594783eju.26.1540593062429; Fri, 26 Oct 2018 15:31:02 -0700 (PDT) Received: from prevas-ravi.waoo.dk (dhcp-5-186-114-252.cgn.ip.fibianet.dk. [5.186.114.252]) by smtp.gmail.com with ESMTPSA id z7-v6sm2456843ejp.49.2018.10.26.15.31.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Oct 2018 15:31:01 -0700 (PDT) From: Rasmus Villemoes To: Jean Delvare , Guenter Roeck Cc: Rasmus Villemoes , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers: hwmon: remove redundant cast Date: Sat, 27 Oct 2018 00:30:59 +0200 Message-Id: <20181026223059.17652-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.19.1.6.gbde171bbf5 MIME-Version: 1.0 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP struct attribute::name which this local variable name is eventually assigned to is "const char*", and so is the template parameter. We might as well preserve the constness all the way through. Signed-off-by: Rasmus Villemoes --- drivers/hwmon/hwmon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 975c95169884..ea42c5ec40d9 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -267,7 +267,7 @@ static struct attribute *hwmon_genattr(struct device *dev, struct device_attribute *dattr; struct attribute *a; umode_t mode; - char *name; + const char *name; bool is_string = is_string_attr(type, attr); /* The attribute is invisible if there is no template string */ @@ -289,7 +289,7 @@ static struct attribute *hwmon_genattr(struct device *dev, return ERR_PTR(-ENOMEM); if (type == hwmon_chip) { - name = (char *)template; + name = template; } else { scnprintf(hattr->name, sizeof(hattr->name), template, index + hwmon_attr_base(type));