From patchwork Fri Dec 28 03:30:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10744135 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 611B714DE for ; Fri, 28 Dec 2018 03:42:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5344528C94 for ; Fri, 28 Dec 2018 03:42:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47CD128C99; Fri, 28 Dec 2018 03:42:52 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EBF1F28C94 for ; Fri, 28 Dec 2018 03:42:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E01AE211A1E5E; Thu, 27 Dec 2018 19:42:51 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CFD7A2119EF2B for ; Thu, 27 Dec 2018 19:42:50 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Dec 2018 19:42:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,407,1539673200"; d="scan'208";a="110449963" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga007.fm.intel.com with ESMTP; 27 Dec 2018 19:42:50 -0800 Subject: [ndctl PATCH 3/7] ndctl/monitor: Drop 'struct ndctl_ctx *' casts From: Dan Williams To: linux-nvdimm@lists.01.org Date: Thu, 27 Dec 2018 19:30:14 -0800 Message-ID: <154596781442.164521.11095363906849256036.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <154596779833.164521.12632457592535372923.stgit@dwillia2-desk3.amr.corp.intel.com> References: <154596779833.164521.12632457592535372923.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Now that the command harness is type-safe with respect to the @ctx argument. Drop the casts in cmd_monitor(). Cc: QI Fuli Signed-off-by: Dan Williams --- ndctl/monitor.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ndctl/monitor.c b/ndctl/monitor.c index 47caae55d56d..08219f99b12b 100644 --- a/ndctl/monitor.c +++ b/ndctl/monitor.c @@ -623,14 +623,14 @@ int cmd_monitor(int argc, const char **argv, struct ndctl_ctx *ctx) usage_with_options(u, options); /* default to log_standard */ - ndctl_set_log_fn((struct ndctl_ctx *)ctx, log_standard); + ndctl_set_log_fn(ctx, log_standard); if (monitor.verbose) - ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_DEBUG); + ndctl_set_log_priority(ctx, LOG_DEBUG); else - ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_INFO); + ndctl_set_log_priority(ctx, LOG_INFO); - rc = read_config_file((struct ndctl_ctx *)ctx, &monitor, ¶m); + rc = read_config_file(ctx, &monitor, ¶m); if (rc) goto out; @@ -638,7 +638,7 @@ int cmd_monitor(int argc, const char **argv, struct ndctl_ctx *ctx) if (strncmp(monitor.log, "./", 2) != 0) fix_filename(prefix, (const char **)&monitor.log); if (strncmp(monitor.log, "./syslog", 8) == 0) - ndctl_set_log_fn((struct ndctl_ctx *)ctx, log_syslog); + ndctl_set_log_fn(ctx, log_syslog); else if (strncmp(monitor.log, "./standard", 10) == 0) ; /*default, already set */ else { @@ -649,21 +649,21 @@ int cmd_monitor(int argc, const char **argv, struct ndctl_ctx *ctx) goto out; } fclose(f); - ndctl_set_log_fn((struct ndctl_ctx *)ctx, log_file); + ndctl_set_log_fn(ctx, log_file); } } if (monitor.daemon) { if (!monitor.log || strncmp(monitor.log, "./", 2) == 0) - ndctl_set_log_fn((struct ndctl_ctx *)ctx, log_syslog); + ndctl_set_log_fn(ctx, log_syslog); if (daemon(0, 0) != 0) { - err((struct ndctl_ctx *)ctx, "daemon start failed\n"); + err(ctx, "daemon start failed\n"); goto out; } - info((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n"); + info(ctx, "ndctl monitor daemon started\n"); } - if (parse_monitor_event(&monitor, (struct ndctl_ctx *)ctx)) + if (parse_monitor_event(&monitor, ctx)) goto out; fctx.filter_bus = filter_bus; @@ -681,7 +681,7 @@ int cmd_monitor(int argc, const char **argv, struct ndctl_ctx *ctx) goto out; if (!mfa.num_dimm) { - dbg((struct ndctl_ctx *)ctx, "no dimms to monitor\n"); + dbg(ctx, "no dimms to monitor\n"); if (!monitor.daemon) rc = -ENXIO; goto out;