Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2202075ybz; Sun, 26 Apr 2020 13:27:31 -0700 (PDT) X-Google-Smtp-Source: APiQypIH1aWuXlM81ieuep2QRaWkhMuPWFIZ1t/cqZmjKBSv86WCSooVoovfO2Odair+RLobrrUr X-Received: by 2002:a05:6402:7d6:: with SMTP id u22mr15876006edy.149.1587932851440; Sun, 26 Apr 2020 13:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587932851; cv=none; d=google.com; s=arc-20160816; b=niCuwv/GKlUPZZ4F+lUegJI+9Bsd7f88fMbL7QbcmRmdNUUSK82rOkkSbxART9FncN wnF+ISKwNLDJozGEGMCdR4K+m9tt378DduiIKQnbJWikTzwBbq37Ig3G+gQE0U0gRRnG DY8fkbsjC8LJc2us2AmzcAkgLemOmqfEzwn8iNf4NiPm8mRnXbjrjvLKWodBmJITlskp 5NUeayOuCYXv6J/g4854LHUkAkVHLvx3ulDl1YPmlw80u4PDjExXUKyhr0hoiqLFemDW ldpQZOsstiU1Eimt4GtgCDCRvOIRyrpOEYHr9mxEwlPBskZrJEtNrhmjGZejr0Uua7q6 4IgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=Yxn+Qa8NhcYGb03tP7i3u+mo2XHjh1oLHcTfAdiiS+U=; b=HJ3sMq/JBK4sZdebz+pr2cr3FxO1XenVvT5LorGLYQaym9CH+jjGFWZ+fcmPDc5GQC Ud+NwpqOG4tEyHm/scXSDusIWtOrpPfFdZZUpgA3tU/j/+Mh5hdthBUD5N4aB2jvaCaU r+1ymgNYuLRa4LBKY7i6sWgAAB8IkMWXg/4lDNQNP2GSug0BQvfwzkgeB1gU/zoCZX2x C4l1JtTJIRsTYiQlzN5gq2/z/uLbapEirJZd4TaaUXjwDXNSoBBTBbXMJ/qpB7iTzwA3 npupBwxeqWfoMGtjc0BI0hSKktpqhxmC0fKNTBewB0YgR/opwF56onTqLrfbDPb9W9L+ HkMQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z18si6792562edx.121.2020.04.26.13.26.54; Sun, 26 Apr 2020 13:27:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726323AbgDZUYN (ORCPT + 99 others); Sun, 26 Apr 2020 16:24:13 -0400 Received: from smtprelay0052.hostedemail.com ([216.40.44.52]:50342 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726179AbgDZUYN (ORCPT ); Sun, 26 Apr 2020 16:24:13 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 1A6CC182CED28; Sun, 26 Apr 2020 20:24:12 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3866:3867:3870:3872:3874:4321:5007:8603:10004:10400:10848:11026:11232:11473:11658:11914:12043:12296:12297:12438:12740:12760:12895:13069:13255:13311:13357:13439:14659:14721:21080:21627:21990:30034:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: scale38_5ebf617f6af44 X-Filterd-Recvd-Size: 2001 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA; Sun, 26 Apr 2020 20:24:10 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2 1/3] floppy: add FD_AUTODETECT_SIZE define for struct floppy_drive_params From: Joe Perches To: Denis Efremov , linux-block@vger.kernel.org Cc: Willy Tarreau , Christoph Hellwig , linux-kernel@vger.kernel.org Date: Sun, 26 Apr 2020 13:24:09 -0700 In-Reply-To: <20200426130728.63399-2-efremov@linux.com> References: <20200426130728.63399-1-efremov@linux.com> <20200426130728.63399-2-efremov@linux.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2020-04-26 at 16:07 +0300, Denis Efremov wrote: > Use FD_AUTODETECT_SIZE for autodetect buffer size in struct > floppy_drive_params instead of a magic number. trivia: > diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c [] > @@ -2076,7 +2076,8 @@ static int next_valid_format(int drive) > > probed_format = drive_state[drive].probed_format; > while (1) { > - if (probed_format >= 8 || !drive_params[drive].autodetect[probed_format]) { > + if (probed_format >= FD_AUTODETECT_SIZE || > + !drive_params[drive].autodetect[probed_format]) { floppy.c almost exclusively uses multi-line statement alignment to open parenthesis. It'd be nicer to keep using that style. > drive_state[drive].probed_format = 0; > return 1; > } > @@ -3445,13 +3446,13 @@ static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo) > return 0; > } > > -static bool valid_floppy_drive_params(const short autodetect[8], > +static bool valid_floppy_drive_params(const short autodetect[FD_AUTODETECT_SIZE], > int native_format) >