From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DD16C352A4 for ; Thu, 13 Feb 2020 00:48:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F107920873 for ; Thu, 13 Feb 2020 00:48:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729428AbgBMAsQ (ORCPT ); Wed, 12 Feb 2020 19:48:16 -0500 Received: from mail-vs1-f66.google.com ([209.85.217.66]:35753 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729103AbgBMAsP (ORCPT ); Wed, 12 Feb 2020 19:48:15 -0500 Received: by mail-vs1-f66.google.com with SMTP id x123so2842257vsc.2 for ; Wed, 12 Feb 2020 16:48:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=etgnyDP0JhwByes0FkH9VjqAFbGnVuZCHaN9A7IERGE=; b=YAtGd5pbARBosER19TYDP6Dg2z2lMUUEtkvwJMw6zP1Uc42T3Yijun+bbQ6zEELW3y 9Z4sybKlG12dvBgrXZT6bNhcdyPMnNjwI6r+3jGfxV+pyFMSenAQQPNZo/dNQ0qyTSaz b3BihOfWiAKVBmVH9UlT1HmzBXK2di/D/i3s7aqZMaET5TZu96ihMHmZhZw/PCFjYjJY nKrvsbjMo7tRCDAMGHs2Wb0ZUVySSxALo1eVrhyPw0mYyRL83jYrHKigUZd4zBELkqCn 6716aCqC+n93E/nLTqdsYFbWmky9ZEopjSGKAvwdGbateX/nM2kXClZYN9Ntix43D6AJ G5JQ== X-Gm-Message-State: APjAAAUG1pw6JWTXnx/UwutPNY/xKlnUgZalXFTuNMmSyJBPbdHpux3L 1pGxKoko7O9V6BGvvsJYc9UiXtsWg1eiJOcuc6W1aLGg X-Google-Smtp-Source: APXvYqxyLrMRahjmqKlywAUlwuEiKnatbf9XTuAHLPIGa7lzpNd+yjxbwMxtdex2DkLVIsbw24IzoYUO9Yx+8Mhm/RA= X-Received: by 2002:a05:6102:3024:: with SMTP id v4mr772396vsa.220.1581554894555; Wed, 12 Feb 2020 16:48:14 -0800 (PST) MIME-Version: 1.0 References: <20200209174937.22844-1-imirkin@alum.mit.edu> <20200209174937.22844-2-imirkin@alum.mit.edu> <3e56402b-9841-99a3-730c-b1fd2bc2cc5d@xs4all.nl> In-Reply-To: From: Ilia Mirkin Date: Wed, 12 Feb 2020 19:48:03 -0500 Message-ID: Subject: Re: [PATCH 1/2] edid-decode: add function to enable usage as a library To: Hans Verkuil Cc: linux-media@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Mon, Feb 10, 2020 at 9:58 AM Ilia Mirkin wrote: > On Mon, Feb 10, 2020 at 6:23 AM Hans Verkuil wrote: > > > + for (unsigned i = 0; i < EDID_MAX_BLOCKS + 1; i++) { > > > + s_msgs[i][0].clear(); > > > + s_msgs[i][1].clear(); > > > + } > > > > I'm pretty sure that this for loop is not necessary. Can you drop this > > for loop and see if it works? > > The current code has: > > static void show_msgs(bool is_warn) > { > printf("\n%s:\n\n", is_warn ? "Warnings" : "Failures"); > for (unsigned i = 0; i < state.num_blocks; i++) { > if (s_msgs[i][is_warn].empty()) > continue; > print-the-error > > What would prevent an error from a previous run to appear without an > explicit clearing of s_msgs? Hi Hans, Do you agree with my assessment above? -ilia