Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2293321imn; Mon, 1 Aug 2022 19:27:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tTLXQqEkLOao2mHWyic8Rqf+BXesKjDaY//HzSLBoM9LYXc8iBlsUVv8q4FHY/PyqzBSoQ X-Received: by 2002:a17:907:60c7:b0:72b:5651:e1f8 with SMTP id hv7-20020a17090760c700b0072b5651e1f8mr14289965ejc.375.1659407236084; Mon, 01 Aug 2022 19:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659407236; cv=none; d=google.com; s=arc-20160816; b=c+JEDlBC3uBNL/UNRMlEOxsa7Z89XWR9U7WcU5dAY7VIsLPCvAcgKky4iDlC7pi2iC IMGK30a/y0/bVzkiHeAgyBRcGgM+roVRYZt+nAUt7hA2BWSx/jHj4c3iwUdSVgX93DVB L9Tn8KJcKfoOS7VI7oMJZ904DFPimnZQ8aQM9OrdTZlHZUlFTfbW3xpv0lA9xV6HAV8m tQS6j1Br4dskSqUMAwW9ArD+7lT+5Sz0z72vRpZo2ex2tLLSxPrfbC5aTe5/f4xHUMBv hKwFS4pm5+FmPV+Va77l9G1LQ9bQ+iDzoPBoBDsv9YECv735L3FebujL9ijeEvckYLTn Tajg== 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=AJJRn4+UTP2owWX7dG69FS4kDqEQmCJuroDTRcb5Lbk=; b=IonNoEhF1OdtLj4Pbpe9YNnI2da98fRqCH6YaGcskQydE/a3UPKnAktTJo4MyyyF2R /Jy43SHXTh/ob8KFuDrHNhmD7EnP7PYG0QAYCCB5nXGZVt4C0/PdSQVWfTO5SOVbUqaa CXmyBMS5FQirF+VO1ZzaGmyLMKxYIFn2zHOe0U0X573H8gY6eD87TZrL4s4BOFN2mZpq /efFBwW/WehbHbKzbuXvgtdOKdydT076S6x+wBd2uZJ99w9GG6WIOWf4hgoukPeWHjDm yb3isrjQNy4kAIrQ9Q461h6svuDVB7P5Y6ovRuTaSijMvA2rjqdpxv67zUN12jVB2M9W 6tVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EtwVpI63; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa5-20020a1709076d0500b0073027aa493fsi9161284ejc.393.2022.08.01.19.26.51; Mon, 01 Aug 2022 19:27: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=@kernel.org header.s=k20201202 header.b=EtwVpI63; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235462AbiHBBvh (ORCPT + 99 others); Mon, 1 Aug 2022 21:51:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231529AbiHBBve (ORCPT ); Mon, 1 Aug 2022 21:51:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3675F19282; Mon, 1 Aug 2022 18:51:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C474F61059; Tue, 2 Aug 2022 01:51:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79600C433D7; Tue, 2 Aug 2022 01:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659405092; bh=xdSHWCs9h2K8wnnw4cbgM7/350sCkbahN/3I64zs7hI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EtwVpI630efU4ieZgeGF0aDPjdpB8550taPoCLaCPoEJ0H/Y4ArTKSYtxJ3v17VzO X0QPGDTfPHKpLe3jfz6Q7BbZPMGe0QcNv8MFQNzby7tro1lN99+67F24gwVgwT8z5F JOge2Fn2f24/VAAVX/6coOhGPpArFWdSnG2Pkvs5cMPgtnGCmNmEaOgopaz2DUtAKV oHPat6UpwxJDHUY6+pk6evOjKMyYdcMgt3qFh/y5VkcHmx9P7e1qayXZhApB0xUgQD jLQFT3rfLNmVJaEkoAwMYLQ+jRjlUdmXNw36FwLYvtf8QspT7ivCMBOjE2K4Z/88x9 O4hCAG7gMfvmg== From: Miguel Ojeda To: Linus Torvalds , Greg Kroah-Hartman Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Jarkko Sakkinen , Miguel Ojeda , Boqun Feng Subject: [PATCH v8 01/31] kallsyms: use `sizeof` instead of hardcoded size Date: Tue, 2 Aug 2022 03:49:48 +0200 Message-Id: <20220802015052.10452-2-ojeda@kernel.org> In-Reply-To: <20220802015052.10452-1-ojeda@kernel.org> References: <20220802015052.10452-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 From: Boqun Feng This removes one place where the `500` constant is hardcoded. Signed-off-by: Boqun Feng Co-developed-by: Miguel Ojeda Signed-off-by: Miguel Ojeda --- scripts/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index f18e6dfc68c5..52f5488c61bc 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -206,7 +206,7 @@ static struct sym_entry *read_symbol(FILE *in) rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name); if (rc != 3) { - if (rc != EOF && fgets(name, 500, in) == NULL) + if (rc != EOF && fgets(name, sizeof(name), in) == NULL) fprintf(stderr, "Read error or end of file.\n"); return NULL; } -- 2.37.1