Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp754323pxv; Thu, 1 Jul 2021 08:33:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2nk/GhL0Z9xrOvGrNBbk+Fbr3r4vW0m7M45dcH33/RaQcSKGpGG/Fxacgl3M6fU8hA2dd X-Received: by 2002:a17:906:d83:: with SMTP id m3mr457931eji.63.1625153626090; Thu, 01 Jul 2021 08:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625153626; cv=none; d=google.com; s=arc-20160816; b=uLkdl6yWJr8dFYdmEyQT83ZludB3FZ91zXY0JRISqduVR0zSuL7DHHo6vzCsQjqAXA 5NxjHvQFG0mjN01YRHrLV7hPR167nIc/c6TuyqHBP0Eol9FlXUxpPy0+earkjgarfuMM mcaPClyA7y7mkrcUOtCzGHy0IOwiDsHtBDK5BB5bDUDWQ/cLNmPWSu+gHK98wtPTVHSX pnZVWEbrEuNjcvlfCiqMDYy7pyFJSF8t1aN8+Zh5sLmAMY2z+VXm3eAo6V/xRU3xXfSt ou8sDZlOIByIPQgEvtRWLKf73z6yOTo4rnf88HqwZk+3HR0oso6tzYYQ3IxEF3WdVlwp a3LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=qN42ft8TO2D20OJfcUBVmNsGjubNKzxaIpoGBDjnO30=; b=Qg8vyNTylbEqlh1IXf2e+86arJ8/Igr+x5tI3ZvvZ34F21jMf8AWclUgx5lP/u2U/y GqwC4s6suJk4tL2qEAVyCf2uQpfuQSHmAnf44660zP5/HOBcQd59y3so0hW7iGb22EBk K1K47YI+1W73Qgg6kJaN9gDJbHlFZZQLHvvTI7CncyLmS0SZ7qsRnyBFwFEthPuf/UIu I71fhD4U64aOVoc2E+YY3LT/L9iLPvgIQi33IBwWVMYHQf+AxUsy45nr2gyoEaM+/+m2 6iiuPM5ZOSrPZSICoZX/Mu7pDGdBSM0nIun38Q9LPLUIrAh9uTtKBH49sYevlUwvuu3r SVzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Q7QeFRYl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h20si202737ejt.70.2021.07.01.08.33.21; Thu, 01 Jul 2021 08:33:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Q7QeFRYl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233425AbhGAPe2 (ORCPT + 99 others); Thu, 1 Jul 2021 11:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233064AbhGAPe1 (ORCPT ); Thu, 1 Jul 2021 11:34:27 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D40AC061762; Thu, 1 Jul 2021 08:31:56 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id p8so8816479wrr.1; Thu, 01 Jul 2021 08:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=qN42ft8TO2D20OJfcUBVmNsGjubNKzxaIpoGBDjnO30=; b=Q7QeFRYl7E8TGVI6mpGHeYbpPhGVz34QWBhGzMMsjh4Bs6YWjM2qYqgmf0JRNBJy2a 3lFCVl6R3hyIpFjKdgZkNYD5bD9CVRXcyIfLCeIamimChCDq7kslUlK7dFN7WiyZgpUI pPJ8EueVXNyQKlLN4tgYi5Lfzk+QnzKr0hiUcQskudq/84vuANguULX/weG/7mCLDWP4 yMdxwZZihKgyWXuzbbx/Pm16tuOL4vXbVdSzSQuGXjOpH1WoEgfq56HIDPnkrTV74eb9 uICaBniL/x9CXDDy1ASKA+KPBCFam8+J9SrY2O9Kk/eUm0jAxYKQOWzCnn1TxRPtmj0g 6FVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=qN42ft8TO2D20OJfcUBVmNsGjubNKzxaIpoGBDjnO30=; b=PaXa6yoCWMlehVrVPLWskcCpsvxrob/TC/Btov3OC1RvVhaifeImcc8cJ7lM8DqfH0 SBGzS/dHsWI5tfhg6+Zpmq2G7gcXb8+76SWZnM8cZsqmI0mfg3XSf97Y3Bd/wIONCTrg Yx7I53Ym9Bx6HXS2JNu9N296kMRf0vxrHtJjndvAFhqYwakH/9RJbvkSHB8mxKqee4na fUDGUSc+mgSciqjS/6nXwTCEsfa/3vPNTL0nACnLIVv73FhxMwgtRDt6JTUU4OgQtOe7 ASOsVCUKHXUoeuphf4tPEIn6XXAVXmu1QkQ28wJAcwpUEbl2cqCBBxw7e1+Bt/uFUgct sd/A== X-Gm-Message-State: AOAM531QmgMsSNShiwsfJtAu/yutHJckTCOx76sKaVBgFoa1VFvW4+oG D7S9RHfVl5XJuGtQYFt/9FunrSeUAIxCi93+ X-Received: by 2002:a5d:5307:: with SMTP id e7mr242782wrv.353.1625153514460; Thu, 01 Jul 2021 08:31:54 -0700 (PDT) Received: from pc ([196.235.73.129]) by smtp.gmail.com with ESMTPSA id l20sm385220wmq.3.2021.07.01.08.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 08:31:54 -0700 (PDT) Date: Thu, 1 Jul 2021 16:31:52 +0100 From: Salah Triki To: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ppc4xx: replace sscanf() by kstrtoul() Message-ID: <20210701153152.GA256018@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the checkpatch.pl warning: "Prefer kstrto to single variable sscanf". Signed-off-by: Salah Triki --- drivers/dma/ppc4xx/adma.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index df7704053d91..e2b5129c5f84 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c @@ -4319,6 +4319,7 @@ static ssize_t enable_store(struct device_driver *dev, const char *buf, size_t count) { unsigned long val; + int err; if (!count || count > 11) return -EINVAL; @@ -4327,7 +4328,10 @@ static ssize_t enable_store(struct device_driver *dev, const char *buf, return -EFAULT; /* Write a key */ - sscanf(buf, "%lx", &val); + err = kstrtoul(buf, 16, &val); + if (err) + return err; + dcr_write(ppc440spe_mq_dcr_host, DCRN_MQ0_XORBA, val); isync(); @@ -4368,7 +4372,7 @@ static ssize_t poly_store(struct device_driver *dev, const char *buf, size_t count) { unsigned long reg, val; - + int err; #ifdef CONFIG_440SP /* 440SP uses default 0x14D polynomial only */ return -EINVAL; @@ -4378,7 +4382,9 @@ static ssize_t poly_store(struct device_driver *dev, const char *buf, return -EINVAL; /* e.g., 0x14D or 0x11D */ - sscanf(buf, "%lx", &val); + err = kstrtoul(buf, 16, &val); + if (err) + return err; if (val & ~0x1FF) return -EINVAL; -- 2.25.1