{"id":806970,"url":"http://patchwork.ozlabs.org/api/1.0/patches/806970/?format=json","project":{"id":44,"url":"http://patchwork.ozlabs.org/api/1.0/projects/44/?format=json","name":"skiboot firmware development","link_name":"skiboot","list_id":"skiboot.lists.ozlabs.org","list_email":"skiboot@lists.ozlabs.org","web_url":"http://github.com/open-power/skiboot","scm_url":"http://github.com/open-power/skiboot","webscm_url":""},"msgid":"<20170829062506.8317-4-cyril.bur@au1.ibm.com>","date":"2017-08-29T06:24:56","name":"[RFC,03/13] external/pflash: Use ffs_entry_user_to_string() to standardise flag strings","commit_ref":null,"pull_url":null,"state":"rfc","archived":false,"hash":"3c86c80e0d047d946ae2e2831d09db99c8ded00d","submitter":{"id":64738,"url":"http://patchwork.ozlabs.org/api/1.0/people/64738/?format=json","name":"Cyril Bur","email":"cyril.bur@au1.ibm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/skiboot/patch/20170829062506.8317-4-cyril.bur@au1.ibm.com/mbox/","series":[{"id":313,"url":"http://patchwork.ozlabs.org/api/1.0/series/313/?format=json","date":"2017-08-29T06:24:53","name":"Rework flash TOC generation","version":1,"mbox":"http://patchwork.ozlabs.org/series/313/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/806970/checks/","tags":{},"headers":{"Return-Path":"<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","skiboot@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","skiboot@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhJwT6Rhmz9t38\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 16:42:33 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhJwT5MJmzDqm8\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 16:42:33 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xhJY56p5hzDqZq\n\tfor <skiboot@lists.ozlabs.org>; Tue, 29 Aug 2017 16:25:45 +1000 (AEST)","from pps.filterd (m0098394.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7T6OBoq119049\n\tfor <skiboot@lists.ozlabs.org>; Tue, 29 Aug 2017 02:25:41 -0400","from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cn1kje0me-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <skiboot@lists.ozlabs.org>; Tue, 29 Aug 2017 02:25:41 -0400","from localhost\n\tby e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <skiboot@lists.ozlabs.org> from <cyril.bur@au1.ibm.com>;\n\tTue, 29 Aug 2017 16:25:39 +1000","from d23relay09.au.ibm.com (202.81.31.228)\n\tby e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tTue, 29 Aug 2017 16:25:36 +1000","from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96])\n\tby d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv7T6PZIH38404256\n\tfor <skiboot@lists.ozlabs.org>; Tue, 29 Aug 2017 16:25:35 +1000","from d23av01.au.ibm.com (localhost [127.0.0.1])\n\tby d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv7T6PZTh022628\n\tfor <skiboot@lists.ozlabs.org>; Tue, 29 Aug 2017 16:25:35 +1000","from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14])\n\tby d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv7T6PZes022623; Tue, 29 Aug 2017 16:25:35 +1000","from camb691.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114])\n\t(using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby ozlabs.au.ibm.com (Postfix) with ESMTPSA id 29655A0259;\n\tTue, 29 Aug 2017 16:25:35 +1000 (AEST)"],"From":"Cyril Bur <cyril.bur@au1.ibm.com>","To":"skiboot@lists.ozlabs.org, stewart@linux.vnet.ibm.com","Date":"Tue, 29 Aug 2017 16:24:56 +1000","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170829062506.8317-1-cyril.bur@au1.ibm.com>","References":"<20170829062506.8317-1-cyril.bur@au1.ibm.com>","X-TM-AS-MML":"disable","x-cbid":"17082906-0016-0000-0000-000002619C45","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17082906-0017-0000-0000-000006E4665A","Message-Id":"<20170829062506.8317-4-cyril.bur@au1.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-29_01:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708290096","Subject":"[Skiboot] [RFC PATCH 03/13] external/pflash: Use\n\tffs_entry_user_to_string() to standardise flag strings","X-BeenThere":"skiboot@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Mailing list for skiboot development <skiboot.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/skiboot/>","List-Post":"<mailto:skiboot@lists.ozlabs.org>","List-Help":"<mailto:skiboot-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"Skiboot\"\n\t<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"},"content":"Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>\n---\n external/pflash/pflash.c                 | 14 +++++---------\n external/pflash/test/results/01-info.out | 10 +++++-----\n 2 files changed, 10 insertions(+), 14 deletions(-)","diff":"diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c\nindex a08ea946..3be43ac0 100644\n--- a/external/pflash/pflash.c\n+++ b/external/pflash/pflash.c\n@@ -101,8 +101,8 @@ static uint32_t print_ffs_info(struct ffs_handle *ffsh, uint32_t toc)\n \n \tfor (i = 0;; i++) {\n \t\tuint32_t start, size, act, end;\n+\t\tstruct ffs_entry_user user;\n \t\tchar *name = NULL, *flags;\n-\t\tint l;\n \n \t\trc = ffs_part_info(ffsh, i, &name, &start, &size, &act, NULL);\n \t\tif (rc == FFS_ERR_PART_NOT_FOUND)\n@@ -115,17 +115,13 @@ static uint32_t print_ffs_info(struct ffs_handle *ffsh, uint32_t toc)\n \t\t    goto out;\n \t\t}\n \n-\t\tl = asprintf(&flags, \"[%c%c%c%c%c]\",\n-\t\t\t\thas_ecc(ent) ? 'E' : '-',\n-\t\t\t\thas_flag(ent, FFS_MISCFLAGS_PRESERVED) ? 'P' : '-',\n-\t\t\t\thas_flag(ent, FFS_MISCFLAGS_READONLY) ? 'R' : '-',\n-\t\t\t\thas_flag(ent, FFS_MISCFLAGS_BACKUP) ? 'B' : '-',\n-\t\t\t\thas_flag(ent, FFS_MISCFLAGS_REPROVISION) ? 'F' : '-');\n-\t\tif (l < 0)\n+\t\tuser = ffs_entry_user_get(ent);\n+\t\tflags = ffs_entry_user_to_string(&user);\n+\t\tif (!flags)\n \t\t\tgoto out;\n \n \t\tend = start + size;\n-\t\tprintf(\"ID=%02d %15s 0x%08x..0x%08x (actual=0x%08x) %s\\n\",\n+\t\tprintf(\"ID=%02d %15s 0x%08x..0x%08x (actual=0x%08x) [%s]\\n\",\n \t\t\t\ti, name, start, end, act, flags);\n \n \t\tif (strcmp(name, \"OTHER_SIDE\") == 0)\ndiff --git a/external/pflash/test/results/01-info.out b/external/pflash/test/results/01-info.out\nindex 43baf316..840890f4 100644\n--- a/external/pflash/test/results/01-info.out\n+++ b/external/pflash/test/results/01-info.out\n@@ -6,8 +6,8 @@ Erase granule =  0KB           B:BACKUP, F:REPROVISION\n \n TOC@0x00000000 Partitions:\n -----------\n-ID=00            part 0x00000000..0x00000300 (actual=0x00000300) [-----]\n-ID=01             ONE 0x00000300..0x00000400 (actual=0x00000100) [E----]\n-ID=02             TWO 0x00000400..0x00000500 (actual=0x00000100) [E---F]\n-ID=03           THREE 0x00000500..0x00000600 (actual=0x00000100) [E---F]\n-ID=04            FOUR 0x00000600..0x00000700 (actual=0x00000100) [E---F]\n+ID=00            part 0x00000000..0x00000300 (actual=0x00000300) [-------]\n+ID=01             ONE 0x00000300..0x00000400 (actual=0x00000100) [EV-----]\n+ID=02             TWO 0x00000400..0x00000500 (actual=0x00000100) [E-----F]\n+ID=03           THREE 0x00000500..0x00000600 (actual=0x00000100) [E-----F]\n+ID=04            FOUR 0x00000600..0x00000700 (actual=0x00000100) [E-----F]\n","prefixes":["RFC","03/13"]}