Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2980530rdb; Tue, 13 Feb 2024 03:22:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWlSZpN4U9DUWTg5ne1gjP65BjEyeNjDyFNXygRV2lSzz9BfNDDILTgJK2CKUTp4N669LmnOssz0PPbtUCxM1C3xLQvPee5Ool0QQ3yrA== X-Google-Smtp-Source: AGHT+IGAOlw0+CwiUFmzbd55LGJajkn3SnWYjgCFbxQg0wwrYTOXztqr3AXlVuZiVAMit0kylljr X-Received: by 2002:a05:6a21:1518:b0:19e:9a65:75eb with SMTP id nq24-20020a056a21151800b0019e9a6575ebmr9958401pzb.40.1707823349069; Tue, 13 Feb 2024 03:22:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707823349; cv=pass; d=google.com; s=arc-20160816; b=yFhgTuNjcl6jbKe18ys4rPLgIn9yRHTxRNOI1+Tk7hA7KOg+/6uXv1TXJElYgr0uT6 p+9aJ608uMKl5QhacZaB9brXZfEOgSU7KhfMBu8oNQ9BNElX0oS4fUxyfi0B2N+lGTG4 b/BOA7px1ISBwywUz0c4TJh8+p8I9sf4p/lZNciuDHCfsiO1QqkMlG5heSCP2zPkqyn+ 1kS1sviOkCUral5COSLd12jTVVxSv8g0OVea+sY/5CcpH3MU9rXyeQQg4GZY98GuCWzr de0drWwawAjV13n3S76JltK3wgFHhOF8yqRNOg3zMiCOFLvSWNpks4OTghCOcPMIAnus Qgjg== 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=xbch8XFRE0uPmNY0UUP1BGxEsusF5XqDpYnaZJ1rek4=; b=TZSxyciuBx7BN+kpxd45wxkjs4GNVuW8tugCgmNJ2gfDdU7M+YR+k2QQrW4qRmU9Y7 pzLVdxZf0uX6dRhPejznF44xMbii4aMzVj60DBx+haGxtqO5d0M+MCUAU867inSeFYCU xZcQCy3Mg7g1jaJdqMT05YFTvLfDj4bW6Gd1lB+V0LzB6ODogTIUDOXVjqatQXWnOwZ3 vS5GiM04yytXK5jVIYKJKz0mioI0LoeQOTg8X4rGJpl/lhsG4XTdzX2xcl46GHqZmv0H GZfcFfNKNOAfgIJ38hawFS6zICH8vB60kWfkR71lRcKBzYPpgb/2drKTmqS2zqUr69a6 aMwg==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63420-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCW0+4Y/jQETBOp1d0146axAs51SCGuns0+fMsl6PcsCWbUb4u+Sx4+wMip+nfKiv1LHED/VZ9f8ob0ETz9QghHxKzB18l1QNUHTQwpwCQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q23-20020a637517000000b005cd8b5dfe9csi1924144pgc.491.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:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63420-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 942AF2828D7 for ; Tue, 13 Feb 2024 11:21:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DAD0364C1; Tue, 13 Feb 2024 11:21:07 +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 Content-Transfer-Encoding: 8bit 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[] = { -- 2.43.1