From patchwork Tue Feb 13 11:20:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 200382 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp468243dyb; Tue, 13 Feb 2024 03:22:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWIwlyImcPZOuy6LkyqKb23BzqZW8v+wEo97pTZ3e3sjl2EFLcVVXBMywGi5M7BEzgLRQwdm5Az5qEMzOv6tiHcYb6USA== X-Google-Smtp-Source: AGHT+IGUJoga+h9eqY0FC1NT5Dheu6gmA4SmoNkozU2oubb3+f59QrtNJ5So4Dre2bDqjVg3O+0+ X-Received: by 2002:a05:6402:33c8:b0:55f:8031:501c with SMTP id a8-20020a05640233c800b0055f8031501cmr7375118edc.30.1707823348679; Tue, 13 Feb 2024 03:22:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707823348; cv=pass; d=google.com; s=arc-20160816; b=UIqwxWQN0pdPSVS+DpCXJZV4ZQFflJDbsnecBPNx1+q0O+Ug3M4734boRRKj7I4AZz 5cOl13LdP5UpBPMqaXk9nkKzjoSaH/TLyY+jXohlrvxcrma1f66ngYqdzGMw+uBt9Nac XfaVdjlT7rvy/ErE+dkMA3UM1LBzWChF6ctXI6LQyifMI4IVMD67+0EFbwY6/gDG648J KulycuWyu9ERy8356bf/kTtvzhUqaZuP1+m46101bj4JzP8Gi31UhYqmuqZdUx6n8wDL oU6LmlpkBLOGFuRXEzZr5G1UL7/6HDt7waM7lXbY2v0mrc2OExFBSql25Eg5QJufbIWu 7v7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=efKaPOQN0Y+Nc1PCL8PNTKe/appDOzLe6Bxumrjm4sY=; fh=XWzWLxyHcelqpmEpr9W5uIySLqDIKodB3W6PzZf2uDQ=; b=n85lfJ14qd22tYTdoYxdKZWWOAQwVcc136j3NkrCokRll8T5vXlfxa7qUEC8ASJ7Tj 7XTeb8v2iUa8HIOnwwsGS0N8d+WVVWpO4zgWLalgny7gxSAnOl/zx3BD6e6gLydRK0Z0 VZiUi0gtgFKztE6mLvbkvQIfVUBzdZzWTooKXjsGxRRN044MQeiYynIHMeEiL7aL97kY qoKr4kY5ZfwOxTuuagZGVUB8L5gaoUAA9tyTbeIsUIdZlaCBMZkGhTwvTCaXrSaSPWCe Js2M7cGJo9EnTSfxaZ7Pt7FRPvJP43fMVGBNR0Bh+tjIeHrFDlxs1Q5+2Dnfoaruaftf Y2+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gINsw+/o"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63420-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63420-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCV+AxyTGUwdNdYnTsOIsPvzQNFNQX19OCPu8useBgD0LIvb7zprwHwIbGfT2WN4iRMGjyA5xOGliipcwV4VuknywZ1ZzQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f22-20020a50a6d6000000b0055fbc52463bsi3698849edc.601.2024.02.13.03.22.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 03:22:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63420-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gINsw+/o"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63420-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63420-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4118D1F26F00 for ; Tue, 13 Feb 2024 11:22:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 145393B79E; Tue, 13 Feb 2024 11:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gINsw+/o" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87BB038DDA; Tue, 13 Feb 2024 11:21:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707823266; cv=none; b=ZQscZPzLNq2oBZh7VYnbg3w/Yht7Nms6KmQ1iWjUCF/I2srKqaI+/8yLDj43gqJzAsl5j9axaSRhTxQpO8KWvLpgtEPnVXn4xNZ124Zk4gKBDWGpcki5jw8B6Ws7bM+nTXcEuUPllmdUSmFEYB29dyxsq6yCOflG9/mPO/3t4XI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707823266; c=relaxed/simple; bh=AJUvsaAkLNAUPAonfLONk+9L24hzUQDc/XjcjTFJY20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r1MuamCcXdOxZmKYM+Lyh8Q3Sg/l04t/NrFhveaMwugPMA8vsvrDqzvKDdMwAw6b5+eLE8/mVRxlOFtjky2qqTsn2WxWMtvh+7JQH19V1eclpQ3rB+WtB+6aVDU2p1rReR2/wW4OTvuKBgEgAGbae9RiWFi8i0WusNngx86TBj8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gINsw+/o; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EB56C433A6; Tue, 13 Feb 2024 11:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707823266; bh=AJUvsaAkLNAUPAonfLONk+9L24hzUQDc/XjcjTFJY20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gINsw+/oQJgINmHlycAYC0R3r8NXr5g9zkuO0zwnXp81idnMQ6otWGVm7Q/+FCgHt G61Jbclb/g4gHqOCnRe9AXbhNSEhCReCkmBpGbQlZIIIRsIR+MayCmuj+Vc0MxCYQt lWPKqsT0g9hWOk0HU2NapD7qTUdQgS4PVs0g9GIhvIoPVuAsk5OyWO8FXieT8bc982 7Kbp9CZhXD0CJhzuXT+s7/JBBoQw/dov5BDIb7nMJqX8LpepsnzvIcAmaShMFm1NrT 6tq6bPw4kOVN2ufsalsUHAvGj5nQagWvdzzo7RcFtN2+8XCv4rDqZPC5l/MkuRcNM2 EZe0QHRpWL1yA== From: "Jiri Slaby (SUSE)" To: bp@alien8.de Cc: linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org Subject: [PATCH 3/7] EDAC/device: Remove edac_dev_sysfs_block_attribute::store() Date: Tue, 13 Feb 2024 12:20:47 +0100 Message-ID: <20240213112051.27715-4-jirislaby@kernel.org> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240213112051.27715-1-jirislaby@kernel.org> References: <20240213112051.27715-1-jirislaby@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790782575471763528 X-GMAIL-MSGID: 1790782575471763528 Noone uses this store hook (both BLOCK_ATTR() pass NULL). It actually never was since its addition in fd309a9d8e63e (drivers/edac: fix leaf sysfs attribute), so drop it. Found by https://github.com/jirislaby/clang-struct. Signed-off-by: Jiri Slaby (SUSE) Cc: Borislav Petkov Cc: Tony Luck Cc: James Morse Cc: Mauro Carvalho Chehab Cc: Robert Richter Cc: linux-edac@vger.kernel.org --- drivers/edac/edac_device.c | 1 - drivers/edac/edac_device.h | 9 +++------ drivers/edac/edac_device_sysfs.c | 22 +++------------------- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 0e18729111d4..8c2aa5bcf1b7 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c @@ -160,7 +160,6 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance */ attrib->attr = attrib_spec[attr].attr; attrib->show = attrib_spec[attr].show; - attrib->store = attrib_spec[attr].store; edac_dbg(4, "alloc-attrib=%p attrib_name='%s' attrib-spec=%p spec-name=%s\n", attrib, attrib->attr.name, diff --git a/drivers/edac/edac_device.h b/drivers/edac/edac_device.h index c4704b5b1e9f..a39752432c90 100644 --- a/drivers/edac/edac_device.h +++ b/drivers/edac/edac_device.h @@ -95,16 +95,13 @@ struct edac_dev_sysfs_attribute { * * used in leaf 'block' nodes for adding controls/attributes * - * each block in each instance of the containing control structure - * can have an array of the following. The show and store functions - * will be filled in with the show/store function in the - * low level driver. + * each block in each instance of the containing control structure can + * have an array of the following. The show function will be filled in + * with the show function in the low level driver. */ struct edac_dev_sysfs_block_attribute { struct attribute attr; ssize_t (*show)(struct kobject *, struct attribute *, char *); - ssize_t (*store)(struct kobject *, struct attribute *, - const char *, size_t); }; /* device block control structure */ diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c index 237a542e045a..fcebc4ffea26 100644 --- a/drivers/edac/edac_device_sysfs.c +++ b/drivers/edac/edac_device_sysfs.c @@ -457,35 +457,19 @@ static ssize_t edac_dev_block_show(struct kobject *kobj, return -EIO; } -/* Function to 'store' fields into the edac_dev 'block' structure */ -static ssize_t edac_dev_block_store(struct kobject *kobj, - struct attribute *attr, - const char *buffer, size_t count) -{ - struct edac_dev_sysfs_block_attribute *block_attr; - - block_attr = to_block_attr(attr); - - if (block_attr->store) - return block_attr->store(kobj, attr, buffer, count); - return -EIO; -} - /* edac_dev file operations for a 'block' */ static const struct sysfs_ops device_block_ops = { .show = edac_dev_block_show, - .store = edac_dev_block_store }; -#define BLOCK_ATTR(_name,_mode,_show,_store) \ +#define BLOCK_ATTR(_name,_mode,_show) \ static struct edac_dev_sysfs_block_attribute attr_block_##_name = { \ .attr = {.name = __stringify(_name), .mode = _mode }, \ .show = _show, \ - .store = _store, \ }; -BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL); -BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show, NULL); +BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show); +BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show); /* list of edac_dev 'block' attributes */ static struct attribute *device_block_attrs[] = {