From patchwork Mon Apr 18 10:44:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Yuan X-Patchwork-Id: 714751 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3IAioHP010809 for ; Mon, 18 Apr 2011 10:44:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754267Ab1DRKou (ORCPT ); Mon, 18 Apr 2011 06:44:50 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:59581 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754252Ab1DRKot (ORCPT ); Mon, 18 Apr 2011 06:44:49 -0400 Received: by pwi15 with SMTP id 15so2124727pwi.19 for ; Mon, 18 Apr 2011 03:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:content-transfer-encoding; bh=aUbE/5OgaTfLNQDYa3jdv+gVsN0oYARSVNOwkQ/zNgA=; b=og4GJXZy2tBj4vqbMMfQNpA832r+T3jdw6TvBqx21M9Rdy075MwDEPtbZ6OEol4phv PHBqChOA8CUu5WMzi9Uj4FYtXy1mkzzn/IxouhOsrrJpfelJlaW8lgqYGYyii7yGazEM wXnJtvcAJ6QhnjrTxslPbzekJFCKGKPCXeKf8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; b=d2MyixYtIo1CQGIF6nTI1ROjfAckkYAnS41k3Ks9DpqbPAbBXb9XVa1nc74LhvchVO OxC929RJsC/jNqeFabRstBObJsueypdjKB9E+pGOzFxs3CLKL485h5Mib7KSLWfHxJCB bC1aArY8OPZlbDdILxCtamn+w5m1LYTpiqC8E= Received: by 10.68.66.99 with SMTP id e3mr6408740pbt.478.1303123489097; Mon, 18 Apr 2011 03:44:49 -0700 (PDT) Received: from localhost.localdomain ([114.251.86.0]) by mx.google.com with ESMTPS id f1sm2231174pbn.22.2011.04.18.03.44.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Apr 2011 03:44:48 -0700 (PDT) From: Liu Yuan To: Paul Mundt Cc: linux-fbdev@vger.kernel.org (open list:FRAMEBUFFER LAYER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2] video, udlfb: Fix two build warnings about 'ignoring return value' Date: Mon, 18 Apr 2011 18:44:38 +0800 Message-Id: <1303123478-9059-1-git-send-email-namei.unix@gmail.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 18 Apr 2011 10:44:50 +0000 (UTC) From: Liu Yuan build warning: ... drivers/video/udlfb.c:1590: warning: ignoring return value of ‘device_create_file’, declared with attribute warn_unused_result drivers/video/udlfb.c:1592: warning: ignoring return value of ‘device_create_bin_file’, declared with attribute warn_unused_result ... So add two checks to get rid of 'em. Signed-off-by: Liu Yuan --- drivers/video/udlfb.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 68041d9..1baa802 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -1586,10 +1586,19 @@ static int dlfb_usb_probe(struct usb_interface *interface, goto error; } - for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) - device_create_file(info->dev, &fb_device_attrs[i]); + for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) { + retval = device_create_file(info->dev, &fb_device_attrs[i]); + if (retval) { + pr_err("device_create_file failed %d\n", retval); + goto err_del_attrs; + } + } - device_create_bin_file(info->dev, &edid_attr); + retval = device_create_bin_file(info->dev, &edid_attr); + if (retval) { + pr_err("device_create_bin_file failed %d\n", retval); + goto err_del_attrs; + } pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution." " Using %dK framebuffer memory\n", info->node, @@ -1598,6 +1607,10 @@ static int dlfb_usb_probe(struct usb_interface *interface, info->fix.smem_len * 2 : info->fix.smem_len) >> 10); return 0; +err_del_attrs: + for (i -= 1; i >= 0; i--) + device_remove_file(info->dev, &fb_device_attrs[i]); + error: if (dev) {