Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1742984rwb; Fri, 19 Aug 2022 08:40:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR43PGrgrEJGyX0H9WH/gMLZCEga6uDjoUk+OsBsVNFpz6bml8HGIG3ee6v/nUAxqueZLf/j X-Received: by 2002:a17:90a:318f:b0:1fa:a374:f565 with SMTP id j15-20020a17090a318f00b001faa374f565mr14582630pjb.146.1660923622981; Fri, 19 Aug 2022 08:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660923622; cv=none; d=google.com; s=arc-20160816; b=Q88vdWlSzoUGa16Oc07FwgqNLn1md8Oft40qwva9IF4qXv6xkcAyKxGv/YtFmxX62m n8aG0eASddF44OvF3QIeMYbTLDVxSZVaJQ4B2ZiuqlKoHyMgLyDA31E/Jh80QaiCRKF8 R1otGreb1M4/R43b7a8uhUDGSufPIU61tD2eZ/f0n+5g+WJJAgrkyIDRDcofENtOP/2K vwJJfoNijaBsaSfI1ao6SjqQGhIQoeS/ETFswnB6A9lU5wHmQ5goxh2y/Ent+MpNymAb Rpf2ceQ6OA1w+98Z9nEEs/0ehJhQSYZ++7zgKBfHDPrT8Sez+JewQrlt6fmH7O++6gWy 3Jcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=tb0EOcj/cP/ZuwLYxWcP43h5C3E6flLzxmX2a1wEjWs=; b=uy+b6B+eoG2qAPhyCcQeSV0tP+FwhZIlojoDyk+fWIw1/IqICBli9MKZmGQd8H58xT 9yEVz3xZQUrSGSGH2OF7BFxBU3noNohKlBFB2X8W3b2s19hOBFZKGZcGI+isB4SlMGkz bH915nyDSC8+IBxt42xH3fZSwEcnZr4DBFbn71j8cUEiZOs8opbgmYHi3eUeHYSv+Chr tJ39wJ02W+ZReMAd5IXIT3KGP26jAR4U9GbYw3yQnA76PizZ4LVFWlXlay5/j1aRXnf8 SBAnNeH88HnbyvOq5/2B4l0usRckDb6d1mgY3HY0LS+ZVCyZVpujPDPEm+AAUMVSnvFS Fweg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Q5keVqP0; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l29-20020a635b5d000000b00429b15528e0si4277882pgm.870.2022.08.19.08.40.12; Fri, 19 Aug 2022 08:40:22 -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=@infradead.org header.s=casper.20170209 header.b=Q5keVqP0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349643AbiHSPWP (ORCPT + 99 others); Fri, 19 Aug 2022 11:22:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349637AbiHSPWN (ORCPT ); Fri, 19 Aug 2022 11:22:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B7BFFF8CE; Fri, 19 Aug 2022 08:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description; bh=tb0EOcj/cP/ZuwLYxWcP43h5C3E6flLzxmX2a1wEjWs=; b=Q5keVqP0r9w7d9aLb3DgGx7Ytw 5UBgPFlT3NnvngRx82tAQhpQmKXgysZ3PFvV1gDsRBGB2a+s9IBjZsvS8fMKv2tanvmNoj619SOil CouctGihln6nnZfiOtGIhl0rEVKsFC5VmZPyoGAOSEvzjTsJQmCrVxAQCu7viSwktTwFbZJjB13K/ BcUKVoyTWq1DpTsP6/Z6pCwJ3fsu1RcTSossiXXHE1a4KGo+omusLuRZBROtlerIoeYSREp9fkQa/ SgjARaqLNZhtzbBl3rBx6AyCS3M9juEwPlF3jm+xR7WmYgPPvV7xoMw39jsnlEKo1TuyEjw8xJXyl PZQYEHzg==; Received: from [2600:1702:3c30:6ca0:77cd:43b1:3d69:dd7b] by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oP3ow-00BHmH-Fb; Fri, 19 Aug 2022 15:22:02 +0000 Message-ID: <66f8a3a6-22d5-8a1b-e011-c50de8e19e6c@infradead.org> Date: Fri, 19 Aug 2022 08:21:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] block: move from strlcpy with unused retval to strscpy Content-Language: en-US To: Wolfram Sang , linux-kernel@vger.kernel.org Cc: Jens Axboe , Philipp Reisner , Lars Ellenberg , =?UTF-8?Q?Christoph_B=c3=b6hmwalder?= , Jim Paris , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, linuxppc-dev@lists.ozlabs.org References: <20220818205958.6552-1-wsa+renesas@sang-engineering.com> From: Geoff Levand In-Reply-To: <20220818205958.6552-1-wsa+renesas@sang-engineering.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On 8/18/22 13:59, Wolfram Sang wrote: > Follow the advice of the below link and prefer 'strscpy' in this > subsystem. Conversion is 1:1 because the return value is not used. > Generated by a coccinelle script. > > Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ > Signed-off-by: Wolfram Sang > --- ... > diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c > index e1d080f680ed..c76e0148eada 100644 > --- a/drivers/block/ps3vram.c > +++ b/drivers/block/ps3vram.c > @@ -745,7 +745,7 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev) > gendisk->flags |= GENHD_FL_NO_PART; > gendisk->fops = &ps3vram_fops; > gendisk->private_data = dev; > - strlcpy(gendisk->disk_name, DEVICE_NAME, sizeof(gendisk->disk_name)); > + strscpy(gendisk->disk_name, DEVICE_NAME, sizeof(gendisk->disk_name)); > set_capacity(gendisk, priv->size >> 9); > blk_queue_max_segments(gendisk->queue, BLK_MAX_SEGMENTS); > blk_queue_max_segment_size(gendisk->queue, BLK_MAX_SEGMENT_SIZE); Seems OK for ps3vram. Acked-by: Geoff Levand