From patchwork Fri Sep 8 07:41:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 811366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:400c:c09::240; helo=mail-wm0-x240.google.com; envelope-from=swupdate+bncbdd6bwv65qpbbneuzhgqkgqedvwgyyq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="q2+UttkT"; dkim-atps=neutral Received: from mail-wm0-x240.google.com (mail-wm0-x240.google.com [IPv6:2a00:1450:400c:c09::240]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xpTpd4LPWz9sBW for ; Fri, 8 Sep 2017 17:43:52 +1000 (AEST) Received: by mail-wm0-x240.google.com with SMTP id e64sf108250wmi.3 for ; Fri, 08 Sep 2017 00:43:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1504856628; cv=pass; d=google.com; s=arc-20160816; b=j9lyJMn0xsJB7gvdtPYmdrlYpJ/ncu2misr4TKZ15E5l1q7hcNkDAt0k2912B5mH2x MZJOZgF4ZBPF2K2GrgxPmSvgV05WdLSDf78dV4HwC1IGGdVUxvCfFSNiPDwUnb4C7G68 WO4lA6eYJv6T8ZRIPg0pO3hRoA481592vGiCSIuJIzqHMiN2aR+w+xZSF3sWC5AmmULO UL6JQrQRkBSzG/fCmZWDOdKeUAwE2IzkOJfZhtxiV82gmkAvGSN7RlWPxgH7O8nkZpvq tKP8V1X3bfL/GSCIcsEF13zWZ4nPSsLgMiSeuurpL9YAHH5TM6L4fu1xjRDJO9nJbZLZ eV5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=7tWCvh2lZCzX9kMq7kZA7A8D8hJn+G9G/GSCl9HV1Xw=; b=IVaWffAkhvpCombM+GC3JTAguhIs4c9Xd7m6vJx9/2GKku3rDDVVnUnnrfRjHmFsje N2L/0ceIVUgpL0hpwZ2o0E2Qpv5WxN5+7xGoMm7aeG8PGTDiVRko/KrwAeOuWcMvvaZK +iUOaUpS4MehcgaK1SxVaKJWALYpD0K8//mJSvZGLV+wNbMW0ojR6t/bjU6EHd0B9twU yT3VfUCMACkrRZ7LsgAkx4Nu2GGyH44EKKmAfJu+6lWk/SgoCiJsk79IVDmjBG4EWaIU elmu7jJQU0kAyadUEWUTPhiXUbNrEM5BOACLr2obqvOE7mpwxSOtNSyx/bTxVUhqMLCR gACQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=7tWCvh2lZCzX9kMq7kZA7A8D8hJn+G9G/GSCl9HV1Xw=; b=q2+UttkTUA+xM57lRUASi1yExId5oxdLcwq0a1lcZPs5M/salvUNP20L61/a8GWJYh ciaCBCeN8DVxcClTPO1g+OXpAf+vqVsjvOZh5yKODj/uq8odzY0mOKjq92+pULnQZ7/z VKC1iZE9O/UkLEKOW+ujMfA+Zaopuu+7GkM6csrZlc4ezWdJ+OaidPdocJJ2vXqAGMeG UEqvSe/ssoFiIvNZzxCqj/1yW7m4vP4U2lCNFOkYcDE7t9NCmUS5Zyxlx5kiXyOZ03xv Q9BnZd4GPZAH1E1YxfI2fyn0KahzI4z/uA9yPKaiJ2KWzPReoMKdS26rHnfGn/e961Q2 +mkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=7tWCvh2lZCzX9kMq7kZA7A8D8hJn+G9G/GSCl9HV1Xw=; b=aSYkT+0cC75JZ9hjwN2uJId2VR968W0tHcqIe5S7br2NP1zK41jFc2R/ZEDkNWAsr0 O4pyoOG7oYl7B29dwEpNM+vhcXpeXtyS1UDPWYs/u6nvzZ9v/KNXFSD9CWUj7OFMgO8G 4iYMGKbmXdceRRd7ixKjvihw4x9svXC+Bt77IDmm6Ur6C0RfShFLWZNWi5/aJr30DjT8 7mvDww43doCP1+8NrQv6EzxcYe7otpFn4uv7G3N0nFZ3c6pg2RJ7BNJK88MoVGiBrp75 oWIgh81FM5lWSwhJl8v/Wtn2YET36CnwPsUUHIxz8LyQ8blLxqnaK5bL7GFJJ4zblDHW Mvgg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AHPjjUiBTVFt2fp0BpR0vVHzerGdByTAkJl33WweqnnxDskSDUtHNn+r rKumjSkdKa2GWQ== X-Google-Smtp-Source: AOwi7QAZyP8+j2TSZzKoswp0keyNmEDvX4FvllCPmROl3NwIcD7YB0oyCkECoGys2GVHRfFBQ3GjmQ== X-Received: by 10.28.29.199 with SMTP id d190mr1752wmd.25.1504856628206; Fri, 08 Sep 2017 00:43:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.28.113.23 with SMTP id m23ls206602wmc.5.gmail; Fri, 08 Sep 2017 00:43:47 -0700 (PDT) X-Received: by 10.28.101.133 with SMTP id z127mr122261wmb.32.1504856627865; Fri, 08 Sep 2017 00:43:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504856627; cv=none; d=google.com; s=arc-20160816; b=RLuhDMAmSJMfmDIlrHDmAbLtxzcqQoLBqHxTas2aRimq382a+2BMBkzJWhg+L5vfOY mrqfHg+e9u9ra12EfUa8yPmPmejJHeXjT+Zz5FX6GX4UYtppMFCT8XhFw+epy2/Qdn4K HPKcy7yvMcoEjt0vPjEQg/xa+PkWo84hkypc6S+pAd2kCHOPDztXjhMTK45doaYjnV5C tZhVTHxqKurhcjkrtmB3Gw8lYTNrrEfbhUDLYYiwjGajleBU23wCXSiWklBYnGd7VPRs TMPf3SW7P+yJNHxmmSJ6az8mntMQPa/2JSJTCr5GUWSo3iS/xxZ+TpCiLgsZ2+APQxPv eUrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=I2F6U8DhOYAyILv+F/ob7zCKIAjhKXXUSdOqawAwuyU=; b=e0gTcM4uO98Lw29CtlZusVrek46lpTBgKFeS3rSkh6S5G22Y4e+oOuZBQRIDYQ+RGz 3VqY97hsInpNzlZCRtybwbA0suUy4Bet1BzJHrfYcqV0Lg9prSNYtY8AreNM8GID5Rr7 TVUrrWuKLVpQ+JVO6Id0d41+vzBwIKLuZb7tvRj3PDt56QxpMDF6hdEPOZi/Lvl3TyZM pEC1vVdQc3H/JVKqnSX1KD+D45FjMoD6+x3ULCx5NANuBZrWK8hmL9C5Qik6EC/C5jXC lUsZKKnneKP154HmihMnNtVo2l7Dmw+Qt+3bxQsuA72bMC7rsmL6DXWSQba6oiTmIpNv iMAw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id i90si86594wmh.5.2017.09.08.00.43.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Sep 2017 00:43:47 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) client-ip=192.35.17.14; Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id v887hk6a022075 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 8 Sep 2017 09:43:46 +0200 Received: from MD1KR9XC.ad001.siemens.net ([139.25.69.251]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id v887hkTu009933; Fri, 8 Sep 2017 09:43:46 +0200 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH] util: remove unused method isDirectoryEmpty() Date: Fri, 8 Sep 2017 09:41:22 +0200 Message-Id: <20170908074122.25961-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.14.1 X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , The isDirectoryEmpty() method is not used and is inconsistently named, remove it. Signed-off-by: Christian Storm --- core/util.c | 21 --------------------- include/util.h | 1 - 2 files changed, 22 deletions(-) diff --git a/core/util.c b/core/util.c index b714f29..5590f8b 100644 --- a/core/util.c +++ b/core/util.c @@ -112,27 +112,6 @@ int openfileoutput(const char *filename) return fdout; } -int isDirectoryEmpty(const char *dirname) -{ - int n = 0; - struct dirent *d; - DIR *dir = opendir(dirname); - - if (dir == NULL) - return 1; - - while ((d = readdir(dir)) != NULL) { - if(++n > 2) - break; - } - closedir(dir); - - if (n <= 2) - return 1; - - return 0; -} - /* * This function is strict bounded with the hardware * It reads some GPIOs to get the hardware revision diff --git a/include/util.h b/include/util.h index 70a0acc..082a962 100644 --- a/include/util.h +++ b/include/util.h @@ -163,7 +163,6 @@ int syslog_init(void); char **splitargs(char *args, int *argc); char** string_split(char* a_str, const char a_delim); void freeargs (char **argv); -int isDirectoryEmpty(const char *dirname); int get_hw_revision(struct hw_type *hw); void get_sw_versions(char *cfgfname, struct swupdate_cfg *sw); int check_hw_compatibility(struct swupdate_cfg *cfg);