From patchwork Thu Feb 1 07:02:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cong Liu X-Patchwork-Id: 195186 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp264236dyc; Wed, 31 Jan 2024 23:14:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpC6nAHhwHJ3hiMnNhjfE9JN+vvy9dw1JYkshYZQb1OWHhtzvi3wNM1hsjf6uDzn92KMek X-Received: by 2002:a17:902:cec6:b0:1d9:4ebd:b94d with SMTP id d6-20020a170902cec600b001d94ebdb94dmr1290726plg.55.1706771670918; Wed, 31 Jan 2024 23:14:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706771670; cv=pass; d=google.com; s=arc-20160816; b=ITwVk4udxb7+dKP20WQt5V8Xs/onLIVlXZDI+iB7OaDARLZBArP55v8WQBaQ3scAiY D6dV5i+PSLHwmlDktjzqxJznjfkVFxd/6w0D3vPCNqpssk1AyFsunKrrGLCD20TH5U/b zQRITNLDVSl2lzfc3JKn1HfaXaqmcNIDywtcfXoFhYtD0CmmgwrBsbFKnFkDsbTz0yjg bZM6GGCYmahYwzqjPTXd0Oe8JhuzlQXdzPh1wOLI8yl80NTKRwV5g7NgNQqsBJSIhaZi VTlBEUqv6X8QoqIQyMDJNXhPVeLRAm2TkKmhay8U2GFKtuCxSkiDhyy5AsCDeLtEnfJD SOIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=zjRkPSb/oEmWiRWnNViiTJeK+zcCpnN5gSDm0HRStyg=; fh=n1ueD2oDdZizBoG77nU75Ryp8x0EdlD7zUbE4082F20=; b=eN6pSK+KiNOMpAM5w8e0NnbBuHs51vW9bdJAzw3N0OrTjdEO4Bvfs461pPSni87SOT wS5ZRClg0Hq6+lttV7LVH4as9NO5bUdRCDYUFXBLc+nTx4nOanvtCEZQaQgBfag6vpjZ 1Typ1gzctv38DK4b2FC6y6ZWIoffCax1HIUJhiJAW3Nk9fza5XlTiuDUUZJas5U2hrov ThAO//nLA7mnxNixPiIUNBfNuv9n7eWPFyGCWJtCKpdI4RTzfRnMPKRQ3eHTWtHk8nma Pr4BBtzhkWT/hjQHta42Tvuk+NjWTZ5D3wBAaBQTsLuboRu/NHCs1EeytN+xSvNAvNDM MNPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-47723-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47723-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXvPZs3RR4MlsqO/OR/SOt/IWmFZ4Sw6LTaKspA642cADZ3KXa9Z94IrFzISuPFp34UBTyz1H47YXfBkoacVKEROI9nTg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t2-20020a1709028c8200b001d485a81276si10843572plo.262.2024.01.31.23.14.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 23:14:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47723-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-47723-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47723-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CD831291B48 for ; Thu, 1 Feb 2024 07:13:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1B65158D75; Thu, 1 Feb 2024 07:13:10 +0000 (UTC) Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3351157E94; Thu, 1 Feb 2024 07:13:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706771589; cv=none; b=FXFPJPfxkshmq2Rq3H+6lreKzw07qZwA4gWNTLjcWMQyXoNzZraXIcF2NyO0ckZn2IaLk03nfo3ENAirbDcqGkdwG6g5+YjV4/0QIUajXAzyY4xlkqxc3XB6SomVoiajvnW/+UyL1jVF/LocnpJ/kQWufiK0p5jthTnVHqaOxbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706771589; c=relaxed/simple; bh=huJMH0x/uqn1CsjcUxnVfiPIVCd0M2fQhOLMlIRHHMs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=MYwNwimYprF2q0T3nCuGFwwXiqVq0mKqu3wODJOFO/sw5/fhAjseaRmSNx+ftEjcJv/WwYZJk4/7qCy3+4/mgBzJRemOIHqPv1/tJ4CgTYnP8IUNayxYQmTIrwxWK9Yw+qQ3Z1OmKn9nycC9hO0YxNmcM5o/p7VdkNJeBhMS6mo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 791b174af724403da7687f9cd8aebb6e-20240201 X-CID-O-RULE: Release_Ham X-CID-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:e3ed52e8-b592-4d07-9f9e-0e04c6561891,IP:15, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-INFO: VERSION:1.1.35,REQID:e3ed52e8-b592-4d07-9f9e-0e04c6561891,IP:15,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:0 X-CID-META: VersionHash:5d391d7,CLOUDID:de707f83-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:2402011502192136VGHT,BulkQuantity:0,Recheck:0,SF:24|17|19|44|66|38|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:1,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI, TF_CID_SPAM_ULS X-UUID: 791b174af724403da7687f9cd8aebb6e-20240201 X-User: liucong2@kylinos.cn Received: from localhost.localdomain [(116.128.244.171)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 568714648; Thu, 01 Feb 2024 15:02:18 +0800 From: Cong Liu To: Daniel Vetter , Helge Deller Cc: Cong Liu , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] fbdev/core: Replace deprecated simple_strtol with kstrtol Date: Thu, 1 Feb 2024 15:02:16 +0800 Message-Id: <20240201070216.3291999-1-liucong2@kylinos.cn> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789679811616823668 X-GMAIL-MSGID: 1789679811616823668 This patch replaces the use of the deprecated simple_strtol [1] function in the modedb.c file with the recommended kstrtol function. This change improves error handling and boundary checks. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull Signed-off-by: Cong Liu --- drivers/video/fbdev/core/modedb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/core/modedb.c b/drivers/video/fbdev/core/modedb.c index 7196b055f2bd..eebbbc7e2aa3 100644 --- a/drivers/video/fbdev/core/modedb.c +++ b/drivers/video/fbdev/core/modedb.c @@ -661,7 +661,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, namelen = i; if (!refresh_specified && !bpp_specified && !yres_specified) { - refresh = simple_strtol(&name[i+1], NULL, + refresh = kstrtol(&name[i+1], NULL, 10); refresh_specified = 1; if (cvt || rb) @@ -672,7 +672,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, case '-': namelen = i; if (!bpp_specified && !yres_specified) { - bpp = simple_strtol(&name[i+1], NULL, + bpp = kstrtol(&name[i+1], NULL, 10); bpp_specified = 1; if (cvt || rb) @@ -682,7 +682,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, break; case 'x': if (!yres_specified) { - yres = simple_strtol(&name[i+1], NULL, + yres = kstrtol(&name[i+1], NULL, 10); yres_specified = 1; } else @@ -719,7 +719,7 @@ int fb_find_mode(struct fb_var_screeninfo *var, } } if (i < 0 && yres_specified) { - xres = simple_strtol(name, NULL, 10); + xres = kstrtol(name, NULL, 10); res_specified = 1; } done: