[{"id":1766813,"web_url":"http://patchwork.ozlabs.org/comment/1766813/","msgid":"<99a59f87-b312-801a-88c3-65e3ebd5ca37@denx.de>","list_archive_url":null,"date":"2017-09-12T09:27:39","subject":"Re: [swupdate] [PATCH] util: remove unused method isDirectoryEmpty()","submitter":{"id":5771,"url":"http://patchwork.ozlabs.org/api/people/5771/","name":"Stefano Babic","email":"sbabic@denx.de"},"content":"On 08/09/2017 09:41, Christian Storm wrote:\n> The isDirectoryEmpty() method is not used and is inconsistently\n> named, remove it.\n> \n> Signed-off-by: Christian Storm <christian.storm@siemens.com>\n> ---\n>  core/util.c    | 21 ---------------------\n>  include/util.h |  1 -\n>  2 files changed, 22 deletions(-)\n> \n> diff --git a/core/util.c b/core/util.c\n> index b714f29..5590f8b 100644\n> --- a/core/util.c\n> +++ b/core/util.c\n> @@ -112,27 +112,6 @@ int openfileoutput(const char *filename)\n>  \treturn fdout;\n>  }\n>  \n> -int isDirectoryEmpty(const char *dirname)\n> -{\n> -\tint n = 0;\n> -\tstruct dirent *d;\n> -\tDIR *dir = opendir(dirname);\n> -\n> -\tif (dir == NULL)\n> -\t\treturn 1;\n> -\n> -\twhile ((d = readdir(dir)) != NULL) {\n> -\t\tif(++n > 2)\n> -\t\t\tbreak;\n> -  \t}\n> -\tclosedir(dir);\n> -\n> -\tif (n <= 2)\n> -\t\treturn 1;\n> -\n> -\treturn 0;\n> -}\n> -\n>  /*\n>   * This function is strict bounded with the hardware\n>   * It reads some GPIOs to get the hardware revision\n> diff --git a/include/util.h b/include/util.h\n> index 70a0acc..082a962 100644\n> --- a/include/util.h\n> +++ b/include/util.h\n> @@ -163,7 +163,6 @@ int syslog_init(void);\n>  char **splitargs(char *args, int *argc);\n>  char** string_split(char* a_str, const char a_delim);\n>  void freeargs (char **argv);\n> -int isDirectoryEmpty(const char *dirname);\n>  int get_hw_revision(struct hw_type *hw);\n>  void get_sw_versions(char *cfgfname, struct swupdate_cfg *sw);\n>  int check_hw_compatibility(struct swupdate_cfg *cfg);\n> \nApplied to -master, thanks !\n\nBest regards,\nStefano Babic","headers":{"Return-Path":"<swupdate+bncBAABBEOR33GQKGQE3VJOAMA@googlegroups.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=googlegroups.com\n\t(client-ip=2a00:1450:4010:c07::23d;\n\thelo=mail-lf0-x23d.google.com;\n\tenvelope-from=swupdate+bncbaabbeor33gqkgqe3vjoama@googlegroups.com;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=googlegroups.com header.i=@googlegroups.com\n\theader.b=\"o/4hj2Z2\"; dkim-atps=neutral"],"Received":["from mail-lf0-x23d.google.com (mail-lf0-x23d.google.com\n\t[IPv6:2a00:1450:4010:c07::23d])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrzwg6ZPcz9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 19:27:47 +1000 (AEST)","by mail-lf0-x23d.google.com with SMTP id a18sf284095lfl.0\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 02:27:47 -0700 (PDT)","by 10.46.29.133 with SMTP id w5ls68860lje.17.gmail;\n\tTue, 12 Sep 2017 02:27:44 -0700 (PDT)","from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9])\n\tby gmr-mx.google.com with ESMTPS id\n\tr185si465244wma.9.2017.09.12.02.27.44\n\tfor <swupdate@googlegroups.com>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 12 Sep 2017 02:27:44 -0700 (PDT)","from frontend03.mail.m-online.net (unknown [192.168.6.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xrzwc49q8z1qvCS;\n\tTue, 12 Sep 2017 11:27:44 +0200 (CEST)","from localhost (dynscan3.mnet-online.de [192.168.6.84])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xrzwc40zkz1qsQH;\n\tTue, 12 Sep 2017 11:27:44 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id m1C9LEfAYAW9; Tue, 12 Sep 2017 11:27:43 +0200 (CEST)","from babic.homelinux.org\n\t(host-88-217-136-221.customer.m-online.net [88.217.136.221])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPS;\n\tTue, 12 Sep 2017 11:27:43 +0200 (CEST)","from localhost (mail.babic.homelinux.org [127.0.0.1])\n\tby babic.homelinux.org (Postfix) with ESMTP id 5A2C745405CE;\n\tTue, 12 Sep 2017 11:27:43 +0200 (CEST)","from babic.homelinux.org ([127.0.0.1])\n\tby localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id 7uU-9vP4mWeV; Tue, 12 Sep 2017 11:27:39 +0200 (CEST)","from [192.168.178.132] (papero.fritz.box [192.168.178.132])\n\tby babic.homelinux.org (Postfix) with ESMTP id B44BA45405CD;\n\tTue, 12 Sep 2017 11:27:39 +0200 (CEST)"],"ARC-Seal":["i=2; a=rsa-sha256; t=1505208465; cv=pass;\n\td=google.com; s=arc-20160816;\n\tb=Bw2jLP7Biz12d+EZN74z6Tclo1yNB76b3KTpKgpN3vzxRn2/N3vWZuu10gMcw9J/pP\n\tRZepjKxHaoEnh2iWNmbZDkovWS0BOdSZf1MQRC8uv2bml/fdKcL+0rPUSP+sNUDKfWnO\n\ta3l454x0B9qremKZBA/OkbxgUmyNlNA6V773VShbcxTHg8wTP4oiEEoHgfhS78yb6uov\n\tJjEkiC+32axQS5mHXxVg1kUlqQ+WYY+1XSEjcIFpf+/TM9qe4mmdIvI4iqODyc0jKSXd\n\t9ePwvvD0OV6HFsCl9e+OQItZDe4HZPn//MR/eypUWJ3WSOf8QwW/NSGwGX2amkJbOhpc\n\tx4Nw==","i=1; a=rsa-sha256; t=1505208464; cv=none;\n\td=google.com; s=arc-20160816;\n\tb=AmMiqrjxpJGtsjxl9ceCrPeJZYr5jiC+8USfTIqqwasUHbXwJW+S4X3du6J3CvM7Bk\n\tkTCm+59TNmZePpeEH8px/L7xmW41LHNXkt9lCHoUAef5jBjJLdliktKMZ0LBWtZTSOKe\n\t0VlZOhC2vn9VAIR8mtQKYu3am6QqU96SuTP27R52eN/DgeqY6W+3QB7Evd3L0Xr9y+qj\n\t/idoEJvUn8GU+ku6mI5q7rqh3y8lL53RWcm/ybs1JDYLCAJCCVRes7C+lnF1ffTh+ITN\n\tOPuUKjJwIK1io5CAMgh4dSuKxZFRZTiIvP+dZUJjEXxk0eJaQJUc0amUt42gIuSHrKVu\n\tRTnA=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=list-unsubscribe:list-subscribe:list-archive:list-help:list-post\n\t:list-id:mailing-list:precedence:content-language:in-reply-to\n\t:mime-version:user-agent:date:message-id:from:references:to:subject\n\t:arc-authentication-results:arc-message-signature:sender\n\t:dkim-signature:arc-authentication-results;\n\tbh=np8ny8ZJiJrJxdvdcuw3drwgoZmYv+7XiJN4QJLbJT0=;\n\tb=rpp04CKlZBK2FR5eU5OjtCVjRV7JJAODNVVawKodT4jD+R5EA4M8aK6VdtjHuvNP77\n\tMbJo+Pk1SXNz3v8on9q8Iw/hQP1RCFO4moga0IvTT0mO7cyzNMQZFuXl7aRM/huxgq1p\n\thIza6UMkw1qo8WPo5m5FAa2hjyTImyu5kyBXcbJ6PvbgH0NmmKmY3ASK6peGrKKpZxfW\n\tCq/hNlteMKDFHo4JVm/4FvancGvmA1UTYbOOCHjJzH42ZFp9+TwuRE9P1m2zMUGyVU1y\n\tLx1vyYds29EYsdbkbN+z155Y8BAi/phZ8QucJAYhpTDX7O3WDaM2Ix9vxZ7kF1Fv8fr5\n\tawjA==","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=content-transfer-encoding:content-language:in-reply-to:mime-version\n\t:user-agent:date:message-id:from:references:to:subject\n\t:arc-authentication-results;\n\tbh=iLoaVmkG8tzK1MCHyJbtx9q7Bcq8DCR2cRTG8vxKxsw=;\n\tb=qIyOdyfXxFvIgdT3/lpFpCzaOFRFtHoVotBeU4Lz2nBXwLz8w2JaOcFsQA6qPKB9YX\n\tonhqHv/P4j0h0sm8OjoD4nqAbRHbCYTy/p3oV7qG4MNPNupk16vCbUnRpdzCIaguMnx7\n\tRTKyPtCWH2isej/u+IbtryCOqNdRaxCWVJnJWGderiS6VfH9K2ROE5uRQjQrbk9tF8NL\n\tKMtlrL97xbLwORk2PEIgNgbZeHwy+UVV2CtcrX/ZiDpRDan/cn9sLZlRPGK/E6/0y53N\n\tgxNsnhsSRKb+gG0wTcvM92jHhjmklLUt+iStTIgmcTnHPByfqSmrdmzCFjKLFj6IcheO\n\tHHjA=="],"ARC-Authentication-Results":["i=2; gmr-mx.google.com;\n\tspf=neutral (google.com: 212.18.0.9 is neither permitted nor denied\n\tby best guess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de","i=1; gmr-mx.google.com;\n\tspf=neutral (google.com: 212.18.0.9 is neither permitted nor denied\n\tby best guess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=googlegroups.com; s=20161025;\n\th=sender:subject:to:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:x-original-sender\n\t:x-original-authentication-results:precedence:mailing-list:list-id\n\t:list-post:list-help:list-archive:list-subscribe:list-unsubscribe;\n\tbh=np8ny8ZJiJrJxdvdcuw3drwgoZmYv+7XiJN4QJLbJT0=;\n\tb=o/4hj2Z2rWAG+mDmSOC5gPGBiJDCROktKDRTrE5TedwhcZB2SVUG20h+xIt1bCEAm6\n\tESyD7Gzn0qvv7d1U9zbQAtmnKhvD1LjSzwfRBnxslBBv2CUpjFF36Z+CPv/qxdNuH1K7\n\tUwrQrTaHH2AZpkpQc9C3zC8XyGjRvDiyLubhnvvDAi7Orsrws3fR7qzI3laPD3FQsQ+F\n\tKuXa4XbNjsjeDn/5VJHNXoP7BtyDJ6oIb0mhMk6HWQPenASopbieyI5tTrczLU6+Y+mu\n\tkYc2OqfEm7jwTosakHZQIKZJfR2WO0dLpu044o/9R1u9NfIwIuvG+g7KbPFXY5kncijS\n\tJpSQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=sender:x-gm-message-state:subject:to:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:x-original-sender:x-original-authentication-results:precedence\n\t:mailing-list:list-id:x-spam-checked-in-group:list-post:list-help\n\t:list-archive:list-subscribe:list-unsubscribe;\n\tbh=np8ny8ZJiJrJxdvdcuw3drwgoZmYv+7XiJN4QJLbJT0=;\n\tb=YMaLP5/HIsqxl7fY6VlefXeTypOhNG72FQLvzmAjKM1LtAKc44rbykz/ahE2EvPTii\n\t3OYEdNkEHr8qGbArkys+NwsaMOs85k080keFumhYC2YcW2H9C9K/TAKsFopP5rpTRx5h\n\t6sGvggr26bQGIummUGq/UEyawR3FsL+I1NyqPEJw8HZXMJAGZ71lOVjFLTBADlqI755x\n\tcfpyT+O7i8a4lUUXvvF5z9zS1sOwtD+MnP/eSL9mfE56fltcN8tkqNOb6nFlXWsyxQOt\n\tyuMO4HuHUoJi94cRd40fUdPeJ5ZNv/KedkWsez2DYXKjF7JfaD6wem98JdkyNUMFPzbI\n\tlhng==","Sender":"swupdate@googlegroups.com","X-Gm-Message-State":"AHPjjUiZAKevZ5nEswVlN3OxVdqFsm+XGEg9m6C3rcRXgxmyFLJXyGit\n\tQq7/wIhcC9XWTQ==","X-Google-Smtp-Source":"ADKCNb6ge49QU36CCgXPwXE09+XOGaA3Gj+zuMPa1/MpaXrTpBhCpJZTmfyocXJELlhumcT1zf1tjQ==","X-Received":["by 10.46.17.26 with SMTP id f26mr18203lje.21.1505208465210;\n\tTue, 12 Sep 2017 02:27:45 -0700 (PDT)","by 10.25.228.65 with SMTP id b62mr1107439lfh.37.1505208464806;\n\tTue, 12 Sep 2017 02:27:44 -0700 (PDT)"],"X-BeenThere":"swupdate@googlegroups.com","Received-SPF":"neutral (google.com: 212.18.0.9 is neither permitted nor\n\tdenied by best guess record for domain of sbabic@denx.de)\n\tclient-ip=212.18.0.9; ","X-Virus-Scanned":["amavisd-new at mnet-online.de","Debian amavisd-new at babic.homelinux.org"],"Subject":"Re: [swupdate] [PATCH] util: remove unused method isDirectoryEmpty()","To":"Christian Storm <christian.storm@siemens.com>, swupdate@googlegroups.com","References":"<20170908074122.25961-1-christian.storm@siemens.com>","From":"Stefano Babic <sbabic@denx.de>","Message-ID":"<99a59f87-b312-801a-88c3-65e3ebd5ca37@denx.de>","Date":"Tue, 12 Sep 2017 11:27:39 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170908074122.25961-1-christian.storm@siemens.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Language":"de-DE","X-Original-Sender":"sbabic@denx.de","X-Original-Authentication-Results":"gmr-mx.google.com;       spf=neutral\n\t(google.com: 212.18.0.9 is neither permitted nor denied by best guess\n\trecord\n\tfor domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de","Precedence":"list","Mailing-list":"list swupdate@googlegroups.com;\n\tcontact swupdate+owners@googlegroups.com","List-ID":"<swupdate.googlegroups.com>","X-Spam-Checked-In-Group":"swupdate@googlegroups.com","X-Google-Group-Id":"605343134186","List-Post":"<https://groups.google.com/group/swupdate/post>,\n\t<mailto:swupdate@googlegroups.com>","List-Help":"<https://groups.google.com/support/>,\n\t<mailto:swupdate+help@googlegroups.com>","List-Archive":"<https://groups.google.com/group/swupdate","List-Subscribe":"<https://groups.google.com/group/swupdate/subscribe>,\n\t<mailto:swupdate+subscribe@googlegroups.com>","List-Unsubscribe":"<mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>,\n\t<https://groups.google.com/group/swupdate/subscribe>"}}]