Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp645332pxx; Wed, 28 Oct 2020 13:16:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycLQiY2JIFEs4+0qOx86Tifshtu9cx4NqpvwQguMcirUYdtJkJ/fZB2srQP4ak7vyhmo+M X-Received: by 2002:aa7:d844:: with SMTP id f4mr664284eds.194.1603916181100; Wed, 28 Oct 2020 13:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603916181; cv=none; d=google.com; s=arc-20160816; b=ZkbY9juzRMArBLttBj7PakuNjq7Lm+Jg0QadxaeQ5GCfwWv+8fLcFYc5PB4ewMxKuW qOe8k5tfkn90lp48cUq0H/c3fG/hMw7MCl0d9VoXlEd3LGZFLOb+Jw+KA++Zsy/PWc7A oexDZ3t2MyaWs12PXaOTZRG5s49lKp0Ntpa5Y08bm74HCkw7QUsF8ivupen1dbTGbJzl NgtSD9zSgueUiFnCaFk6cwdBBSd4pDuWgWDphcWmej1MivJcuomUQupoBZoXyNA7Bke2 JBa0nWmNOAqaOTFCePHVLgUyXg1sTwKeX8NtCA62pyTLC9pfYqmZJ5Y62MPJbaMdDj/Q 1+Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=xZvOPp8kVilTXiarx7tF8Az0EBe1RW6Y/QV8MotyV8s=; b=YWL27TpQKU1KisfCd5YFPwOF8z+hf8RSgbZmrZJBx/ONg6a3hmsPdZbM5W/hqlMS6C 75J9r7BPDhXdGz7/bznZMkiizen2zPqG9tAzx7BwtE0HHCyNXAwIQsU0IrmsciLKFIGR USK0NIVG72LFCwAxlZhkZUOF89DWjFoRkEb3jjfdqy6vwIzKqXR1dMyxCRvsoNoJzSv3 U1damwTiPMzrH2okvPkXj96KC/niQHeEjHFYLUk72JK+x3KkHIHy6SFAQ5rGTUxIfGsS ru2q5heJD73CZEWsTSLW6Qxxwt8RqdEbYiEC2WM//vM7AT3RRNn+r+bclDent4659xyc EVGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=E+QQVJ6L; 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 w23si165eds.571.2020.10.28.13.15.58; Wed, 28 Oct 2020 13:16:21 -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=@ffwll.ch header.s=google header.b=E+QQVJ6L; 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 S1829173AbgJ0SvJ (ORCPT + 99 others); Tue, 27 Oct 2020 14:51:09 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46563 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442713AbgJ0SvD (ORCPT ); Tue, 27 Oct 2020 14:51:03 -0400 Received: by mail-wr1-f66.google.com with SMTP id n6so3051940wrm.13 for ; Tue, 27 Oct 2020 11:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=xZvOPp8kVilTXiarx7tF8Az0EBe1RW6Y/QV8MotyV8s=; b=E+QQVJ6LfsGiPw+sjgvs9YvBaCMf1GKIz7ybqinbvbTMr1KW7mqY4QeBxNzuBdpThA 5nblxw4cSCvxn53HUmGzrWW56wSRcZpEwRo8h3Il6vyoNnQIHYZG/9MPA2jqo8IOuzOL 8MTCtvJdUGydgE1zIBJMJEYdbTnFiHIdKO51I= 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:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=xZvOPp8kVilTXiarx7tF8Az0EBe1RW6Y/QV8MotyV8s=; b=uLFUVP4qj4xMSn9FrOD+S7VGc19e58dRXTqFlSpPK5ZaxCkMy4ZZaT/iRwHIChIF7Y bFKFNxDT8TBBuoUYmi8wgB+A3MR046DeFU+VNq1vvHkhGmYpwx76iJn2KdA1QsLuHELM h9M9CV5nlPw+rf8au5kdMT5D8qYCZckdz3Tky+4BrI2jFkySP14E1JDAbSA/qum0gh0p p7SJlJOtJJztTT6jlqjmPKSzFO04tt7iQsrQRJEqFZ9GE+KBiIZswBnTyKjRsGS6V/fF +fcxmCaBfc3B0uLkYTrbUE3DNdgAj4kIIWWkaW66xhrS0xVZOeLNeNeiM9CsSeC1zIkv V3Wg== X-Gm-Message-State: AOAM533EUNFNlO0H8/W/FIu6IGn0YFTbeBaVQ30W2vryKCjzefx9SKU3 m0n/mKPd7kpv6ny/3idfl5NqXA== X-Received: by 2002:adf:e446:: with SMTP id t6mr4255615wrm.46.1603824661583; Tue, 27 Oct 2020 11:51:01 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id 24sm2884131wmg.8.2020.10.27.11.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:51:00 -0700 (PDT) Date: Tue, 27 Oct 2020 19:50:58 +0100 From: Daniel Vetter To: Peilin Ye Cc: Daniel Vetter , Greg Kroah-Hartman , "James E . J . Bottomley" , Helge Deller , Bartlomiej Zolnierkiewicz , Jiri Slaby , linux-parisc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] Fonts: Make font size unsigned in font_desc Message-ID: <20201027185058.GM401619@phenom.ffwll.local> Mail-Followup-To: Peilin Ye , Greg Kroah-Hartman , "James E . J . Bottomley" , Helge Deller , Bartlomiej Zolnierkiewicz , Jiri Slaby , linux-parisc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <54f7d42e07eca2a2f13669575a9de88023ebc1ac.1603788512.git.yepeilin.cs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54f7d42e07eca2a2f13669575a9de88023ebc1ac.1603788512.git.yepeilin.cs@gmail.com> X-Operating-System: Linux phenom 5.7.0-1-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2020 at 12:33:05PM -0400, Peilin Ye wrote: > It is improper to define `width` and `height` as signed in `struct > font_desc`. Make them unsigned. Also, change the corresponding printk() > format identifiers from `%d` to `%u`, in sti_select_fbfont(). > > Signed-off-by: Peilin Ye I'm not entirely sure of the motivation here ... height/width should never ever be even close to the limit here. Or have you seen integer math that could potentially go wrong if we go with unsigned instead of int? -Daniel > --- > Build-tested. > > drivers/video/console/sticore.c | 2 +- > include/linux/font.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c > index 6a26a364f9bd..d1bb5915082b 100644 > --- a/drivers/video/console/sticore.c > +++ b/drivers/video/console/sticore.c > @@ -502,7 +502,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) > if (!fbfont) > return NULL; > > - pr_info("STI selected %dx%d framebuffer font %s for sticon\n", > + pr_info("STI selected %ux%u framebuffer font %s for sticon\n", > fbfont->width, fbfont->height, fbfont->name); > > bpc = ((fbfont->width+7)/8) * fbfont->height; > diff --git a/include/linux/font.h b/include/linux/font.h > index b5b312c19e46..4f50d736ea72 100644 > --- a/include/linux/font.h > +++ b/include/linux/font.h > @@ -16,7 +16,7 @@ > struct font_desc { > int idx; > const char *name; > - int width, height; > + unsigned int width, height; > const void *data; > int pref; > }; > -- > 2.25.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch