Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp279518lqf; Fri, 26 Apr 2024 06:38:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWnTsskLvvoUuy9CkO7jS2tC/JYEtxjs+tkR33wRgrlcyEh+FYqK/9amENnqdhbq3mfqhBHwuziUew5WUdhIrkQ/waWf1oqW8wKoKLgjg== X-Google-Smtp-Source: AGHT+IHBF5QI39W/Q+dyfRevmUKd7HMIpWiTINWKiHrVw9KMa2p+TQ/XQJxYn0xKc/roZEhC35us X-Received: by 2002:a17:902:6b45:b0:1e8:9054:101a with SMTP id g5-20020a1709026b4500b001e89054101amr2186762plt.60.1714138700439; Fri, 26 Apr 2024 06:38:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714138700; cv=pass; d=google.com; s=arc-20160816; b=o+0ZqwwFSRdkFwdXx6y0r+jo084sPtIrEbrqA322fxwxG6MQ9WjK3jV0irxn8SKzDH BzdUWLJxbpYw/cVScsMFEftIJfRxgPp+pT2FdwEWphDC0AtaWEtlEZviQvFcC5pd039I EduZLx8hy8h4/erDAooKViRQTjjiFtf2qvNkSTTrJXNIaDte21tclhqv4+dNnwZTiA0d oVbUk826w2m0hdEvlM5zFQrd4S+kyh9vH/Kq2++EMpach17WMfF2+aecYyaBHcOMdj9M Sf2W8RLs+dE4AlXto6frrU1yQyzDCAF5sZC9MMg7mwpJwUKxBelxDNBW1qDp0X7+AkIs H6cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=X4QMDNlauyd66ufLUeH7YRbbHnbJwVK53B+XBL6CSCM=; fh=VTfSvF8XWNd67+EwpCzskDt9fgMcR32gjohZmmc+PxQ=; b=Q6jlz2SAiEDA8LdddqO8SCsvEX+fFdK6bXe6uFTpjoNCGs1i91E7SEhvbI9l2XuxAk L6JxEWHd6omJ24WSn7QwhtpMDHnVSTHC46R/MWOk4v+A692h+vcKW4UXC+CGQUbVCL7G ftgvWIqjBgMRHLj3j6nqm9v/kY58DU3uJuISnkqgJxB03kSaczOW6rc7Ql5y+DSm4o+p Gt8asfiQfd0wZM1RcNB5mXKDtffjEr+JE+TZlWdsF98sf0B/NDK0RaJHTzIjzikc6j9w P/bdPnzW5lH5wvwixsc0IoQYHMY+MT03wG/qECSD0Imtpz+h01eD8CpwpBBZOzL+HGqP Uaaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dOrjKOfU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-160061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160061-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lm8-20020a170903298800b001e5c05b6606si14974612plb.85.2024.04.26.06.38.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 06:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dOrjKOfU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-160061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160061-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7F6F2B2193F for ; Fri, 26 Apr 2024 13:36:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 268EF147C72; Fri, 26 Apr 2024 13:36:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dOrjKOfU" Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CCFF145343; Fri, 26 Apr 2024 13:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714138589; cv=none; b=sa7mWiBqXkLYCT4S1tbwZzFU8XfugcKCfDJfnUnfMNY4LWbvE02XE+C1avpeTgwHg7Q24MldkinZ3afysqP9w7eTeE8WIuQ3QVnEz/AkGjg2ZzVIDirTBqjmXYSIwR4/WNJe58wvKkyfPolRuaPkX6AsaQPf9ipe4IZE14my1SI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714138589; c=relaxed/simple; bh=LM9VwrU66EmUoyoapr/EkV6USSuQIFOkkUsLl4/DLvY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mAmtg+v8NPtB4CtWwzqFtiFRWaew4rkNKfWrO3H7aMdxwe1Q5wBrWXRQVTpyLShG+l3+4IlyuqostPIR86+x5aoj6L4YLE+CTjTu8Awsjm47CP49aipxzMPDh/lKyll6PpEcQgEF9tP64k2h199YP6tqDsG21IZcWXFDQISToWE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dOrjKOfU; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6ed5109d924so1930943b3a.0; Fri, 26 Apr 2024 06:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714138586; x=1714743386; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=X4QMDNlauyd66ufLUeH7YRbbHnbJwVK53B+XBL6CSCM=; b=dOrjKOfU5La+bDTUuJpV4jMNRyHv6rJEjjeyg6uRCxBWYKussWbyZvBit8IbqW5Wj1 lqWxIRjxpbAf/NXsJ2H6IcfjxWL2/vp1PzGMlO0cbYbTKlHFAR6XL1FaRNRGl3V0o4U9 B1lDhSK2q2IGV4fXCQGH7/NrWHBdiVwKhabObwVbrCnGLyld7iQB2HxwDnF1D2Wg2ofb vMSd3ln3knWcemqhy17QbG+P60YeQYggNoXhAXsjs6pQgeNJfoRPQ/CpTWUWvZiS3YjP PqmoKrimwm2y5mS27GgexUGuOjlR5vq8wClk9YOEJT4osBbzFCiIlycqKlPawh8XE4gF 3T6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714138586; x=1714743386; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=X4QMDNlauyd66ufLUeH7YRbbHnbJwVK53B+XBL6CSCM=; b=FmJz+qViu1aKQ7DtMW5/gXPSMEVaXfM/7ZDYfPta4Opt0x8/0uzcRlr/M0X6C+H/j+ xQn7ut6Bnd3tGUrsdjPq2BuKTwWTTjOrcrV3IWx5dcoWAx+vlODL1q2t2xQvnkRiw7O6 OXRnBV9i6H8FN2649idElsHAuRD6qK6IyOEdM6ubzZ4VDDlme0nDaCJedCfe1gK/NCOW V3MmcUl//x3jAP8QkRWqSr/j53HsfZFxF94Z1T/49W4eaOJahKDncwY0b2ZgH5VRT7wz hP4Z0BslOYyIyp9aod2Sr3xR4mEvdwfl5Q85q37YeAPTCzrXMq5gChpJ0Pk149dM7dHZ YyMw== X-Forwarded-Encrypted: i=1; AJvYcCV845tFryP1Qd+Kz2E48AHlwxX2ih8z+kxNBuny1WdGlJlH7Ld8ReBF6MCIDUJjtOt67eWho/azfxsR+ssEV1wC0i+Us2+t4AYMZ/6D X-Gm-Message-State: AOJu0Ywdc+aso+v6YUnzJYCFVaBF7lEdnPKu6+lB15CrLcu8nwKVF3so LUnLbtxND6PiEkODHnMlbH3gG+Yka6Ar9rFQwm6bmCyLyIysEn4/ X-Received: by 2002:a05:6a20:5504:b0:1a7:aba5:7ce9 with SMTP id ko4-20020a056a20550400b001a7aba57ce9mr2465969pzb.34.1714138586474; Fri, 26 Apr 2024 06:36:26 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id x1-20020a63b201000000b005e838b99c96sm14550674pge.80.2024.04.26.06.36.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 06:36:25 -0700 (PDT) Sender: Guenter Roeck Message-ID: <41e47453-a014-4450-bc5b-3ef76f09b786@roeck-us.net> Date: Fri, 26 Apr 2024 06:36:23 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] watchdog: sa1100: Fix PTR_ERR_OR_ZERO() vs NULL check in sa1100dog_probe() To: Chen Ni , wim@linux-watchdog.org, arnd@arndb.de Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240426075808.1582678-1-nichen@iscas.ac.cn> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyIFJv ZWNrIChMaW51eCBhY2NvdW50KSA8bGludXhAcm9lY2stdXMubmV0PsLBgQQTAQIAKwIbAw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y3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <20240426075808.1582678-1-nichen@iscas.ac.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/26/24 00:58, Chen Ni wrote: > devm_ioremap() doesn't return error pointers, it returns NULL on error. > Update the check accordingly. > > Fixes: e86bd43bcfc5 ("watchdog: sa1100: use platform device registration") > Signed-off-by: Chen Ni Reviewed-by: Guenter Roeck > --- > drivers/watchdog/sa1100_wdt.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c > index 5d2df008b92a..34a917221e31 100644 > --- a/drivers/watchdog/sa1100_wdt.c > +++ b/drivers/watchdog/sa1100_wdt.c > @@ -191,9 +191,8 @@ static int sa1100dog_probe(struct platform_device *pdev) > if (!res) > return -ENXIO; > reg_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); > - ret = PTR_ERR_OR_ZERO(reg_base); > - if (ret) > - return ret; > + if (!reg_base) > + return -ENOMEM; > > clk = clk_get(NULL, "OSTIMER0"); > if (IS_ERR(clk)) {