Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp898463rbb; Sun, 25 Feb 2024 08:57:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW+MkvPZKqAt0F9uPkdceCP5yMWg4BTbtWagUZb9vGscPMRnw41/8n01c81wx2/nzaoK8+h7enZZmJ7x4byL7P8SZYE0W5t6txwvqjamw== X-Google-Smtp-Source: AGHT+IFxuY00e4Sw/YfPczc3cx4wO4erAswcn0wuAHHvCQG/wFMIbuzrT33Np4B3RyEUgdAJooXO X-Received: by 2002:a05:6402:240a:b0:564:78bf:a7a7 with SMTP id t10-20020a056402240a00b0056478bfa7a7mr4819980eda.19.1708880254518; Sun, 25 Feb 2024 08:57:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708880254; cv=pass; d=google.com; s=arc-20160816; b=tLGavbM9v80v4B3dzzlmkxxwb2tLiOiMzCL4YcVixtCIaZVMiTRO40cXsoyRqOqRrZ 5P9VraGVRm4hi/DkhS1hcuXUCmPSWOv1W6eJl7lIv4I8ad1XfKT9itNwOyEsQgYVD5cK rnN07rPaS+ZriJMD2PFPLIzgW1lTUrDxwweZvitI2klGgf1fYmAHC54NYeTUFvsDW71U Owhdtc8MDWiWsiiDIRvjHm+hK1XelmmwLfAcAwsgYkO3Ki1GeZHEw2YbyEakGl4a2t0q SEptKZvKyPZFTYWkAMAIcaVQ8nhm3luk0JHIaWKjb7gy7dQGVtNqhfKAxBiOfdkBaGSo eHuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=kLObBfzrrymijIw+aLKmED41fp+jo11zk4huTr4eB4w=; fh=nGE692sbVdRvha6RYbzMUXtm1nr/30sV7frdtDN2z14=; b=ovrGqace5GZIJ2bUeow1KEQhYASqsBbCV8/OHyvNGs8b4S1+1yhcPih0i+rH5W8Kb5 3Bx6j6tyqpjwFejCcD+yP2sEWWZClH/jmlGgXF2i89lxiFjIRHShLhPGoHB3J9C5TCRQ GYBh7EB7MEZmjx9jBbFf7ct0bX5dZZkot8objutB6JINP87t69IomXe40d1FJR97eON5 Ghm8Nz+0ZQLFjkUi9SFD8H/jwdmh9XBbnnkacG6wVFdacTtxSxCUDTffkxtGEJxqndv/ ocmz9SzSXXkht6lMhGUoRy8765ZHjbYrZZyku6gf72NpScalZ4L6ibMAo7eSCXELcZlO ICfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-80219-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80219-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dc12-20020a056402310c00b00564c5186ed3si1292854edb.463.2024.02.25.08.57.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 08:57:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80219-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-80219-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80219-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 186701F21BD8 for ; Sun, 25 Feb 2024 16:57:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CB2518E3F; Sun, 25 Feb 2024 16:56:22 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) (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 2B1111802E for ; Sun, 25 Feb 2024 16:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.85.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708880181; cv=none; b=uJgxffw8Tx37FFkNgSsqYxgBpnRFqVwk5T62NpRcbkD+iJQzIOYTYbRdKW5WYjpaX6LzPVpFnZ4IA6kMVcGEd/F9gEOfzOS4g1O3f59udR+uX5gy1+7NXbynfCWpMU0UMcnN/2wIsvN/+JwFNw0q0iv6oRLCr0wEYqOv/KAP30E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708880181; c=relaxed/simple; bh=zOWFqzB7N0pb8vLD4U0rutFH4q0ufXT6YzwjVxhLXv0=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=am6ga1zFqipkVcxcrlHgfZIYr/5+ZmwKEjXc/p8MrLu3xCyT5cUXU7RrAB6V1DpJOJ7sLjriqqvjg4WS5VAdS1bfrXui5EuuLWRkHbwCvd3k/tnqAFSxZym4dIOiqNZWByV7NLmMuShtrFBuwfTJEGOwiTxtK1dgAdzV7BxIM4Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.85.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-258-4eUIVhTQPOq-JwK6Hr19cA-1; Sun, 25 Feb 2024 16:56:17 +0000 X-MC-Unique: 4eUIVhTQPOq-JwK6Hr19cA-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sun, 25 Feb 2024 16:56:16 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sun, 25 Feb 2024 16:56:16 +0000 From: David Laight To: "'linux-kernel@vger.kernel.org'" , "'Linus Torvalds'" , 'Netdev' , "'dri-devel@lists.freedesktop.org'" CC: 'Jens Axboe' , "'Matthew Wilcox (Oracle)'" , 'Christoph Hellwig' , "'linux-btrfs@vger.kernel.org'" , "'Andrew Morton'" , 'Andy Shevchenko' , "'David S . Miller'" , 'Dan Carpenter' , "'Jani Nikula'" Subject: [PATCH next v2 10/11] block: Use a boolean expression instead of max() on booleans Thread-Topic: [PATCH next v2 10/11] block: Use a boolean expression instead of max() on booleans Thread-Index: AdpoC3sh/004JKwJQQKikvnz7Zkpuw== Date: Sun, 25 Feb 2024 16:56:16 +0000 Message-ID: <9561641946f1404b931d97a576bfbb28@AcuMS.aculab.com> References: <0fff52305e584036a777f440b5f474da@AcuMS.aculab.com> In-Reply-To: <0fff52305e584036a777f440b5f474da@AcuMS.aculab.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable blk_stack_limits() contains: =09t->zoned =3D max(t->zoned, b->zoned); These are bool, so can be replaced by bitwise or. However it generates: error: comparison of constant '0' with boolean expression is always true [-= Werror=3Dbool-compare] inside the signedness check that max() does unless a '+ 0' is added. It is a shame the compiler generates this warning for code that will be optimised away. Change so that the extra '+ 0' can be removed. Signed-off-by: David Laight --- block/blk-settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Changes for v2: - Typographical and spelling corrections to the commit messages. Patches unchanged. diff --git a/block/blk-settings.c b/block/blk-settings.c index 06ea91e51b8b..9ca21fea039d 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -688,7 +688,7 @@ int blk_stack_limits(struct queue_limits *t, struct que= ue_limits *b, =09=09=09=09=09=09 b->max_secure_erase_sectors); =09t->zone_write_granularity =3D max(t->zone_write_granularity, =09=09=09=09=09b->zone_write_granularity); -=09t->zoned =3D max(t->zoned, b->zoned); +=09t->zoned =3D t->zoned | b->zoned; =09return ret; } EXPORT_SYMBOL(blk_stack_limits); --=20 2.17.1 - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)