From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa34.google.com (mail-vk1-xa34.google.com [IPv6:2607:f8b0:4864:20::a34]) by sourceware.org (Postfix) with ESMTPS id DE2063858D38 for ; Mon, 3 Oct 2022 17:02:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DE2063858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-vk1-xa34.google.com with SMTP id y129so5775660vkg.8 for ; Mon, 03 Oct 2022 10:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=ItitUC9haNd93RHWDFunGaMrrcMIh11E023n111lS4Q=; b=lU1TkpgAPQ7NHDeEGrBCpu7x0oiaOzM+YFuEp4YODsn/jWC1+j+RkLrYQGLrTUT9ZQ vfmlmeDpB38yiIvIIDPn4fqU8gt4JbAa4kCYd0zSa7/hNFlp+r9vtnoW+A0+goOOG3a8 SYb6yEJi9Hr4Uc/YXw06x81a0RzfAF/RNOG9H0tiS7BPdRyn5nIpHuhCCug0/TPyivcK XpfiKugoiiaDGjK1uxoFVnFlY5QJEe1QoB+pWJeCCuR8gGXLub4ne8XRCmEqo+slpACa d4IdPnT+TbuNeukLZMVbjEDjeHSdWw/9F+X+Undu+8nyg5ztuYvBEIreKVbupO+OtuSG EgQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=ItitUC9haNd93RHWDFunGaMrrcMIh11E023n111lS4Q=; b=DC/ngD8dw4I92RG3AHBNYRBksE6HPkYJtmSGKibc/uBl+DS3WOOYrslSaDKNOI9vKc mEKRWJzT9XtIieDRNGwFniMehE5kBziOcTEYa2PYpfBFlmNBdhXjCci2gMnqsO8vUXNT qg0TSb39wiKZnZO5qHWDdIS4vbzTna4OKOizpX6yMclkbaAKSySZ3zcJvzJOrdh6MQln NCHemEQKoEJGuUPtA0N0KMx0v7WQr+oC+RFh9fXAiFTdcSvweFPSgG/xIG60IS7h0IJ6 5/cPNLFsSLkKv35egEbmzrAyKCy1AP4IiQCHhSNI82Qorpru2N7b1ZamHoNBDLJFOsrj 6WrA== X-Gm-Message-State: ACrzQf2eCQtoWkEcbGjzMsbWA2227cgw1oVDTIxeIKIiLb7ulzJsVWa8 R9TpZJndE6SMZga+XCzlUPyxRg== X-Google-Smtp-Source: AMsMyM7eEHJjQPUme4yavQvUvUKFjqKDtX76JCA+z2jEJbX4Z9v7cjq4eWa+cfw2+IeMzGqP7RkDMQ== X-Received: by 2002:a05:6122:10e4:b0:3a3:e3:d448 with SMTP id m4-20020a05612210e400b003a300e3d448mr9168982vko.29.1664816535958; Mon, 03 Oct 2022 10:02:15 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c2:b87d:f936:fc03:6bdb:fa59? ([2804:1b3:a7c2:b87d:f936:fc03:6bdb:fa59]) by smtp.gmail.com with ESMTPSA id s135-20020a1f458d000000b003a9be3e0a34sm4370708vka.13.2022.10.03.10.02.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Oct 2022 10:02:15 -0700 (PDT) Message-ID: <006b321e-8003-5489-92af-1db7cadf3608@linaro.org> Date: Mon, 3 Oct 2022 14:02:13 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v3 8/8] elf: Simplify output of hwcap subdirectories in ld.so help Content-Language: en-US To: Javier Pello , libc-alpha@sourceware.org References: <20220905200652.d69204581d15c64647da5cd2@otheo.eu> <87h71l9crb.fsf@oldenburg.str.redhat.com> <20220906201207.e7b3d08272af5649754e76b1@otheo.eu> <87h71i6rfa.fsf@oldenburg.str.redhat.com> <20220914200724.8e685fbbaf441c96d19011c6@otheo.eu> <20220917161748.2b76e1731a27eb78880ee57c@otheo.eu> <20220927200352.0424a12908a437fef9d3a7bc@otheo.eu> <20220927201008.ee65c40e3703598164e60dff@otheo.eu> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20220927201008.ee65c40e3703598164e60dff@otheo.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 27/09/22 15:10, Javier Pello wrote: > The print_hwcap_1 machinery was useful for the legacy hwcaps > subdirectories, but it is not worth the trouble now that they > are gone. > > Signed-off-by: Javier Pello LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > elf/dl-usage.c | 43 +++++++------------------------------------ > 1 file changed, 7 insertions(+), 36 deletions(-) > > diff --git a/elf/dl-usage.c b/elf/dl-usage.c > index efd6c77c..754a6391 100644 > --- a/elf/dl-usage.c > +++ b/elf/dl-usage.c > @@ -104,34 +104,6 @@ print_search_path_for_help (struct dl_main_state *state) > print_search_path_for_help_1 (__rtld_search_dirs.dirs); > } > > -/* Helper function for printing flags associated with a HWCAP name. */ > -static void > -print_hwcap_1 (bool *first, bool active, const char *label) > -{ > - if (active) > - { > - if (*first) > - { > - _dl_printf (" ("); > - *first = false; > - } > - else > - _dl_printf (", "); > - _dl_printf ("%s", label); > - } > -} > - > -/* Called after a series of print_hwcap_1 calls to emit the line > - terminator. */ > -static void > -print_hwcap_1_finish (bool *first) > -{ > - if (*first) > - _dl_printf ("\n"); > - else > - _dl_printf (")\n"); > -} > - > /* Print the header for print_hwcaps_subdirectories. */ > static void > print_hwcaps_subdirectories_header (bool *nothing_printed) > @@ -165,9 +137,7 @@ print_hwcaps_subdirectories (const struct dl_main_state *state) > { > print_hwcaps_subdirectories_header (¬hing_printed); > print_hwcaps_subdirectories_name (&split); > - bool first = true; > - print_hwcap_1 (&first, true, "searched"); > - print_hwcap_1_finish (&first); > + _dl_printf (" (searched)\n"); > } > > /* The built-in glibc-hwcaps subdirectories. Do the filtering > @@ -178,13 +148,14 @@ print_hwcaps_subdirectories (const struct dl_main_state *state) > { > print_hwcaps_subdirectories_header (¬hing_printed); > print_hwcaps_subdirectories_name (&split); > - bool first = true; > - print_hwcap_1 (&first, mask & 1, "supported"); > bool listed = _dl_hwcaps_contains (state->glibc_hwcaps_mask, > split.segment, split.length); > - print_hwcap_1 (&first, !listed, "masked"); > - print_hwcap_1 (&first, (mask & 1) && listed, "searched"); > - print_hwcap_1_finish (&first); > + if (mask & 1) > + _dl_printf (" (supported, %s)\n", listed ? "searched" : "masked"); > + else if (!listed) > + _dl_printf (" (masked)\n"); > + else > + _dl_printf ("\n"); > mask >>= 1; > } >