Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1924395rwd; Fri, 2 Jun 2023 02:04:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UOMCs/gN135V4rqUveK36K8UdjDlsT4PrRYkTNs5XiMUo7Rt3VzE+GZEUD0uJdkWqCzMy X-Received: by 2002:a5d:9f0b:0:b0:775:3e80:4e3e with SMTP id q11-20020a5d9f0b000000b007753e804e3emr2163240iot.2.1685696656704; Fri, 02 Jun 2023 02:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685696656; cv=none; d=google.com; s=arc-20160816; b=u9y7Yd+DwYs9JCKtvcOsewe/s7anGvLuwd++R1bgqR66Asb+L7UYy7hShuG+ZHjuWy 87scq4tO0n/v8QHnm/QmA7Z7QTwym8QejIabf/IWHmmcryi7YTAtnNBGAtGUrK9JRN+k 7orbW3e7Jw6fvncJuJkH/Wy21BEkoIByl94hX9qqjxcCFE7TBzNwf1ZgFdMoFQZx3xX0 WNqrvO68+SnJ4ma1Vsn56XsEZaLYiHQt7FARK8IGkrcPSZZRLccFX90WuOmCwpAX1n3e Xx0V8TzvuUi1tVeRznO3TRV8dFFe+qixtNoLac8PsLSlJZ5JXsvOehyGrY96NPxyDQhE DruQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9zc7ZoC9ufmLZ0HTptACDG80Bv4ZTW0gU28aBqMAQ28=; b=p+yUBZ//f3pxibvCSgp1pgH+ZENjMc+tB8CcHBinDBVrdup4j+fB8ouv+2gEjhXzRH K3LwkihWECKa7A8WO/2+P/SvjcQkKf60zGyOdwhF3UrG/Ampd3f+PgA/DuYKBqVA6T0v 59fzrVJv6+Bzgx2IU5FE+BvMnspx09ni+Qz17Gal+ww5txECdoXlDjNkAKu/78KtLjnu 2NlHsFICg72s0ciJkFwWf5SS+lfZGXfdXcnD7de2NK/axgfTkVwh2RxC4I7gDkjD8Gn9 gM4XmqLjXDQ+YMU+GrCeso3KPZsA1GQQigwSonc9rIet/BrUxWNA5Mlyht/ac6Q/GECH 6bjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=noQ6iT+Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 79-20020a630252000000b00534792ee482si665820pgc.758.2023.06.02.02.04.01; Fri, 02 Jun 2023 02:04:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=noQ6iT+Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233639AbjFBJAK (ORCPT + 99 others); Fri, 2 Jun 2023 05:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234055AbjFBI71 (ORCPT ); Fri, 2 Jun 2023 04:59:27 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B979D; Fri, 2 Jun 2023 01:59:26 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-96f7bf29550so259022866b.3; Fri, 02 Jun 2023 01:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1685696365; x=1688288365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9zc7ZoC9ufmLZ0HTptACDG80Bv4ZTW0gU28aBqMAQ28=; b=noQ6iT+Zr7wBbvSQToDpSqgpxhB3F8DQ7YA2XsULplVfVp5R5YqmY3FHk8ovcsM6kn 8lcvp9nUS4S2lAtbpJl+W3yn94WW7lSoeA4WLurw2tQWOaVSUw5Tu3FuinKhnn3ms0nf Abpz0OrT8dsy3dQ2kbcSlDoTJHo0wsJ4GuP3onbVggM6cbG7AAYa+YN3knINEHsQvjwi JLrSwmwT8Ze+iRo4PPzEkEdxzDcA1lK2QuRbWRDmaUBtA7vlIm6UPIzfWX3/IzG/qvIZ zERj6Bksr/WSc1QqwTTebH3AOjgskL/eaw6xW/K1T7G4BxRK/fekA7CD53kV4xW3YfUd 5clw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685696365; x=1688288365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9zc7ZoC9ufmLZ0HTptACDG80Bv4ZTW0gU28aBqMAQ28=; b=TUnddiv8NmRlpx+jxZLADNmYb/2ScGcfG31i7mMnsPXezZuHLGgT5WmWg3AguX35ie Zizhc1QVI1ALThtptNw6knvmnkzwCU6GKs/S5apHuHuCIbGgMRuGSKirMySraM6WVR+a 2Kj27ppkUhnVY5Ftt+Rk6ujm1hehiGaYeYskOj7UGLPvw+PAGb6Me1s6AyU+y8BtgPq+ FseonMfTeNBo+u/9zIRkgNI9Dl6bMaafucjpbjKd3lWtpe/ew5JuhZuMDp/m/JYzkL8k WVLIYluXjtUJPgOAyMlauI2O8LgX78pPYHsWi0cDRHnYPkokaOIYnKuXLx+7Q/Chnm0t R1MQ== X-Gm-Message-State: AC+VfDyGJE8NYLY9aqFXBMI+jsiOFtbpbczOMlioCu+yazPvo93m/bJw F0cj1S3L866HVbXq+XrV7VLwTv+0qsy5CQ== X-Received: by 2002:a17:907:2d08:b0:96f:f807:6af5 with SMTP id gs8-20020a1709072d0800b0096ff8076af5mr10701027ejc.39.1685696364694; Fri, 02 Jun 2023 01:59:24 -0700 (PDT) Received: from localhost.localdomain ([2a02:810a:9640:26a8:7ce9:cf23:e2e1:1e2e]) by smtp.gmail.com with ESMTPSA id h27-20020a1709062ddb00b00965cfc209d5sm505722eji.8.2023.06.02.01.59.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 02 Jun 2023 01:59:24 -0700 (PDT) From: Franziska Naepelt X-Google-Original-From: Franziska Naepelt To: keyrings@vger.kernel.org Cc: dhowells@redhat.com, dwmw2@infradead.org, linux-kernel@vger.kernel.org, Franziska Naepelt , kernel test robot Subject: [PATCH v2] certs/extract-cert: Fix checkpatch issues Date: Fri, 2 Jun 2023 10:59:02 +0200 Message-Id: <20230602085902.59006-1-franziska.naepelt@gmail.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20230601190508.56610-1-franziska.naepelt@gmail.com> References: <20230601190508.56610-1-franziska.naepelt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following issues are fixed: - WARNING: Missing or malformed SPDX-License-Identifier tag - ERROR: trailing statements should be on next line - WARNING: braces {} are not necessary for single statement blocks - ERROR: space required before the open parenthesis '(' - ERROR: code indent should use tabs where possible - WARNING: please, no spaces at the start of a line - WARNING: Missing a blank line after declarations Closes: https://lore.kernel.org/oe-kbuild-all/202306021040.UTvXfH5J-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202306021102.zQU95cMI-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Franziska Naepelt --- v2: - revert noreturn changes to fix build issues --- certs/extract-cert.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/certs/extract-cert.c b/certs/extract-cert.c index 70e9ec89d87d..96c0728bf4d1 100644 --- a/certs/extract-cert.c +++ b/certs/extract-cert.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: LGPL-2.1 /* Extract X.509 certificate in DER form from PKCS#11 or PEM. * * Copyright © 2014-2015 Red Hat, Inc. All Rights Reserved. @@ -63,7 +64,8 @@ static void drain_openssl_errors(void) if (ERR_peek_error() == 0) return; - while (ERR_get_error_line(&file, &line)) {} + while (ERR_get_error_line(&file, &line)) + ; } #define ERR(cond, fmt, ...) \ @@ -73,7 +75,7 @@ static void drain_openssl_errors(void) if (__cond) { \ err(1, fmt, ## __VA_ARGS__); \ } \ - } while(0) + } while (0) static const char *key_pass; static BIO *wb; @@ -107,7 +109,7 @@ int main(int argc, char **argv) if (verbose_env && strchr(verbose_env, '1')) verbose = true; - key_pass = getenv("KBUILD_SIGN_PIN"); + key_pass = getenv("KBUILD_SIGN_PIN"); if (argc != 3) format(); @@ -118,6 +120,7 @@ int main(int argc, char **argv) if (!cert_src[0]) { /* Invoked with no input; create empty file */ FILE *f = fopen(cert_dst, "wb"); + ERR(!f, "%s", cert_dst); fclose(f); exit(0); @@ -155,6 +158,7 @@ int main(int argc, char **argv) x509 = PEM_read_bio_X509(b, NULL, NULL, NULL); if (wb && !x509) { unsigned long err = ERR_peek_last_error(); + if (ERR_GET_LIB(err) == ERR_LIB_PEM && ERR_GET_REASON(err) == PEM_R_NO_START_LINE) { ERR_clear_error(); base-commit: 7877cb91f1081754a1487c144d85dc0d2e2e7fc4 -- 2.39.2 (Apple Git-143)