[BUG]3.14-rc2 [PATCH] Revert ALSA: hda/realtek - Avoid invalid COEFs for ALC271X

2014-02-12 Thread Martin Kepplinger
This reverts commit d3c56568f43807135f2c2a09582a69f809f0d8b7.

The reverted commit breaks audio through headphone line out on
the Acer TravelMate B113 (Type1Sku0) Notebook, my main work
machine. I don't know much about it but this fixes my problem.
Bisected and tested.

Tested-by: Martin Kepplinger mart...@posteo.de
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 sound/pci/hda/patch_realtek.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index d9693ca..0f5af34 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4434,9 +4434,6 @@ static void alc269_fill_coef(struct hda_codec *codec)
 
if (spec-codec_variant != ALC269_TYPE_ALC269VB)
return;
-   /* ALC271X doesn't seem to support these COEFs (bko#52181) */
-   if (!strcmp(codec-chip_name, ALC271X))
-   return;
 
if ((alc_get_coef0(codec)  0x00ff)  0x015) {
alc_write_coef_idx(codec, 0xf, 0x960b);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG]3.14-rc2 [PATCH] Revert ALSA: hda/realtek - Avoid invalid COEFs for ALC271X

2014-02-12 Thread Martin Kepplinger
Am 2014-02-12 17:45, schrieb Takashi Iwai:
 At Wed, 12 Feb 2014 17:20:21 +0100,
 Takashi Iwai wrote:

 At Wed, 12 Feb 2014 17:09:23 +0100,
 Martin Kepplinger wrote:

 This reverts commit d3c56568f43807135f2c2a09582a69f809f0d8b7.

 The reverted commit breaks audio through headphone line out on
 the Acer TravelMate B113 (Type1Sku0) Notebook, my main work
 machine. I don't know much about it but this fixes my problem.
 Bisected and tested.

 Tested-by: Martin Kepplinger mart...@posteo.de
 Signed-off-by: Martin Kepplinger mart...@posteo.de

 Too bad, we need COEF for some machine but it breaks for some.
 Since reverting breaks obviously another machine, we need a different
 approach, e.g. checking the machine ID.  Please give alsa-info.sh
 output of your machine.
 
 Thinking it again, I'll take your patch as is, and put an additional
 fix for AO725 as below.  Could you try it to see whether it brings any
 regressions?  It's to be applied after your revert patch.
 
 
 thanks,
 
 Takashi
 
 -- 8 --
 From: Takashi Iwai ti...@suse.de
 Subject: [PATCH] ALSA: hda - Better fix for invalid COEF setup on Acer AO725
 
 Instead of disabling the COEF setup for all ALC271X codec (like commit
 d3c56568), do it only if needed.  Currently, Acer AO725 is known to
 show the problem, so clear the bad init_hook in the fixup.
 
 The explicit call of alc269_fill_coef() in patch_alc269() is also
 removed, since the function will be called anyway at init callback.
 
 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52181
 Cc: sta...@vger.kernel.org
 Signed-off-by: Takashi Iwai ti...@suse.de
 ---
  sound/pci/hda/patch_realtek.c | 18 --
  1 file changed, 16 insertions(+), 2 deletions(-)
 
 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
 index a9a83b85517a..eaff10598f67 100644
 --- a/sound/pci/hda/patch_realtek.c
 +++ b/sound/pci/hda/patch_realtek.c
 @@ -3817,6 +3817,14 @@ static void alc290_fixup_mono_speakers(struct 
 hda_codec *codec,
   }
  }
  
 +static void alc_fixup_clear_init_hook(struct hda_codec *codec,
 +   const struct hda_fixup *fix, int action)
 +{
 + struct alc_spec *spec = codec-spec;
 + if (action == HDA_FIXUP_ACT_PROBE)
 + spec-init_hook = NULL;
 +}
 +
  /* for hda_fixup_thinkpad_acpi() */
  #include thinkpad_helper.c
  
 @@ -3858,6 +3866,7 @@ enum {
   ALC271_FIXUP_HP_GATE_MIC_JACK,
   ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
   ALC269_FIXUP_ACER_AC700,
 + ALC271_FIXUP_ACER_AO725,
   ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
   ALC269VB_FIXUP_ASUS_ZENBOOK,
   ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
 @@ -4250,13 +4259,19 @@ static const struct hda_fixup alc269_fixups[] = {
   .type = HDA_FIXUP_FUNC,
   .v.func = alc_fixup_headset_mode_alc255,
   },
 + [ALC271_FIXUP_ACER_AO725] = {
 + .type = HDA_FIXUP_FUNC,
 + .v.func = alc_fixup_clear_init_hook,
 + .chained = true,
 + .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
 + },
  };
  
  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
   SND_PCI_QUIRK(0x1025, 0x029b, Acer 1810TZ, ALC269_FIXUP_INV_DMIC),
   SND_PCI_QUIRK(0x1025, 0x0349, Acer AOD260, ALC269_FIXUP_INV_DMIC),
   SND_PCI_QUIRK(0x1025, 0x047c, Acer AC700, ALC269_FIXUP_ACER_AC700),
 - SND_PCI_QUIRK(0x1025, 0x0740, Acer AO725, 
 ALC271_FIXUP_HP_GATE_MIC_JACK),
 + SND_PCI_QUIRK(0x1025, 0x0740, Acer AO725, ALC271_FIXUP_ACER_AO725),
   SND_PCI_QUIRK(0x1025, 0x0742, Acer AO756, 
 ALC271_FIXUP_HP_GATE_MIC_JACK),
   SND_PCI_QUIRK_VENDOR(0x1025, Acer Aspire, ALC271_FIXUP_DMIC),
   SND_PCI_QUIRK(0x1025, 0x0775, Acer Aspire E1-572, 
 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
 @@ -4523,7 +4538,6 @@ static int patch_alc269(struct hda_codec *codec)
   if (err  0)
   goto error;
   spec-init_hook = alc269_fill_coef;
 - alc269_fill_coef(codec);
   break;
  
   case 0x10ec0280:
 

So my alsa-info.sh is
http://www.alsa-project.org/db/?f=3e9c5d39ff057106d6ae307f9b86c1e562056c1b
and I'm running your patch on top of mine without any problems.

thanks,

martin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: winbond: use dev_err() instead of printk()

2014-05-08 Thread Martin Kepplinger
For obvious error messages, use dev_err() in order to provide userspace
with more useful information and use the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
this applies to v3.15-rc4

greetings from Linuxdays Vienna, Austria

 drivers/staging/winbond/wb35tx.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index 708c5b0..870cff3 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -49,7 +49,7 @@ static void Wb35Tx_complete(struct urb *pUrb)
 
/* The URB is completed, check the result */
if (pWb35Tx-EP4VM_status != 0) {
-   printk(URB submission failed\n);
+   dev_err(pUrb-dev-dev, URB submission failed\n);
pWb35Tx-EP4vm_state = VM_STOP;
goto error;
}
@@ -96,7 +96,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
pWb35Tx-EP4vm_state = VM_RUNNING;
retv = usb_submit_urb(pUrb, GFP_ATOMIC);
if (retv  0) {
-   printk(EP4 Tx Irp sending error\n);
+   dev_err(pUrb-dev-dev, EP4 Tx Irp sending error\n);
goto cleanup;
}
 
@@ -218,7 +218,7 @@ static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
 
/* The Urb is completed, check the result */
if (pWb35Tx-EP2VM_status != 0) {
-   printk(EP2 IoCompleteRoutine return error\n);
+   dev_err(pUrb-dev-dev, EP2 IoCompleteRoutine return 
error\n);
pWb35Tx-EP2vm_state = VM_STOP;
goto error;
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: vt6655: preserve address space by not casting

2014-06-13 Thread Martin Kepplinger
Fix the sparse error: cast removes address space of expression.
---
Is that even correct? I haven't signed-off on it yet.
ethtool_ioctl() takes a (void *) as user data, dereferenced and assigend to u32.
applies to next-20140611

 drivers/staging/vt6655/device_main.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 1d3908d..15b2ee5 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -3067,7 +3067,7 @@ static int  device_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd) {
break;
 
case SIOCETHTOOL:
-   return ethtool_ioctl(dev, (void *)rq-ifr_data);
+   return ethtool_ioctl(dev, rq-ifr_data);
// All other calls are currently unsupported
 
default:
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: vt6655: remove unnecessary typedef struct.

2014-06-13 Thread Martin Kepplinger
Remove a totally unnecessary typedef. This is more readable now.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
applies to next-20140611

 drivers/staging/vt6655/card.c   |2 +-
 drivers/staging/vt6655/device.h |6 +++---
 drivers/staging/vt6655/wmgr.c   |2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 05bf48a..765b5eb 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -998,7 +998,7 @@ CARDbAdd_PMKID_Candidate(
 )
 {
PSDevicepDevice = (PSDevice) pDeviceHandler;
-   PPMKID_CANDIDATEpCandidateList;
+   struct PMKID_CANDIDATE *pCandidateList;
unsigned int ii = 0;
 
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO bAdd_PMKID_Candidate START: 
(%d)\n, (int)pDevice-gsPMKIDCandidate.NumCandidates);
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 45fc8a0..5651e51 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -227,10 +227,10 @@ typedef enum _NDIS_802_11_STATUS_TYPE
 } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
 
 //Added new types for PMKID Candidate lists.
-typedef struct _PMKID_CANDIDATE {
+struct PMKID_CANDIDATE {
NDIS_802_11_MAC_ADDRESS BSSID;
unsigned long Flags;
-} PMKID_CANDIDATE, *PPMKID_CANDIDATE;
+};
 
 typedef struct _BSSID_INFO
 {
@@ -248,7 +248,7 @@ typedef struct tagSPMKIDCandidateEvent {
NDIS_802_11_STATUS_TYPE StatusType;
unsigned long Version;   // Version of the structure
unsigned long NumCandidates; // No. of pmkid candidates
-   PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST];
+   struct PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST];
 } SPMKIDCandidateEvent, *PSPMKIDCandidateEvent;
 
 //--
diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c
index 6738478..370ef26 100644
--- a/drivers/staging/vt6655/wmgr.c
+++ b/drivers/staging/vt6655/wmgr.c
@@ -4438,7 +4438,7 @@ bAdd_PMKID_Candidate(
 )
 {
PSDevice pDevice = (PSDevice)hDeviceContext;
-   PPMKID_CANDIDATE pCandidateList;
+   struct PMKID_CANDIDATE *pCandidateList;
unsigned int ii = 0;
 
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO bAdd_PMKID_Candidate START: 
(%d)\n, (int)pDevice-gsPMKIDCandidate.NumCandidates);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Martin Kepplinger
don't reinvent dev_dbg(). use the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
this applies to next-20140516.

 drivers/staging/media/as102/as102_drv.c |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/as102/as102_drv.c 
b/drivers/staging/media/as102/as102_drv.c
index 09d64cd..99c3ed93 100644
--- a/drivers/staging/media/as102/as102_drv.c
+++ b/drivers/staging/media/as102/as102_drv.c
@@ -74,7 +74,8 @@ static void as102_stop_stream(struct as102_dev_t *dev)
return;
 
if (as10x_cmd_stop_streaming(bus_adap)  0)
-   dprintk(debug, as10x_cmd_stop_streaming failed\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   as10x_cmd_stop_streaming failed\n);
 
mutex_unlock(dev-bus_adap.lock);
}
@@ -112,14 +113,16 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
int ret = -EFAULT;
 
if (mutex_lock_interruptible(dev-bus_adap.lock)) {
-   dprintk(debug, mutex_lock_interruptible(lock) failed !\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   amutex_lock_interruptible(lock) failed !\n);
return -EBUSY;
}
 
switch (onoff) {
case 0:
ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) pid);
-   dprintk(debug, DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
index, pid, ret);
break;
case 1:
@@ -131,7 +134,7 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
filter.pid = pid;
 
ret = as10x_cmd_add_PID_filter(bus_adap, filter);
-   dprintk(debug,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
ADD_PID_FILTER([%02d - %02d], 0x%04x) ret = %d\n,
index, filter.idx, filter.pid, ret);
break;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Martin Kepplinger
don't reinvent dev_dbg(). remove dprintk() in as102_drv.c.
use the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
this applies to next-20140516. any more suggestions?
more cleanup can be done when dprintk() is completely gone.

 drivers/staging/media/as102/as102_drv.c |   15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/media/as102/as102_drv.c 
b/drivers/staging/media/as102/as102_drv.c
index 09d64cd..e0ee618 100644
--- a/drivers/staging/media/as102/as102_drv.c
+++ b/drivers/staging/media/as102/as102_drv.c
@@ -31,10 +31,6 @@
 #include as102_fw.h
 #include dvbdev.h
 
-int as102_debug;
-module_param_named(debug, as102_debug, int, 0644);
-MODULE_PARM_DESC(debug, Turn on/off debugging (default: off));
-
 int dual_tuner;
 module_param_named(dual_tuner, dual_tuner, int, 0644);
 MODULE_PARM_DESC(dual_tuner, Activate Dual-Tuner config (default: off));
@@ -74,7 +70,8 @@ static void as102_stop_stream(struct as102_dev_t *dev)
return;
 
if (as10x_cmd_stop_streaming(bus_adap)  0)
-   dprintk(debug, as10x_cmd_stop_streaming failed\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   as10x_cmd_stop_streaming failed\n);
 
mutex_unlock(dev-bus_adap.lock);
}
@@ -112,14 +109,16 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
int ret = -EFAULT;
 
if (mutex_lock_interruptible(dev-bus_adap.lock)) {
-   dprintk(debug, mutex_lock_interruptible(lock) failed !\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   amutex_lock_interruptible(lock) failed !\n);
return -EBUSY;
}
 
switch (onoff) {
case 0:
ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) pid);
-   dprintk(debug, DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
index, pid, ret);
break;
case 1:
@@ -131,7 +130,7 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
filter.pid = pid;
 
ret = as10x_cmd_add_PID_filter(bus_adap, filter);
-   dprintk(debug,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
ADD_PID_FILTER([%02d - %02d], 0x%04x) ret = %d\n,
index, filter.idx, filter.pid, ret);
break;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv2] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Martin Kepplinger
Am 2014-05-17 19:21, schrieb Antti Palosaari:
 On 05/17/2014 07:05 PM, Martin Kepplinger wrote:
 don't reinvent dev_dbg(). remove dprintk() in as102_drv.c.
 use the common kernel coding style.

 Signed-off-by: Martin Kepplinger mart...@posteo.de
 
 Reviewed-by: Antti Palosaari cr...@iki.fi
 
 ---
 this applies to next-20140516. any more suggestions?
 more cleanup can be done when dprintk() is completely gone.
 
 Do you have the device? I am a bit reluctant patching that driver
 without any testing as it has happened too many times something has gone
 totally broken.
I don't have the device and will, at most, change such style issues.

 
 IIRC Devin said it is in staging because of style issues and nothing
 more. Is that correct?
I haven't heard anything. A TODO file would help.

 
 regards
 Antti
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][RESEND] staging: winbond: use dev_err() instead of printk()

2014-05-19 Thread Martin Kepplinger
For obvious error messages, use dev_err() in order to provide userspace
with more useful information and use the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
i just waited a week or so. this applies to next-20140516.

greetings from Linuxdays Vienna, Austria

 drivers/staging/winbond/wb35tx.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index 708c5b0..870cff3 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -49,7 +49,7 @@ static void Wb35Tx_complete(struct urb *pUrb)
 
/* The URB is completed, check the result */
if (pWb35Tx-EP4VM_status != 0) {
-   printk(URB submission failed\n);
+   dev_err(pUrb-dev-dev, URB submission failed\n);
pWb35Tx-EP4vm_state = VM_STOP;
goto error;
}
@@ -96,7 +96,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
pWb35Tx-EP4vm_state = VM_RUNNING;
retv = usb_submit_urb(pUrb, GFP_ATOMIC);
if (retv  0) {
-   printk(EP4 Tx Irp sending error\n);
+   dev_err(pUrb-dev-dev, EP4 Tx Irp sending error\n);
goto cleanup;
}
 
@@ -218,7 +218,7 @@ static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
 
/* The Urb is completed, check the result */
if (pWb35Tx-EP2VM_status != 0) {
-   printk(EP2 IoCompleteRoutine return error\n);
+   dev_err(pUrb-dev-dev, EP2 IoCompleteRoutine return 
error\n);
pWb35Tx-EP2vm_state = VM_STOP;
goto error;
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drbd: change one-bit bitfield to be an unsigned int

2014-06-14 Thread Martin Kepplinger
The one-bit bitfield has no negative values and thus becomes an
unsigned int.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
No idea if you take such small changes. Please ignore if not.
This applies to next-20140613 and fixes a sparse error.


 drivers/block/drbd/drbd_interval.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/drbd/drbd_interval.h 
b/drivers/block/drbd/drbd_interval.h
index f38fcb0..68b4301 100644
--- a/drivers/block/drbd/drbd_interval.h
+++ b/drivers/block/drbd/drbd_interval.h
@@ -9,8 +9,8 @@ struct drbd_interval {
sector_t sector;/* start sector of the interval */
unsigned int size;  /* size in bytes */
sector_t end;   /* highest interval end in subtree */
-   int local:1 /* local or remote request? */;
-   int waiting:1;
+   unsigned int local:1/* local or remote request? */;
+   unsigned int waiting:1;
 };
 
 static inline void drbd_clear_interval(struct drbd_interval *i)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ttm: use NULL instead of 0 for ttm_bo_reserve()'s pointer arg.

2014-06-14 Thread Martin Kepplinger
Fix a sparse warning: ttm_bo_reserve()'s last argument is a
pointer to a struct, so use NULL as nullpointer.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
this applies to next-20140613. Please ignore if annoyingly irrelevant.

 drivers/gpu/drm/ttm/ttm_bo.c |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 4ab9f71..cd0e15e 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -412,7 +412,7 @@ static void ttm_bo_cleanup_refs_or_queue(struct 
ttm_buffer_object *bo)
int ret;
 
spin_lock(glob-lru_lock);
-   ret = __ttm_bo_reserve(bo, false, true, false, 0);
+   ret = __ttm_bo_reserve(bo, false, true, false, NULL);
 
spin_lock(bdev-fence_lock);
(void) ttm_bo_wait(bo, false, false, true);
@@ -514,7 +514,7 @@ static int ttm_bo_cleanup_refs_and_unlock(struct 
ttm_buffer_object *bo,
return ret;
 
spin_lock(glob-lru_lock);
-   ret = __ttm_bo_reserve(bo, false, true, false, 0);
+   ret = __ttm_bo_reserve(bo, false, true, false, NULL);
 
/*
 * We raced, and lost, someone else holds the reservation now,
@@ -577,11 +577,11 @@ static int ttm_bo_delayed_delete(struct ttm_bo_device 
*bdev, bool remove_all)
kref_get(nentry-list_kref);
}
 
-   ret = __ttm_bo_reserve(entry, false, true, false, 0);
+   ret = __ttm_bo_reserve(entry, false, true, false, NULL);
if (remove_all  ret) {
spin_unlock(glob-lru_lock);
ret = __ttm_bo_reserve(entry, false, false,
-  false, 0);
+  false, NULL);
spin_lock(glob-lru_lock);
}
 
@@ -726,7 +726,7 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
 
spin_lock(glob-lru_lock);
list_for_each_entry(bo, man-lru, lru) {
-   ret = __ttm_bo_reserve(bo, false, true, false, 0);
+   ret = __ttm_bo_reserve(bo, false, true, false, NULL);
if (!ret)
break;
}
@@ -1595,7 +1595,7 @@ int ttm_bo_synccpu_write_grab(struct ttm_buffer_object 
*bo, bool no_wait)
 * Using ttm_bo_reserve makes sure the lru lists are updated.
 */
 
-   ret = ttm_bo_reserve(bo, true, no_wait, false, 0);
+   ret = ttm_bo_reserve(bo, true, no_wait, false, NULL);
if (unlikely(ret != 0))
return ret;
spin_lock(bdev-fence_lock);
@@ -1630,7 +1630,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
 
spin_lock(glob-lru_lock);
list_for_each_entry(bo, glob-swap_lru, swap) {
-   ret = __ttm_bo_reserve(bo, false, true, false, 0);
+   ret = __ttm_bo_reserve(bo, false, true, false, NULL);
if (!ret)
break;
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] drbd: change one-bit bitfield to be an unsigned int

2014-06-14 Thread Martin Kepplinger
The one-bit bitfield has no negative values and thus becomes an
unsigned int.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
Sorry for the visually ugly first patch. Take this one, if any.

thanks,
 martin


 drivers/block/drbd/drbd_interval.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/drbd/drbd_interval.h 
b/drivers/block/drbd/drbd_interval.h
index f38fcb0..8d670e6 100644
--- a/drivers/block/drbd/drbd_interval.h
+++ b/drivers/block/drbd/drbd_interval.h
@@ -9,8 +9,8 @@ struct drbd_interval {
sector_t sector;/* start sector of the interval */
unsigned int size;  /* size in bytes */
sector_t end;   /* highest interval end in subtree */
-   int local:1 /* local or remote request? */;
-   int waiting:1;
+   unsigned int local:1;   /* local or remote request? */
+   unsigned int waiting:1;
 };
 
 static inline void drbd_clear_interval(struct drbd_interval *i)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] staging: vt6655: remove unnecessary typedef struct.

2014-06-16 Thread Martin Kepplinger
Remove a totally unnecessary typedef and rename it to lowercase.
This is more readable now.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
so in that way, one could change the more heavily used typedefs as well.

thanks for your review.

 drivers/staging/vt6655/card.c   |2 +-
 drivers/staging/vt6655/device.h |6 +++---
 drivers/staging/vt6655/wmgr.c   |2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 05bf48a..e21abd8 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -998,7 +998,7 @@ CARDbAdd_PMKID_Candidate(
 )
 {
PSDevicepDevice = (PSDevice) pDeviceHandler;
-   PPMKID_CANDIDATEpCandidateList;
+   struct pmkid_candidate *pCandidateList;
unsigned int ii = 0;
 
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO bAdd_PMKID_Candidate START: 
(%d)\n, (int)pDevice-gsPMKIDCandidate.NumCandidates);
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 45fc8a0..aab63ca 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -227,10 +227,10 @@ typedef enum _NDIS_802_11_STATUS_TYPE
 } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
 
 //Added new types for PMKID Candidate lists.
-typedef struct _PMKID_CANDIDATE {
+struct pmkid_candidate {
NDIS_802_11_MAC_ADDRESS BSSID;
unsigned long Flags;
-} PMKID_CANDIDATE, *PPMKID_CANDIDATE;
+};
 
 typedef struct _BSSID_INFO
 {
@@ -248,7 +248,7 @@ typedef struct tagSPMKIDCandidateEvent {
NDIS_802_11_STATUS_TYPE StatusType;
unsigned long Version;   // Version of the structure
unsigned long NumCandidates; // No. of pmkid candidates
-   PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST];
+   struct pmkid_candidate CandidateList[MAX_PMKIDLIST];
 } SPMKIDCandidateEvent, *PSPMKIDCandidateEvent;
 
 //--
diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c
index 6738478..cc4f5b9 100644
--- a/drivers/staging/vt6655/wmgr.c
+++ b/drivers/staging/vt6655/wmgr.c
@@ -4438,7 +4438,7 @@ bAdd_PMKID_Candidate(
 )
 {
PSDevice pDevice = (PSDevice)hDeviceContext;
-   PPMKID_CANDIDATE pCandidateList;
+   struct pmkid_candidate *pCandidateList;
unsigned int ii = 0;
 
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO bAdd_PMKID_Candidate START: 
(%d)\n, (int)pDevice-gsPMKIDCandidate.NumCandidates);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] drbd: change one-bit bitfield to be an unsigned int

2014-06-17 Thread Martin Kepplinger
The one-bit bitfields are assigned true (1) or false (0) and checked
for them respectively. While it should work either way and -1 is true
as well it is more clear to see what's going on when using an unsigned int
because 1 doesn't silently become -1 behind the label true.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
Thanks for looking at it. This is more of a question: Does this make sense
to you now? I can be mistaken. It just wasn't totally clear to me at first
sight and even though it should be, why not try to improve it.

sparse called it 'dubious' before the change.

(built but untested)

 drivers/block/drbd/drbd_interval.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/drbd/drbd_interval.h 
b/drivers/block/drbd/drbd_interval.h
index f38fcb0..8d670e6 100644
--- a/drivers/block/drbd/drbd_interval.h
+++ b/drivers/block/drbd/drbd_interval.h
@@ -9,8 +9,8 @@ struct drbd_interval {
sector_t sector;/* start sector of the interval */
unsigned int size;  /* size in bytes */
sector_t end;   /* highest interval end in subtree */
-   int local:1 /* local or remote request? */;
-   int waiting:1;
+   unsigned int local:1;   /* local or remote request? */
+   unsigned int waiting:1;
 };
 
 static inline void drbd_clear_interval(struct drbd_interval *i)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] staging: vt6655: preserve address space in ethtool_ioctl()

2014-06-17 Thread Martin Kepplinger
Fix the sparse error: cast removes address space of expression and
add __user annotation to the driver's ethtool_ioctl().

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
Beyond that, how would you include socket.c's ethtool_ioctl() here?

thanks for looking at these tiny changes.

 drivers/staging/vt6655/device_main.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 1d3908d..740690e 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -3067,7 +3067,7 @@ static int  device_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd) {
break;
 
case SIOCETHTOOL:
-   return ethtool_ioctl(dev, (void *)rq-ifr_data);
+   return ethtool_ioctl(dev, rq-ifr_data);
// All other calls are currently unsupported
 
default:
@@ -3103,7 +3103,7 @@ static int  device_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd) {
return rc;
 }
 
-static int ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
u32 ethcmd;
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] staging: vt6655: preserve address space in ethtool_ioctl()

2014-06-17 Thread Martin Kepplinger
Fix the sparse error: cast removes address space of expression and
add __user annotation to the driver's ethtool_ioctl().

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
I think I forgot to change the declaration on top.

 drivers/staging/vt6655/device_main.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 1d3908d..81c9932 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -302,7 +302,7 @@ static int  device_dma0_tx_80211(struct sk_buff *skb, 
struct net_device *dev);
 //2008-0714Addby Mike Liu
 static bool device_release_WPADEV(PSDevice pDevice);
 
-static int  ethtool_ioctl(struct net_device *dev, void *useraddr);
+static int  ethtool_ioctl(struct net_device *dev, void __user *useraddr);
 static int  device_rx_srv(PSDevice pDevice, unsigned int uIdx);
 static int  device_tx_srv(PSDevice pDevice, unsigned int uIdx);
 static bool device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pDesc);
@@ -3067,7 +3067,7 @@ static int  device_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd) {
break;
 
case SIOCETHTOOL:
-   return ethtool_ioctl(dev, (void *)rq-ifr_data);
+   return ethtool_ioctl(dev, rq-ifr_data);
// All other calls are currently unsupported
 
default:
@@ -3103,7 +3103,7 @@ static int  device_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd) {
return rc;
 }
 
-static int ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
u32 ethcmd;
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] drbd: change one-bit bitfield to be an unsigned int

2014-06-17 Thread Martin Kepplinger
Am 2014-06-17 21:46, schrieb David Rientjes:
 On Tue, 17 Jun 2014, Martin Kepplinger wrote:
 
 The one-bit bitfields are assigned true (1) or false (0) and checked
 for them respectively. While it should work either way and -1 is true
 as well it is more clear to see what's going on when using an unsigned int
 because 1 doesn't silently become -1 behind the label true.

 
 Nothing is silently becoming anything, I have no idea what you're trying 
 to address.  Is there something in drivers/block/drbd that needs this 
 change?

nope.

 
 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
 Thanks for looking at it. This is more of a question: Does this make sense
 to you now? I can be mistaken. It just wasn't totally clear to me at first
 sight and even though it should be, why not try to improve it.

 
 There's no improvement here, you realize that the sign of one-bit 
 bitfields are implementation defined, correct?  On what implementation 
 does this patch make a difference?
 
 If you are trying to convert these to unsigned for consistency, then just 
 say so in the changelog and don't talk about silent changes or comparisons 
 to true and false that obfuscate the fact that this is just a trivial 
 cleanup that is based on the author's own preference rather than anything 
 else.

learning learning learning. in this case, why sparse calls this dubious.
This would be more appropriate on kernelnewbies or the like, sorry.

 
 sparse called it 'dubious' before the change.

 (built but untested)

  drivers/block/drbd/drbd_interval.h |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/block/drbd/drbd_interval.h 
 b/drivers/block/drbd/drbd_interval.h
 index f38fcb0..8d670e6 100644
 --- a/drivers/block/drbd/drbd_interval.h
 +++ b/drivers/block/drbd/drbd_interval.h
 @@ -9,8 +9,8 @@ struct drbd_interval {
  sector_t sector;/* start sector of the interval */
  unsigned int size;  /* size in bytes */
  sector_t end;   /* highest interval end in subtree */
 -int local:1 /* local or remote request? */;
 -int waiting:1;
 +unsigned int local:1;   /* local or remote request? */
 +unsigned int waiting:1;
  };
  
  static inline void drbd_clear_interval(struct drbd_interval *i)
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: dgnc: use dev_err() instead of printk()

2014-04-29 Thread Martin Kepplinger
Use dev_err() insted of printk() in order to provice userspace with
more useful information and use the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/staging/dgnc/dgnc_sysfs.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 946230c..0f0e8fc 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -739,7 +739,7 @@ void dgnc_create_tty_sysfs(struct un_t *un, struct device 
*c)
 
ret = sysfs_create_group(c-kobj, dgnc_tty_attribute_group);
if (ret) {
-   printk(KERN_ERR dgnc: failed to create sysfs tty device 
attributes.\n);
+   dev_err(c, dgnc: failed to create sysfs tty device 
attributes.\n);
sysfs_remove_group(c-kobj, dgnc_tty_attribute_group);
return;
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: dgnc: use dev_err() instead of printk()

2014-04-29 Thread Martin Kepplinger
Use dev_err() insted of printk() and remove dgnc: from the message.
This should provide userspace with more useful information and use
the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
This makes probably more sense than the previous one.

 drivers/staging/dgnc/dgnc_sysfs.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 946230c..88a2106 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -739,7 +739,7 @@ void dgnc_create_tty_sysfs(struct un_t *un, struct device 
*c)
 
ret = sysfs_create_group(c-kobj, dgnc_tty_attribute_group);
if (ret) {
-   printk(KERN_ERR dgnc: failed to create sysfs tty device 
attributes.\n);
+   dev_err(c, failed to create sysfs tty device attributes.\n);
sysfs_remove_group(c-kobj, dgnc_tty_attribute_group);
return;
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: vt6656: make spin_lock_irq() human readable

2014-04-30 Thread Martin Kepplinger
Don't require FIRMWAREbDownload() to, first off, unlock a held lock.
Thus do all locking in main_usb.c and hold it for a insignificantly
shorter period of time. This makes the affected area significantly more
readable though.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/staging/vt6656/firmware.c |2 --
 drivers/staging/vt6656/main_usb.c |5 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6656/firmware.c 
b/drivers/staging/vt6656/firmware.c
index cd2ea76..79129ad 100644
--- a/drivers/staging/vt6656/firmware.c
+++ b/drivers/staging/vt6656/firmware.c
@@ -54,7 +54,6 @@ int FIRMWAREbDownload(struct vnt_private *pDevice)
int ii, rc;
 
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFODownload firmware\n);
-   spin_unlock_irq(pDevice-lock);
 
rc = request_firmware(fw, FIRMWARE_NAME, dev);
if (rc) {
@@ -91,7 +90,6 @@ free_fw:
 out:
kfree(pBuffer);
 
-   spin_lock_irq(pDevice-lock);
return result;
 }
 MODULE_FIRMWARE(FIRMWARE_NAME);
diff --git a/drivers/staging/vt6656/main_usb.c 
b/drivers/staging/vt6656/main_usb.c
index 3c93230..1dc02c4 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -319,7 +319,11 @@ static int device_init_registers(struct vnt_private 
*pDevice)
memcpy(pDevice-abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN);
 
if (!FIRMWAREbCheckVersion(pDevice)) {
+
+   spin_unlock_irq(pDevice-lock);
if (FIRMWAREbDownload(pDevice) == true) {
+
+   spin_lock_irq(pDevice-lock);
if (FIRMWAREbBrach2Sram(pDevice) == false) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
 FIRMWAREbBrach2Sram fail\n);
@@ -329,7 +333,6 @@ static int device_init_registers(struct vnt_private 
*pDevice)
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
 FIRMWAREbDownload fail\n);
-   spin_unlock_irq(pDevice-lock);
return false;
}
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: rtl8821ae: mark pointer in pci_iounmap as __iomem

2014-05-03 Thread Martin Kepplinger
pci_iounmap is used that way in drivers/net/wireless/rtlwifi and this
fixes sparse warnings.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/staging/rtl8821ae/pci.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8821ae/pci.c b/drivers/staging/rtl8821ae/pci.c
index a562aa6..d934ecb 100644
--- a/drivers/staging/rtl8821ae/pci.c
+++ b/drivers/staging/rtl8821ae/pci.c
@@ -2416,7 +2416,7 @@ fail3:
ieee80211_free_hw(hw);
 
if (rtlpriv-io.pci_mem_start != 0)
-   pci_iounmap(pdev, (void *)rtlpriv-io.pci_mem_start);
+   pci_iounmap(pdev, (void __iomem *)rtlpriv-io.pci_mem_start);
 
 fail2:
pci_release_regions(pdev);
@@ -2479,7 +2479,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
 
list_del(rtlpriv-list);
if (rtlpriv-io.pci_mem_start != 0) {
-   pci_iounmap(pdev, (void *)rtlpriv-io.pci_mem_start);
+   pci_iounmap(pdev, (void __iomem *)rtlpriv-io.pci_mem_start);
pci_release_regions(pdev);
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] staging: rtl8821ae: mark pci_mem_start (and _end) as __iomem

2014-05-04 Thread Martin Kepplinger
Shared addresses can be marked as such.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
I guess that's what you meant. Thanks for your feedback!

 drivers/staging/rtl8821ae/wifi.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8821ae/wifi.h b/drivers/staging/rtl8821ae/wifi.h
index 17a9d9f..d162730 100644
--- a/drivers/staging/rtl8821ae/wifi.h
+++ b/drivers/staging/rtl8821ae/wifi.h
@@ -1086,8 +1086,8 @@ struct rtl_io {
struct device *dev;
 
/*PCI MEM map */
-   unsigned long pci_mem_end;  /*shared mem end*/
-   unsigned long pci_mem_start;/*shared mem start */
+   unsigned long __iomem pci_mem_end;  /*shared mem end   */
+   unsigned long __iomem pci_mem_start;/*shared mem start */
 
/*PCI IO map */
unsigned long pci_base_addr;/*device I/O address */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RESEND PATCH] staging: dgnc: use dev_err() instead of printk()

2014-05-05 Thread Martin Kepplinger
Use dev_err() instead of printk() and remove dgnc: from the message.
This should provide userspace with more useful information and use
the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/staging/dgnc/dgnc_sysfs.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 946230c..88a2106 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -739,7 +739,7 @@ void dgnc_create_tty_sysfs(struct un_t *un, struct device 
*c)
 
ret = sysfs_create_group(c-kobj, dgnc_tty_attribute_group);
if (ret) {
-   printk(KERN_ERR dgnc: failed to create sysfs tty device 
attributes.\n);
+   dev_err(c, failed to create sysfs tty device attributes.\n);
sysfs_remove_group(c-kobj, dgnc_tty_attribute_group);
return;
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RESEND PATCH] staging: dgnc: use dev_err() instead of printk()

2014-05-05 Thread Martin Kepplinger
Am 2014-05-05 13:35, schrieb Dan Carpenter:
 On Mon, May 05, 2014 at 12:29:39PM +0200, Martin Kepplinger wrote:
 Use dev_err() instead of printk() and remove dgnc: from the message.
 This should provide userspace with more useful information and use
 the common kernel coding style.

 
 Whenever I see a RESEND in a subject and no explanation then it means
 our development process has broken down.  Meanwhile this is the first
 time I have seen this patch so the problem is not on our side.
 
 regards,
 dan carpenter
 

I just resent https://lkml.org/lkml/2014/4/29/164 after waiting a week
or so. I don't see any breakdown.

   martin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RESEND PATCH] staging: dgnc: use dev_err() instead of printk()

2014-05-05 Thread Martin Kepplinger
Am 2014-05-05 14:36, schrieb Dan Carpenter:
 On Mon, May 05, 2014 at 01:59:25PM +0200, Martin Kepplinger wrote:
 Am 2014-05-05 13:35, schrieb Dan Carpenter:
 On Mon, May 05, 2014 at 12:29:39PM +0200, Martin Kepplinger wrote:
 Use dev_err() instead of printk() and remove dgnc: from the message.
 This should provide userspace with more useful information and use
 the common kernel coding style.


 Whenever I see a RESEND in a subject and no explanation then it means
 our development process has broken down.  Meanwhile this is the first
 time I have seen this patch so the problem is not on our side.

 regards,
 dan carpenter


 I just resent https://lkml.org/lkml/2014/4/29/164 after waiting a week
 or so. I don't see any breakdown.
 
 What I'm saying is just put an explanation after the --- cut off so we
 know what you did wrong the first time.
 
 Signed-off-by ...
 ---
 Resending because I sent it to the wrong email list the first time.
 Oops!  Next time I will use get_maintainer.pl, I promise!
 
 
 Just a simple explanation like that is ok.
 
 regards,
 dan carpenter
 
sure, thanks.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RESEND PATCH] staging: vt6656: make spin_lock_irq() human readable

2014-05-06 Thread Martin Kepplinger
Don't require FIRMWAREbDownload() to, first off, unlock a held lock.
Thus do all locking in main_usb.c and hold it for a insignificantly
shorter period of time. This makes the affected area significantly more
readable though.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
I resend https://lkml.org/lkml/2014/4/30/453 and add de...@driverdev.osuosl.org
after waiting a week or so.

This fixes a sparse warning too, and uses less spin_lock functions.
Maybe someone can think it through.

 drivers/staging/vt6656/firmware.c |2 --
 drivers/staging/vt6656/main_usb.c |5 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6656/firmware.c 
b/drivers/staging/vt6656/firmware.c
index cd2ea76..79129ad 100644
--- a/drivers/staging/vt6656/firmware.c
+++ b/drivers/staging/vt6656/firmware.c
@@ -54,7 +54,6 @@ int FIRMWAREbDownload(struct vnt_private *pDevice)
int ii, rc;
 
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFODownload firmware\n);
-   spin_unlock_irq(pDevice-lock);
 
rc = request_firmware(fw, FIRMWARE_NAME, dev);
if (rc) {
@@ -91,7 +90,6 @@ free_fw:
 out:
kfree(pBuffer);
 
-   spin_lock_irq(pDevice-lock);
return result;
 }
 MODULE_FIRMWARE(FIRMWARE_NAME);
diff --git a/drivers/staging/vt6656/main_usb.c 
b/drivers/staging/vt6656/main_usb.c
index 3c93230..1dc02c4 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -319,7 +319,11 @@ static int device_init_registers(struct vnt_private 
*pDevice)
memcpy(pDevice-abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN);
 
if (!FIRMWAREbCheckVersion(pDevice)) {
+
+   spin_unlock_irq(pDevice-lock);
if (FIRMWAREbDownload(pDevice) == true) {
+
+   spin_lock_irq(pDevice-lock);
if (FIRMWAREbBrach2Sram(pDevice) == false) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
 FIRMWAREbBrach2Sram fail\n);
@@ -329,7 +333,6 @@ static int device_init_registers(struct vnt_private 
*pDevice)
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
 FIRMWAREbDownload fail\n);
-   spin_unlock_irq(pDevice-lock);
return false;
}
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: rtl8192u: initialize array in C compliant way

2014-05-06 Thread Martin Kepplinger
Don't list elements to initialize. Remaining elements of a partly
initialized array are set to zero. Sparse complained here.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 426f223..c96dbab 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -241,7 +241,7 @@ static PTS_COMMON_INFO SearchAdmitTRStream(struct 
ieee80211_device *ieee,
 {
//DIRECTION_VALUE   dir;
u8  dir;
-   boolsearch_dir[4] = {0, 0, 0, 0};
+   boolsearch_dir[4] = {0};
struct list_head*psearch_list; //FIXME
PTS_COMMON_INFO pRet = NULL;
if(ieee-iw_mode == IW_MODE_MASTER) //ap mode
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: dgnc: fix compile warning frame size is larger than 1024 bytes

2014-05-06 Thread Martin Kepplinger
fix following warning by dynamically allocating memory:
dgnc_tty.c:583:1: warning: the frame size of 1060 bytes is larger than 1024 
bytes [-Wframe-larger-than=]

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
This is more of a question. Is this a desired solution to fixing such a
frame size warning?

thanks,
martin

 drivers/staging/dgnc/dgnc_tty.c |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index f0b17c3..1c78cc2 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -481,8 +481,8 @@ void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar 
*text, uchar *buf, int
int nbuf;
int i;
int tmpbuflen;
-   char tmpbuf[TMPBUFLEN];
-   char *p = tmpbuf;
+   char *tmpbuf;
+   char *p;
int too_much_data;
 
/* Leave if sniff not open */
@@ -492,6 +492,13 @@ void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar 
*text, uchar *buf, int
do_gettimeofday(tv);
 
/* Create our header for data dump */
+   tmpbuf = kmalloc(TMPBUFLEN, GFP_KERNEL);
+   if (!tmpbuf) {
+   pr_err(dgnc: memory allocation error\n);
+   return;
+   }
+   p = tmpbuf;
+
p += sprintf(p, %ld %ld%s, tv.tv_sec, tv.tv_usec, text);
tmpbuflen = p - tmpbuf;
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: dgnc: fix compile warning frame size is larger than 1024 bytes

2014-05-06 Thread Martin Kepplinger
Am 2014-05-06 15:33, schrieb Dan Carpenter:
 On Tue, May 06, 2014 at 02:41:37PM +0200, Martin Kepplinger wrote:
 fix following warning by dynamically allocating memory:
 dgnc_tty.c:583:1: warning: the frame size of 1060 bytes is larger than 1024 
 bytes [-Wframe-larger-than=]

 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
 This is more of a question. Is this a desired solution to fixing such a
 frame size warning?
 
 This warning is because the kernel uses an 8k stack so you add up all
 the stack memory used by each function from the syscall to here.  If
 it adds up to more than 8k then it's a bug.  The 1k limit per function
 is just a hack to spot where people are maybe being reckless.

nice. thanks.

 
 There are no kfree()s and this function is called with a spin_lock held
 so this patch introduces a couple bugs.

I know, it should have been just a question (probably to kernelnewbies'
list). Sorry for the noise.

 
 There may be a better way to allocate this.  Like maybe at probe() and
 then use spinlocks to serialize access to the buffer.  But sometimes
 that's a very bad idea.
 
 It's better if you know the driver a bit and can test things.
 
 regards,
 dan carpenter
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: rtl8187se: fix pointer and return statement's syntax

2014-04-09 Thread Martin Kepplinger
Use the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
noise from the eudyptula challenge. applies to next-20140408 as well as
linus' current tree.

 drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
index 0dc5ae4..e6257b3 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
@@ -180,7 +180,7 @@ static inline int ieee80211_put_snap(u8 *data, u16 h_proto)
 int ieee80211_encrypt_fragment(struct ieee80211_device *ieee,
   struct sk_buff *frag, int hdr_len)
 {
-   struct ieee80211_crypt_data* crypt = ieee-crypt[ieee-tx_keyidx];
+   struct ieee80211_crypt_data *crypt = ieee-crypt[ieee-tx_keyidx];
int res;
 
/*
@@ -285,7 +285,7 @@ static int ieee80211_classify(struct sk_buff *skb,
 
if (!network-QoS_Enable) {
skb-priority = 0;
-   return(wme_UP);
+   return wme_UP;
}
 
if (eh-ether_type == __constant_htons(ETHERTYPE_IP)) {
@@ -304,7 +304,7 @@ static int ieee80211_classify(struct sk_buff *skb,
}
 
skb-priority = wme_UP;
-   return(wme_UP);
+   return wme_UP;
 }
 
 /* SKBs are added to the ieee-tx_queue. */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black instead of native resolution

2014-06-23 Thread Martin Kepplinger
Am 2014-06-23 15:14, schrieb Zhang Rui:
 On Mon, 2014-06-23 at 14:22 +0200, Martin Kepplinger wrote:
 Am 2014-06-23 03:10, schrieb Zhang, Rui:


 -Original Message-
 From: Martin Kepplinger [mailto:mart...@posteo.de]
 Sent: Sunday, June 22, 2014 10:25 PM
 To: Zhang, Rui
 Cc: r...@rjwysocki.net; l...@kernel.org; linux-a...@vger.kernel.org;
 linux-kernel@vger.kernel.org
 Subject: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black
 instead of native resolution
 Importance: High

 Since 3.16-rc1 my laptop's just goes black while booting, instead of
 switching to native screen resolution and showing me the starting
 system there. It's an Acer TravelMate B113 with i915 driver and
 acer_wmi. It stays black and is unusable.

 This looks like a duplicate of
 https://bugzilla.kernel.org/show_bug.cgi?id=78601
 
 thanks,
 rui
I'm not sure about that. I have no problem with v3.15 and the screen
goes black way before a display manager is started. It's right after the
kernel loaded and usually the screen is set to native resolution.

Bisect told me aaeb2554337217dfa4eac2fcc90da7be540b9a73 as the first bad
one. Although, checking that out and running it, works good. not sure if
that makes sense.

 Do you have other people complain about that? Bisecting didn't lead to
 a good result. I could be wrong but I somehow suspect the mistake to be
 somewhere in commit 99678ed73a50d2df8b5f3c801e29e9b7a3e5aa85

 In order to confirm if the problem is introduced by the above commit,
 why not checkout the kernel just before and after this commit and see if 
 the problem exists?

 Thanks,
 rui

 So maybe I was wrong. d27050641e9bc056446deb0814e7ba1aa7911f5a is still
 good and aaeb2554337217dfa4eac2fcc90da7be540b9a73 is the fist bad one.
 This is a big v4l merge. I added the linux-media list in cc now.

 What could be the problem here?


 There is nothing unusual in the kernel log.

 This is quite unusual for an -rc2. Hence my question. I'm happy to test
 changes.

  martin
 --
 Martin Kepplinger
 e-mailmartink AT posteo DOT at
 chat (XMPP)   martink AT jabber DOT at

 
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix backlight control for Acer TravelMate B113

2014-06-23 Thread Martin Kepplinger
Fix backlight control for Acer TravelMate B113 Laptop by adding
it to the video_dmi_table.

A workaround before that was to use acpi_osi=Linux or
acpi_backlight=vendor on boot but even then, only the function-
keys worked.

With this change there is no need for boot parameters and DE's
controls work as well.

Signed-off-by: Martin Kepplinger mart...@posteo.de
Tested-by: Martin Kepplinger mart...@posteo.de
---
 drivers/acpi/video.c |8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index f8bc5a7..acb0670 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -528,6 +528,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = 
{
},
},
{
+.callback = video_set_use_native_backlight,
+.ident = Acer TravelMate B113,
+.matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, Acer),
+   DMI_MATCH(DMI_PRODUCT_NAME, TravelMate B113),
+   },
+   },
+   {
.callback = video_set_use_native_backlight,
.ident = HP ProBook 4340s,
.matches = {
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[BUG] rc1 and rc2: Laptop unusable: on boot,screen black instead of native resolution

2014-06-22 Thread Martin Kepplinger
Since 3.16-rc1 my laptop's just goes black while booting, instead of
switching to native screen resolution and showing me the starting
system there. It's an Acer TravelMate B113 with i915 driver and
acer_wmi. It stays black and is unusable.

Do you have other people complain about that? Bisecting didn't lead to a
good result. I could be wrong but I somehow suspect the mistake to be
somewhere in commit 99678ed73a50d2df8b5f3c801e29e9b7a3e5aa85

There is nothing unusual in the kernel log.

This is quite unusual for an -rc2. Hence my question. I'm happy to test
changes.

 martin
-- 
Martin Kepplinger
e-mailmartink AT posteo DOT at
chat (XMPP)   martink AT jabber DOT at
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black instead of native resolution

2014-06-23 Thread Martin Kepplinger
Am 2014-06-23 03:10, schrieb Zhang, Rui:
 
 
 -Original Message-
 From: Martin Kepplinger [mailto:mart...@posteo.de]
 Sent: Sunday, June 22, 2014 10:25 PM
 To: Zhang, Rui
 Cc: r...@rjwysocki.net; l...@kernel.org; linux-a...@vger.kernel.org;
 linux-kernel@vger.kernel.org
 Subject: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black
 instead of native resolution
 Importance: High

 Since 3.16-rc1 my laptop's just goes black while booting, instead of
 switching to native screen resolution and showing me the starting
 system there. It's an Acer TravelMate B113 with i915 driver and
 acer_wmi. It stays black and is unusable.

 Do you have other people complain about that? Bisecting didn't lead to
 a good result. I could be wrong but I somehow suspect the mistake to be
 somewhere in commit 99678ed73a50d2df8b5f3c801e29e9b7a3e5aa85

 In order to confirm if the problem is introduced by the above commit,
 why not checkout the kernel just before and after this commit and see if the 
 problem exists?
 
 Thanks,
 rui
 
So maybe I was wrong. d27050641e9bc056446deb0814e7ba1aa7911f5a is still
good and aaeb2554337217dfa4eac2fcc90da7be540b9a73 is the fist bad one.
This is a big v4l merge. I added the linux-media list in cc now.

What could be the problem here?

 
 There is nothing unusual in the kernel log.

 This is quite unusual for an -rc2. Hence my question. I'm happy to test
 changes.

  martin
 --
 Martin Kepplinger
 e-mailmartink AT posteo DOT at
 chat (XMPP)   martink AT jabber DOT at

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black instead of native resolution

2014-06-27 Thread Martin Kepplinger
Am 2014-06-27 17:14, schrieb Zhang Rui:
 On Mon, 2014-06-23 at 16:46 +0200, Martin Kepplinger wrote:
 Am 2014-06-23 15:14, schrieb Zhang Rui:
 On Mon, 2014-06-23 at 14:22 +0200, Martin Kepplinger wrote:
 Am 2014-06-23 03:10, schrieb Zhang, Rui:


 -Original Message-
 From: Martin Kepplinger [mailto:mart...@posteo.de]
 Sent: Sunday, June 22, 2014 10:25 PM
 To: Zhang, Rui
 Cc: r...@rjwysocki.net; l...@kernel.org; linux-a...@vger.kernel.org;
 linux-kernel@vger.kernel.org
 Subject: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black
 instead of native resolution
 Importance: High

 Since 3.16-rc1 my laptop's just goes black while booting, instead of
 switching to native screen resolution and showing me the starting
 system there. It's an Acer TravelMate B113 with i915 driver and
 acer_wmi. It stays black and is unusable.

 This looks like a duplicate of
 https://bugzilla.kernel.org/show_bug.cgi?id=78601

 thanks,
 rui
 I'm not sure about that. I have no problem with v3.15 and the screen
 goes black way before a display manager is started. It's right after the
 kernel loaded and usually the screen is set to native resolution.

 Bisect told me aaeb2554337217dfa4eac2fcc90da7be540b9a73 as the first bad
 one. Although, checking that out and running it, works good. not sure if
 that makes sense.

 could you please check if the comment in
 https://bugzilla.kernel.org/show_bug.cgi?id=78601#c5 solves your problem
 or not?
 
 thanks,
 rui

thanks for checking. This does not change anything though. I tested the
following on top of v3.16-rc2 and linus's tree as of today, almost -rc3.

---
 drivers/gpu/drm/i915/intel_fbdev.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_fbdev.c
b/drivers/gpu/drm/i915/intel_fbdev.c
index 088fe93..1e2f9ae 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -453,7 +453,6 @@ out:
 }

 static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
-   .initial_config = intel_fb_initial_config,
.gamma_set = intel_crtc_fb_gamma_set,
.gamma_get = intel_crtc_fb_gamma_get,
.fb_probe = intelfb_create,
-- 
1.7.10.4



 Do you have other people complain about that? Bisecting didn't lead to
 a good result. I could be wrong but I somehow suspect the mistake to be
 somewhere in commit 99678ed73a50d2df8b5f3c801e29e9b7a3e5aa85

 In order to confirm if the problem is introduced by the above commit,
 why not checkout the kernel just before and after this commit and see if 
 the problem exists?

 Thanks,
 rui

 So maybe I was wrong. d27050641e9bc056446deb0814e7ba1aa7911f5a is still
 good and aaeb2554337217dfa4eac2fcc90da7be540b9a73 is the fist bad one.
 This is a big v4l merge. I added the linux-media list in cc now.

 What could be the problem here?


 There is nothing unusual in the kernel log.

 This is quite unusual for an -rc2. Hence my question. I'm happy to test
 changes.

  martin
 --
 Martin Kepplinger
 e-mailmartink AT posteo DOT at
 chat (XMPP)   martink AT jabber DOT at




 
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black instead of native resolution

2014-06-27 Thread Martin Kepplinger
Am 2014-06-27 20:09, schrieb Martin Kepplinger:
 Am 2014-06-27 17:14, schrieb Zhang Rui:
 On Mon, 2014-06-23 at 16:46 +0200, Martin Kepplinger wrote:
 Am 2014-06-23 15:14, schrieb Zhang Rui:
 On Mon, 2014-06-23 at 14:22 +0200, Martin Kepplinger wrote:
 Am 2014-06-23 03:10, schrieb Zhang, Rui:


 -Original Message-
 From: Martin Kepplinger [mailto:mart...@posteo.de]
 Sent: Sunday, June 22, 2014 10:25 PM
 To: Zhang, Rui
 Cc: r...@rjwysocki.net; l...@kernel.org; linux-a...@vger.kernel.org;
 linux-kernel@vger.kernel.org
 Subject: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black
 instead of native resolution
 Importance: High

 Since 3.16-rc1 my laptop's just goes black while booting, instead of
 switching to native screen resolution and showing me the starting
 system there. It's an Acer TravelMate B113 with i915 driver and
 acer_wmi. It stays black and is unusable.

 This looks like a duplicate of
 https://bugzilla.kernel.org/show_bug.cgi?id=78601

 thanks,
 rui
 I'm not sure about that. I have no problem with v3.15 and the screen
 goes black way before a display manager is started. It's right after the
 kernel loaded and usually the screen is set to native resolution.

 Bisect told me aaeb2554337217dfa4eac2fcc90da7be540b9a73 as the first bad
 one. Although, checking that out and running it, works good. not sure if
 that makes sense.

 could you please check if the comment in
 https://bugzilla.kernel.org/show_bug.cgi?id=78601#c5 solves your problem
 or not?

 thanks,
 rui
 
 thanks for checking. This does not change anything though. I tested the
 following on top of v3.16-rc2 and linus's tree as of today, almost -rc3.
 
 ---
  drivers/gpu/drm/i915/intel_fbdev.c |1 -
  1 file changed, 1 deletion(-)
 
 diff --git a/drivers/gpu/drm/i915/intel_fbdev.c
 b/drivers/gpu/drm/i915/intel_fbdev.c
 index 088fe93..1e2f9ae 100644
 --- a/drivers/gpu/drm/i915/intel_fbdev.c
 +++ b/drivers/gpu/drm/i915/intel_fbdev.c
 @@ -453,7 +453,6 @@ out:
  }
 
  static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
 -   .initial_config = intel_fb_initial_config,
 .gamma_set = intel_crtc_fb_gamma_set,
 .gamma_get = intel_crtc_fb_gamma_get,
 .fb_probe = intelfb_create,
 

I also tested the following patch from
http://lists.freedesktop.org/archives/intel-gfx/2014-June/047981.html
now, with no results. No change in my case :(

diff --git a/drivers/gpu/drm/i915/intel_display.c
b/drivers/gpu/drm/i915/intel_display.c
index efd3cf5..5aee08e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11087,6 +11087,22 @@ const char *intel_output_name(int output)
return names[output];
 }

+static bool intel_crt_present(struct drm_device *dev)
+{
+   struct drm_i915_private *dev_priv = dev-dev_private;
+
+   if (IS_ULT(dev))
+   return false;
+
+   if (IS_CHERRYVIEW(dev))
+   return false;
+
+   if (IS_VALLEYVIEW(dev)  !dev_priv-vbt.int_crt_support)
+   return false;
+
+   return true;
+}
+
 static void intel_setup_outputs(struct drm_device *dev)
 {
struct drm_i915_private *dev_priv = dev-dev_private;
@@ -11095,7 +1,7 @@ static void intel_setup_outputs(struct
drm_device *dev)

intel_lvds_init(dev);

-   if (!IS_ULT(dev)  !IS_CHERRYVIEW(dev) 
dev_priv-vbt.int_crt_support)
+   if (intel_crt_present(dev))
intel_crt_init(dev);

if (HAS_DDI(dev)) {
-- 
1.7.10.4
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black instead of native resolution

2014-06-27 Thread Martin Kepplinger
Am 2014-06-27 21:51, schrieb Martin Kepplinger:
 Am 2014-06-27 20:09, schrieb Martin Kepplinger:
 Am 2014-06-27 17:14, schrieb Zhang Rui:
 On Mon, 2014-06-23 at 16:46 +0200, Martin Kepplinger wrote:
 Am 2014-06-23 15:14, schrieb Zhang Rui:
 On Mon, 2014-06-23 at 14:22 +0200, Martin Kepplinger wrote:
 Am 2014-06-23 03:10, schrieb Zhang, Rui:


 -Original Message-
 From: Martin Kepplinger [mailto:mart...@posteo.de]
 Sent: Sunday, June 22, 2014 10:25 PM
 To: Zhang, Rui
 Cc: r...@rjwysocki.net; l...@kernel.org; linux-a...@vger.kernel.org;
 linux-kernel@vger.kernel.org
 Subject: [BUG] rc1 and rc2: Laptop unusable: on boot,screen black
 instead of native resolution
 Importance: High

 Since 3.16-rc1 my laptop's just goes black while booting, instead of
 switching to native screen resolution and showing me the starting
 system there. It's an Acer TravelMate B113 with i915 driver and
 acer_wmi. It stays black and is unusable.

 This looks like a duplicate of
 https://bugzilla.kernel.org/show_bug.cgi?id=78601

 thanks,
 rui
 I'm not sure about that. I have no problem with v3.15 and the screen
 goes black way before a display manager is started. It's right after the
 kernel loaded and usually the screen is set to native resolution.

 Bisect told me aaeb2554337217dfa4eac2fcc90da7be540b9a73 as the first bad
 one. Although, checking that out and running it, works good. not sure if
 that makes sense.

 could you please check if the comment in
 https://bugzilla.kernel.org/show_bug.cgi?id=78601#c5 solves your problem
 or not?

 thanks,
 rui

 thanks for checking. This does not change anything though. I tested the
 following on top of v3.16-rc2 and linus's tree as of today, almost -rc3.

 ---
  drivers/gpu/drm/i915/intel_fbdev.c |1 -
  1 file changed, 1 deletion(-)

 diff --git a/drivers/gpu/drm/i915/intel_fbdev.c
 b/drivers/gpu/drm/i915/intel_fbdev.c
 index 088fe93..1e2f9ae 100644
 --- a/drivers/gpu/drm/i915/intel_fbdev.c
 +++ b/drivers/gpu/drm/i915/intel_fbdev.c
 @@ -453,7 +453,6 @@ out:
  }

  static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
 -   .initial_config = intel_fb_initial_config,
 .gamma_set = intel_crtc_fb_gamma_set,
 .gamma_get = intel_crtc_fb_gamma_get,
 .fb_probe = intelfb_create,

 
 I also tested the following patch from
 http://lists.freedesktop.org/archives/intel-gfx/2014-June/047981.html
 now, with no results. No change in my case :(
 
 diff --git a/drivers/gpu/drm/i915/intel_display.c
 b/drivers/gpu/drm/i915/intel_display.c
 index efd3cf5..5aee08e 100644
 --- a/drivers/gpu/drm/i915/intel_display.c
 +++ b/drivers/gpu/drm/i915/intel_display.c
 @@ -11087,6 +11087,22 @@ const char *intel_output_name(int output)
 return names[output];
  }
 
 +static bool intel_crt_present(struct drm_device *dev)
 +{
 +   struct drm_i915_private *dev_priv = dev-dev_private;
 +
 +   if (IS_ULT(dev))
 +   return false;
 +
 +   if (IS_CHERRYVIEW(dev))
 +   return false;
 +
 +   if (IS_VALLEYVIEW(dev)  !dev_priv-vbt.int_crt_support)
 +   return false;
 +
 +   return true;
 +}
 +
  static void intel_setup_outputs(struct drm_device *dev)
  {
 struct drm_i915_private *dev_priv = dev-dev_private;
 @@ -11095,7 +1,7 @@ static void intel_setup_outputs(struct
 drm_device *dev)
 
 intel_lvds_init(dev);
 
 -   if (!IS_ULT(dev)  !IS_CHERRYVIEW(dev) 
 dev_priv-vbt.int_crt_support)
 +   if (intel_crt_present(dev))
 intel_crt_init(dev);
 
 if (HAS_DDI(dev)) {
 
I'm on i686 and also the following from
https://bugzilla.redhat.com/show_bug.cgi?id=1110968#c16 does not help :(
this is bad.

---
 arch/x86/kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/kernel/signal.c  
+++ a/arch/x86/kernel/signal.c  
@@ -363,7 +363,7 @@ static int __setup_rt_frame(int sig, struct ksignal
*ksig,

/* Set up to return from userspace.  */
restorer = current-mm-context.vdso +
-   selected_vdso32-sym___kernel_sigreturn;
+   selected_vdso32-sym___kernel_rt_sigreturn;
if (ksig-ka.sa.sa_flags  SA_RESTORER)
restorer = ksig-ka.sa.sa_restorer;
put_user_ex(restorer, frame-pretcode);
-- 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix backlight control for Acer TravelMate B113

2014-06-29 Thread Martin Kepplinger
Am 2014-06-23 22:30, schrieb Martin Kepplinger:
 Fix backlight control for Acer TravelMate B113 Laptop by adding
 it to the video_dmi_table.
 
 A workaround before that was to use acpi_osi=Linux or
 acpi_backlight=vendor on boot but even then, only the function-
 keys worked.
 
 With this change there is no need for boot parameters and DE's
 controls work as well.
 
 Signed-off-by: Martin Kepplinger mart...@posteo.de
 Tested-by: Martin Kepplinger mart...@posteo.de
 ---
  drivers/acpi/video.c |8 
  1 file changed, 8 insertions(+)
 
 diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
 index f8bc5a7..acb0670 100644
 --- a/drivers/acpi/video.c
 +++ b/drivers/acpi/video.c
 @@ -528,6 +528,14 @@ static struct dmi_system_id video_dmi_table[] __initdata 
 = {
   },
   },
   {
 +  .callback = video_set_use_native_backlight,
 +  .ident = Acer TravelMate B113,
 +  .matches = {
 + DMI_MATCH(DMI_SYS_VENDOR, Acer),
 + DMI_MATCH(DMI_PRODUCT_NAME, TravelMate B113),
 + },
 + },
 + {
   .callback = video_set_use_native_backlight,
   .ident = HP ProBook 4340s,
   .matches = {
 

are there objections or advice on this? this would be really good to
have, even if for 3.17.

thanks.
martin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] rc3 Oops: unable to handle kernel NULL pointer dereference at 0000074c

2014-06-30 Thread Martin Kepplinger
I now booted 3.16-rc3 and suddenly see an oops during boot:

the oops during boot: http://tny.cz/2301e393
also below

lshw if interesting: http://tny.cz/3c9a7609

the full boot log: http://tny.cz/88260b19

does anyone have an idea?
   thanks

the oops:

Jun 30 08:35:08 laptop kernel: [5.245811] bus: 'platform':
really_probe: probing driver coretemp with device coretemp.0
Jun 30 08:35:08 laptop kernel: [5.246134] BUG: unable to handle
kernel NULL pointer dereference at 074c
Jun 30 08:35:08 laptop kernel: [5.246145] IP: [c10325d9]
is_highmem+0x1/0x2b
Jun 30 08:35:08 laptop kernel: [5.246158] *pdpt = 33e49001
*pde = 
Jun 30 08:35:08 laptop kernel: [5.246167] Oops:  [#1] SMP
Jun 30 08:35:08 laptop kernel: [5.246175] Modules linked in:
coretemp(+) kvm_intel kvm snd_hda_codec_hdmi snd_hda_codec_realtek
snd_hda_codec_generic microcode snd_hda_intel i915(+) snd_hda_controller
evdev psmouse snd_hda_codec serio_raw snd_hwdep snd_pcm iwlwifi i2c_i801
lpc_ich mfd_core snd_seq drm_kms_helper snd_timer battery ehci_pci
snd_seq_device drm cfg80211 ehci_hcd snd i2c_algo_bit ac video i2c_core
rfkill soundcore wmi acpi_cpufreq button processor thermal_sys ext4
crc16 jbd2 mbcache sg sd_mod crct10dif_generic crc_t10dif
crct10dif_common ahci libahci crc32c_intel tg3 ptp libata pps_core
sdhci_pci sdhci scsi_mod mmc_core libphy xhci_hcd usbcore usb_common
Jun 30 08:35:08 laptop kernel: [5.246320] CPU: 1 PID: 491 Comm:
modprobe Not tainted 3.16.0-rc3 #83
Jun 30 08:35:08 laptop kernel: [5.246330] Hardware name: Acer
TravelMate B113/BA10_HX   , BIOS V1.09 10/30/2012
Jun 30 08:35:08 laptop kernel: [5.246344] task: f3828a90 ti:
f3e88000 task.ti: f3e88000
Jun 30 08:35:08 laptop kernel: [5.246355] EIP: 0060:[c10325d9]
EFLAGS: 00010206 CPU: 1
Jun 30 08:35:08 laptop kernel: [5.246367] EIP is at is_highmem+0x1/0x2b
Jun 30 08:35:08 laptop kernel: [5.246376] EAX: 03c0 EBX:
ffb76000 ECX: 0001 EDX: 03c0
Jun 30 08:35:08 laptop kernel: [5.246386] ESI: f86cd279 EDI:
 EBP: f3e89c10 ESP: f3e89c04
Jun 30 08:35:08 laptop kernel: [5.246396]  DS: 007b ES: 007b FS:
00d8 GS: 00e0 SS: 0068
Jun 30 08:35:08 laptop kernel: [5.246405] CR0: 80050033 CR2:
074c CR3: 2e3fc000 CR4: 000407f0
Jun 30 08:35:08 laptop kernel: [5.246414] Stack:
Jun 30 08:35:08 laptop kernel: [5.246421]  f3e89c10 c1032889
f3cbcc60 f3e89c4c f86b52bf 0005  0448
Jun 30 08:35:08 laptop kernel: [5.246442]  f3e89c30 0006
00165000 ffb76000 0113 f870f010 ee881128 ee881128
Jun 30 08:35:08 laptop kernel: [5.246465]  0001 f418b980
f3e89c74 f86b4e5c  f3911e00 f3911e00 ee881128
Jun 30 08:35:08 laptop kernel: [5.246487] Call Trace:
Jun 30 08:35:08 laptop kernel: [5.246500]  [c1032889] ?
kunmap+0x3b/0x4e
Jun 30 08:35:08 laptop kernel: [5.246578]  [f86b52bf] ?
i915_gem_render_state_init+0x24f/0x28c [i915]
Jun 30 08:35:08 laptop kernel: [5.246634]  [f86b4e5c] ?
i915_switch_context+0x348/0x387 [i915]
Jun 30 08:35:08 laptop kernel: [5.246684]  [f86b4f0f] ?
i915_gem_context_enable+0x74/0x7c [i915]
Jun 30 08:35:08 laptop kernel: [5.246742]  [f86bcd38] ?
i915_gem_init_hw+0x23e/0x285 [i915]
Jun 30 08:35:08 laptop kernel: [5.246818]  [f86bce7e] ?
i915_gem_init+0xff/0x179 [i915]
Jun 30 08:35:08 laptop kernel: [5.246924]  [f87047d9] ?
i915_driver_load+0x989/0xc1d [i915]
Jun 30 08:35:08 laptop kernel: [5.246940]  [c1267429] ?
get_device+0x14/0x1d
Jun 30 08:35:08 laptop kernel: [5.246955]  [c1268832] ?
device_add+0x3b7/0x4a9
Jun 30 08:35:08 laptop kernel: [5.246996]  [f8619c80] ?
drm_minor_register+0x104/0x15c [drm]
Jun 30 08:35:08 laptop kernel: [5.247033]  [f8619d44] ?
drm_dev_register+0x6c/0xce [drm]
Jun 30 08:35:08 laptop kernel: [5.247072]  [f861bbb4] ?
drm_get_pci_dev+0xde/0x174 [drm]
Jun 30 08:35:08 laptop kernel: [5.247088]  [c11dcc58] ?
local_pci_probe+0x33/0x6c
Jun 30 08:35:08 laptop kernel: [5.247101]  [c11dcd39] ?
pci_device_probe+0xa8/0xca
Jun 30 08:35:08 laptop kernel: [5.247115]  [c126a75a] ?
driver_probe_device+0xd3/0x225
Jun 30 08:35:08 laptop kernel: [5.247128]  [c126a8f8] ?
__driver_attach+0x4c/0x68
Jun 30 08:35:08 laptop kernel: [5.247141]  [c1269260] ?
bus_for_each_dev+0x41/0x6b
Jun 30 08:35:08 laptop kernel: [5.247155]  [c126a26c] ?
driver_attach+0x19/0x1b
Jun 30 08:35:08 laptop kernel: [5.247166]  [c126a8ac] ?
driver_probe_device+0x225/0x225
Jun 30 08:35:08 laptop kernel: [5.247176]  [c126a027] ?
bus_add_driver+0xcf/0x192
Jun 30 08:35:08 laptop kernel: [5.247184]  [c126ae69] ?
driver_register+0x73/0xa5
Jun 30 08:35:08 laptop kernel: [5.247193]  [f85ee000] ? 0xf85edfff
Jun 30 08:35:08 laptop kernel: [5.247200]  [c100045e] ?
do_one_initcall+0xe0/0x17a
Jun 30 08:35:08 laptop kernel: [5.247209]  [c10fadf8] ?
__cache_free+0x369/0x371
Jun 30 08:35:08 laptop kernel: [5.247216]  [c10fadf8] ?

Re: [PATCH] Fix backlight control for Acer TravelMate B113

2014-06-30 Thread Martin Kepplinger
Am 2014-06-30 03:29, schrieb Aaron Lu:
 On 06/29/2014 04:42 PM, Martin Kepplinger wrote:
 Am 2014-06-23 22:30, schrieb Martin Kepplinger:
 Fix backlight control for Acer TravelMate B113 Laptop by adding
 it to the video_dmi_table.

 A workaround before that was to use acpi_osi=Linux or
 acpi_backlight=vendor on boot but even then, only the function-
 keys worked.

 With this change there is no need for boot parameters and DE's
 controls work as well.

 Signed-off-by: Martin Kepplinger mart...@posteo.de
 Tested-by: Martin Kepplinger mart...@posteo.de
 ---
  drivers/acpi/video.c |8 
  1 file changed, 8 insertions(+)

 diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
 index f8bc5a7..acb0670 100644
 --- a/drivers/acpi/video.c
 +++ b/drivers/acpi/video.c
 @@ -528,6 +528,14 @@ static struct dmi_system_id video_dmi_table[] 
 __initdata = {
 },
 },
 {
 +.callback = video_set_use_native_backlight,
 +.ident = Acer TravelMate B113,
 +.matches = {
 +   DMI_MATCH(DMI_SYS_VENDOR, Acer),
 +   DMI_MATCH(DMI_PRODUCT_NAME, TravelMate B113),
 +   },
 +   },
 +   {
 .callback = video_set_use_native_backlight,
 .ident = HP ProBook 4340s,
 .matches = {


 are there objections or advice on this? this would be really good to
 have, even if for 3.17.
 
 For v3.16, we already have this commit to make use_native_backlight
 equal to 1 by default:
 
 commit 751109aad5834375ca9ed0dcfcd85a00cbf872b5
 Author: Rafael J. Wysocki rafael.j.wyso...@intel.com
 Date:   Thu Jun 5 22:47:35 2014 +0200
 
 ACPI / video: Change the default for video.use_native_backlight to 1
 
 
 Thanks,
 Aaron
 
thanks! That should do it and would be a better solution. I can't test
it on 3.16 though, as rc3 is still broken for me, see
https://lkml.org/lkml/2014/6/30/66


 thanks.
 martin
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/

 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] rc3 Oops: unable to handle kernel NULL pointer dereference at 0000074c

2014-06-30 Thread Martin Kepplinger
Am 2014-06-30 10:20, schrieb Zhang Rui:
 On Mon, 2014-06-30 at 16:18 +0800, Zhang Rui wrote:
 On Mon, 2014-06-30 at 09:52 +0200, Martin Kepplinger wrote:
 I now booted 3.16-rc3 and suddenly see an oops during boot:

 the oops during boot: http://tny.cz/2301e393
 also below

 lshw if interesting: http://tny.cz/3c9a7609

 the full boot log: http://tny.cz/88260b19

 does anyone have an idea?

 what if you rebuild the kernel with CONFIG_SENSORS_CORETEMP=n?

 BTW, can this be 100% reproduced on a rc3 kernel?

no I can't -.- Booted again a few times, no oops now. just the black
screen as 'usual' for 3.16.

 
 thanks,
 rui
 thanks,
 rui
thanks

 the oops:

 Jun 30 08:35:08 laptop kernel: [5.245811] bus: 'platform':
 really_probe: probing driver coretemp with device coretemp.0
 Jun 30 08:35:08 laptop kernel: [5.246134] BUG: unable to handle
 kernel NULL pointer dereference at 074c
 Jun 30 08:35:08 laptop kernel: [5.246145] IP: [c10325d9]
 is_highmem+0x1/0x2b
 Jun 30 08:35:08 laptop kernel: [5.246158] *pdpt = 33e49001
 *pde = 
 Jun 30 08:35:08 laptop kernel: [5.246167] Oops:  [#1] SMP
 Jun 30 08:35:08 laptop kernel: [5.246175] Modules linked in:
 coretemp(+) kvm_intel kvm snd_hda_codec_hdmi snd_hda_codec_realtek
 snd_hda_codec_generic microcode snd_hda_intel i915(+) snd_hda_controller
 evdev psmouse snd_hda_codec serio_raw snd_hwdep snd_pcm iwlwifi i2c_i801
 lpc_ich mfd_core snd_seq drm_kms_helper snd_timer battery ehci_pci
 snd_seq_device drm cfg80211 ehci_hcd snd i2c_algo_bit ac video i2c_core
 rfkill soundcore wmi acpi_cpufreq button processor thermal_sys ext4
 crc16 jbd2 mbcache sg sd_mod crct10dif_generic crc_t10dif
 crct10dif_common ahci libahci crc32c_intel tg3 ptp libata pps_core
 sdhci_pci sdhci scsi_mod mmc_core libphy xhci_hcd usbcore usb_common
 Jun 30 08:35:08 laptop kernel: [5.246320] CPU: 1 PID: 491 Comm:
 modprobe Not tainted 3.16.0-rc3 #83
 Jun 30 08:35:08 laptop kernel: [5.246330] Hardware name: Acer
 TravelMate B113/BA10_HX   , BIOS V1.09 10/30/2012
 Jun 30 08:35:08 laptop kernel: [5.246344] task: f3828a90 ti:
 f3e88000 task.ti: f3e88000
 Jun 30 08:35:08 laptop kernel: [5.246355] EIP: 0060:[c10325d9]
 EFLAGS: 00010206 CPU: 1
 Jun 30 08:35:08 laptop kernel: [5.246367] EIP is at is_highmem+0x1/0x2b
 Jun 30 08:35:08 laptop kernel: [5.246376] EAX: 03c0 EBX:
 ffb76000 ECX: 0001 EDX: 03c0
 Jun 30 08:35:08 laptop kernel: [5.246386] ESI: f86cd279 EDI:
  EBP: f3e89c10 ESP: f3e89c04
 Jun 30 08:35:08 laptop kernel: [5.246396]  DS: 007b ES: 007b FS:
 00d8 GS: 00e0 SS: 0068
 Jun 30 08:35:08 laptop kernel: [5.246405] CR0: 80050033 CR2:
 074c CR3: 2e3fc000 CR4: 000407f0
 Jun 30 08:35:08 laptop kernel: [5.246414] Stack:
 Jun 30 08:35:08 laptop kernel: [5.246421]  f3e89c10 c1032889
 f3cbcc60 f3e89c4c f86b52bf 0005  0448
 Jun 30 08:35:08 laptop kernel: [5.246442]  f3e89c30 0006
 00165000 ffb76000 0113 f870f010 ee881128 ee881128
 Jun 30 08:35:08 laptop kernel: [5.246465]  0001 f418b980
 f3e89c74 f86b4e5c  f3911e00 f3911e00 ee881128
 Jun 30 08:35:08 laptop kernel: [5.246487] Call Trace:
 Jun 30 08:35:08 laptop kernel: [5.246500]  [c1032889] ?
 kunmap+0x3b/0x4e
 Jun 30 08:35:08 laptop kernel: [5.246578]  [f86b52bf] ?
 i915_gem_render_state_init+0x24f/0x28c [i915]
 Jun 30 08:35:08 laptop kernel: [5.246634]  [f86b4e5c] ?
 i915_switch_context+0x348/0x387 [i915]
 Jun 30 08:35:08 laptop kernel: [5.246684]  [f86b4f0f] ?
 i915_gem_context_enable+0x74/0x7c [i915]
 Jun 30 08:35:08 laptop kernel: [5.246742]  [f86bcd38] ?
 i915_gem_init_hw+0x23e/0x285 [i915]
 Jun 30 08:35:08 laptop kernel: [5.246818]  [f86bce7e] ?
 i915_gem_init+0xff/0x179 [i915]
 Jun 30 08:35:08 laptop kernel: [5.246924]  [f87047d9] ?
 i915_driver_load+0x989/0xc1d [i915]
 Jun 30 08:35:08 laptop kernel: [5.246940]  [c1267429] ?
 get_device+0x14/0x1d
 Jun 30 08:35:08 laptop kernel: [5.246955]  [c1268832] ?
 device_add+0x3b7/0x4a9
 Jun 30 08:35:08 laptop kernel: [5.246996]  [f8619c80] ?
 drm_minor_register+0x104/0x15c [drm]
 Jun 30 08:35:08 laptop kernel: [5.247033]  [f8619d44] ?
 drm_dev_register+0x6c/0xce [drm]
 Jun 30 08:35:08 laptop kernel: [5.247072]  [f861bbb4] ?
 drm_get_pci_dev+0xde/0x174 [drm]
 Jun 30 08:35:08 laptop kernel: [5.247088]  [c11dcc58] ?
 local_pci_probe+0x33/0x6c
 Jun 30 08:35:08 laptop kernel: [5.247101]  [c11dcd39] ?
 pci_device_probe+0xa8/0xca
 Jun 30 08:35:08 laptop kernel: [5.247115]  [c126a75a] ?
 driver_probe_device+0xd3/0x225
 Jun 30 08:35:08 laptop kernel: [5.247128]  [c126a8f8] ?
 __driver_attach+0x4c/0x68
 Jun 30 08:35:08 laptop kernel: [5.247141]  [c1269260] ?
 bus_for_each_dev+0x41/0x6b
 Jun 30 08:35:08 laptop kernel: [5.247155]  [c126a26c] ?
 driver_attach+0x19/0x1b
 Jun 30 08:35:08 laptop kernel: [5.247166]  [c126a8ac] ?
 driver_probe_device

Re: [BUG] rc1 rc2 rc3 not bootable - black screen after kernel loading

2014-06-30 Thread Martin Kepplinger
back to aaeb2554337217dfa4eac2fcc90da7be540b9a73 as the first bad
commit. why is this not revertable exactly? how can I show a complete
list of commits this merge introduces?
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mtd: use NULL instead of 0 for an address

2014-07-31 Thread Martin Kepplinger
Use NULL instead of 0 when returning an address. This fixes a
sparse warning.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
Sorry if this is only noise, I stumbled upon it and why not send it.
applies to next-20140731

 drivers/mtd/maps/pcmciamtd.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index a3cfad3..af747af 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -89,7 +89,7 @@ static caddr_t remap_window(struct map_info *map, unsigned 
long to)
 
if (!pcmcia_dev_present(dev-p_dev)) {
pr_debug(device removed\n);
-   return 0;
+   return NULL;
}
 
offset = to  ~(dev-win_size-1);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-08-03 Thread Martin Kepplinger
remove dprintk() and replace it with dev_dbg() in order to
use the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
I don't have the device but this builds.
I think this is ok when it gets reviewed.

applies to -next20140801

 drivers/staging/media/as102/as102_drv.c |   15 +
 drivers/staging/media/as102/as102_drv.h |7 -
 drivers/staging/media/as102/as102_fe.c  |   44 +++
 drivers/staging/media/as102/as102_usb_drv.c |   41 ++---
 4 files changed, 62 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/media/as102/as102_drv.c 
b/drivers/staging/media/as102/as102_drv.c
index 09d64cd..e0ee618 100644
--- a/drivers/staging/media/as102/as102_drv.c
+++ b/drivers/staging/media/as102/as102_drv.c
@@ -31,10 +31,6 @@
 #include as102_fw.h
 #include dvbdev.h
 
-int as102_debug;
-module_param_named(debug, as102_debug, int, 0644);
-MODULE_PARM_DESC(debug, Turn on/off debugging (default: off));
-
 int dual_tuner;
 module_param_named(dual_tuner, dual_tuner, int, 0644);
 MODULE_PARM_DESC(dual_tuner, Activate Dual-Tuner config (default: off));
@@ -74,7 +70,8 @@ static void as102_stop_stream(struct as102_dev_t *dev)
return;
 
if (as10x_cmd_stop_streaming(bus_adap)  0)
-   dprintk(debug, as10x_cmd_stop_streaming failed\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   as10x_cmd_stop_streaming failed\n);
 
mutex_unlock(dev-bus_adap.lock);
}
@@ -112,14 +109,16 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
int ret = -EFAULT;
 
if (mutex_lock_interruptible(dev-bus_adap.lock)) {
-   dprintk(debug, mutex_lock_interruptible(lock) failed !\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   amutex_lock_interruptible(lock) failed !\n);
return -EBUSY;
}
 
switch (onoff) {
case 0:
ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) pid);
-   dprintk(debug, DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
index, pid, ret);
break;
case 1:
@@ -131,7 +130,7 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
filter.pid = pid;
 
ret = as10x_cmd_add_PID_filter(bus_adap, filter);
-   dprintk(debug,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
ADD_PID_FILTER([%02d - %02d], 0x%04x) ret = %d\n,
index, filter.idx, filter.pid, ret);
break;
diff --git a/drivers/staging/media/as102/as102_drv.h 
b/drivers/staging/media/as102/as102_drv.h
index a06837d..49d0c42 100644
--- a/drivers/staging/media/as102/as102_drv.h
+++ b/drivers/staging/media/as102/as102_drv.h
@@ -27,17 +27,10 @@
 #define DRIVER_FULL_NAME Abilis Systems as10x usb driver
 #define DRIVER_NAME as10x_usb
 
-extern int as102_debug;
 #define debug  as102_debug
 extern struct usb_driver as102_usb_driver;
 extern int elna_enable;
 
-#define dprintk(debug, args...) \
-   do { if (debug) {   \
-   pr_debug(%s: , __func__); \
-   printk(args);   \
-   } } while (0)
-
 #define AS102_DEVICE_MAJOR 192
 
 #define AS102_USB_BUF_SIZE 512
diff --git a/drivers/staging/media/as102/as102_fe.c 
b/drivers/staging/media/as102/as102_fe.c
index b686b76..69ffd51 100644
--- a/drivers/staging/media/as102/as102_fe.c
+++ b/drivers/staging/media/as102/as102_fe.c
@@ -46,7 +46,8 @@ static int as102_fe_set_frontend(struct dvb_frontend *fe)
/* send abilis command: SET_TUNE */
ret =  as10x_cmd_set_tune(dev-bus_adap, tune_args);
if (ret != 0)
-   dprintk(debug, as10x_cmd_set_tune failed. (err = %d)\n, ret);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   as10x_cmd_set_tune failed. (err = %d)\n, ret);
 
mutex_unlock(dev-bus_adap.lock);
 
@@ -82,10 +83,17 @@ static int as102_fe_get_tune_settings(struct dvb_frontend 
*fe,
struct dvb_frontend_tune_settings *settings) {
 
 #if 0
-   dprintk(debug, step_size= %d\n, settings-step_size);
-   dprintk(debug, max_drift= %d\n, settings-max_drift);
-   dprintk(debug, min_delay_ms = %d - %d\n, settings-min_delay_ms,
-   1000);
+   struct as102_dev_t *dev;
+
+   dev = (struct as102_dev_t *) fe-tuner_priv;
+   if (dev == NULL)
+   return -EINVAL;
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   step_size= %d\n, settings-step_size);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   max_drift= %d\n, settings-max_drift);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   min_delay_ms = %d - %d\n, settings-min_delay_ms, 1000);
 #endif

[PATCH] staging: rtl8192ee: checkpatch: use tabs for indent

2014-08-03 Thread Martin Kepplinger
Use tabs for code indent and use the kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
applies to -next20140801

 drivers/staging/rtl8192ee/regd.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192ee/regd.c b/drivers/staging/rtl8192ee/regd.c
index 7272fae..7841447 100644
--- a/drivers/staging/rtl8192ee/regd.c
+++ b/drivers/staging/rtl8192ee/regd.c
@@ -363,8 +363,7 @@ static const struct ieee80211_regdomain 
*_rtl_regdomain_select(
 static int _rtl92e_regd_init_wiphy(struct rtl_regulatory *reg,
   struct wiphy *wiphy,
   void (*reg_notifier)(struct wiphy *wiphy,
-   struct 
regulatory_request *
-   request))
+   struct regulatory_request *request))
 {
const struct ieee80211_regdomain *regd;
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: rtl8192ee: checkpatch: use tabs for indent

2014-08-03 Thread Martin Kepplinger
Am 2014-08-03 18:27, schrieb Joe Perches:
 On Sun, 2014-08-03 at 18:06 +0200, Martin Kepplinger wrote:
 Use tabs for code indent and use the kernel coding style.
 []
 diff --git a/drivers/staging/rtl8192ee/regd.c 
 b/drivers/staging/rtl8192ee/regd.c
 []
 @@ -363,8 +363,7 @@ static const struct ieee80211_regdomain 
 *_rtl_regdomain_select(
  static int _rtl92e_regd_init_wiphy(struct rtl_regulatory *reg,
 struct wiphy *wiphy,
 void (*reg_notifier)(struct wiphy *wiphy,
 -struct 
 regulatory_request *
 -request))
 +struct regulatory_request *request))
  {
  const struct ieee80211_regdomain *regd;
  
 
 It seems that was done to keep the alignment of the function
 pointer arguments to the open parenthesis.
 
 If I were to do anything, it'd be to move the static int
 to a separate line and unindent the block a little
 
 For this file, maybe something like this:
 ---
  drivers/staging/rtl8192ee/regd.c | 120 
 +++
  1 file changed, 60 insertions(+), 60 deletions(-)
 
 diff --git a/drivers/staging/rtl8192ee/regd.c 
 b/drivers/staging/rtl8192ee/regd.c
 index 7272fae..4fcb5f0 100644
 --- a/drivers/staging/rtl8192ee/regd.c
 +++ b/drivers/staging/rtl8192ee/regd.c
 @@ -46,99 +46,99 @@ static struct country_code_to_enum_rd allcountries[] = {
   *Only these channels all allow active
   *scan on all world regulatory domains
   */
 -#define RTL819x_2GHZ_CH01_11 \
 +#define RTL819x_2GHZ_CH01_11 \
   REG_RULE(2412-10, 2462+10, 40, 0, 20, 0)
  
  /*
   *We enable active scan on these a case
   *by case basis by regulatory domain
   */
 -#define RTL819x_2GHZ_CH12_13 \
 - REG_RULE(2467-10, 2472+10, 40, 0, 20,\
 - NL80211_RRF_PASSIVE_SCAN)
 +#define RTL819x_2GHZ_CH12_13 \
 + REG_RULE(2467-10, 2472+10, 40, 0, 20,   \
 +  NL80211_RRF_PASSIVE_SCAN)
  
 -#define RTL819x_2GHZ_CH14\
 - REG_RULE(2484-10, 2484+10, 40, 0, 20, \
 - NL80211_RRF_PASSIVE_SCAN | \
 - NL80211_RRF_NO_OFDM)
 +#define RTL819x_2GHZ_CH14\
 + REG_RULE(2484-10, 2484+10, 40, 0, 20,   \
 +  NL80211_RRF_PASSIVE_SCAN | \
 +  NL80211_RRF_NO_OFDM)
  
  /* 5G chan 36 - chan 64*/
 -#define RTL819x_5GHZ_5150_5350   \
 - REG_RULE(5150-10, 5350+10, 80, 0, 30, \
 - NL80211_RRF_PASSIVE_SCAN | \
 - NL80211_RRF_NO_IBSS)
 +#define RTL819x_5GHZ_5150_5350   \
 + REG_RULE(5150-10, 5350+10, 80, 0, 30,   \
 +  NL80211_RRF_PASSIVE_SCAN | \
 +  NL80211_RRF_NO_IBSS)
  
  /* 5G chan 100 - chan 165*/
 -#define RTL819x_5GHZ_5470_5850   \
 - REG_RULE(5470-10, 5850+10, 80, 0, 30, \
 - NL80211_RRF_PASSIVE_SCAN | \
 - NL80211_RRF_NO_IBSS)
 +#define RTL819x_5GHZ_5470_5850   \
 + REG_RULE(5470-10, 5850+10, 80, 0, 30,   \
 +  NL80211_RRF_PASSIVE_SCAN | \
 +  NL80211_RRF_NO_IBSS)
  
  /* 5G chan 149 - chan 165*/
 -#define RTL819x_5GHZ_5725_5850   \
 - REG_RULE(5725-10, 5850+10, 80, 0, 30, \
 - NL80211_RRF_PASSIVE_SCAN | \
 - NL80211_RRF_NO_IBSS)
 +#define RTL819x_5GHZ_5725_5850   \
 + REG_RULE(5725-10, 5850+10, 80, 0, 30,   \
 +  NL80211_RRF_PASSIVE_SCAN | \
 +  NL80211_RRF_NO_IBSS)
  
 -#define RTL819x_5GHZ_ALL \
 +#define RTL819x_5GHZ_ALL \
   (RTL819x_5GHZ_5150_5350, RTL819x_5GHZ_5470_5850)
  
  static const struct ieee80211_regdomain rtl_regdom_11 = {
   .n_reg_rules = 1,
   .alpha2 = 99,
   .reg_rules = {
 -   RTL819x_2GHZ_CH01_11,
 -   }
 + RTL819x_2GHZ_CH01_11,
 + }
  };
  
  static const struct ieee80211_regdomain rtl_regdom_12_13 = {
   .n_reg_rules = 2,
   .alpha2 = 99,
   .reg_rules = {
 -   RTL819x_2GHZ_CH01_11,
 -   RTL819x_2GHZ_CH12_13,
 -   }
 + RTL819x_2GHZ_CH01_11,
 + RTL819x_2GHZ_CH12_13,
 + }
  };
  
  static const struct ieee80211_regdomain rtl_regdom_no_midband = {
   .n_reg_rules = 3,
   .alpha2 = 99,
   .reg_rules = {
 -   RTL819x_2GHZ_CH01_11,
 -   RTL819x_5GHZ_5150_5350,
 -   RTL819x_5GHZ_5725_5850,
 -   }
 + RTL819x_2GHZ_CH01_11,
 + RTL819x_5GHZ_5150_5350,
 + RTL819x_5GHZ_5725_5850,
 + }
  };
  
  static const struct ieee80211_regdomain rtl_regdom_60_64 = {
   .n_reg_rules = 3,
   .alpha2 = 99,
   .reg_rules = {
 -   RTL819x_2GHZ_CH01_11,
 -   RTL819x_2GHZ_CH12_13,
 -   RTL819x_5GHZ_5725_5850

[PATCH] staging: rtl8192u: checkpatch: do not use C99 // comments

2014-08-03 Thread Martin Kepplinger
Use the common kernel coding style, so don't use C99 // comments.
If too long, where reasonable, they are shortened as well.

Some old internal comments about date and author of changes are
removed.

This provides a more consistent view and hopefully encourages to
look at it.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
This changes only a part of rtl8192u's comments. When this is desired,
one can go about and change the rest of the driver.

build-tested. applies to -next20140801

 drivers/staging/rtl8192u/r8180_93cx6.c |   12 +-
 drivers/staging/rtl8192u/r8192U_core.c |  757 +---
 2 files changed, 414 insertions(+), 355 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
b/drivers/staging/rtl8192u/r8180_93cx6.c
index fb8a7a8..9f3f9dd 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.c
+++ b/drivers/staging/rtl8192u/r8180_93cx6.c
@@ -103,7 +103,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
u32 ret;
 
ret = 0;
-   //enable EPROM programming
+   /* enable EPROM programming */
write_nic_byte_E(dev, EPROM_CMD,
   (EPROM_CMD_PROGRAMEPROM_CMD_OPERATING_MODE_SHIFT));
force_pci_posting(dev);
@@ -133,13 +133,13 @@ u32 eprom_read(struct net_device *dev, u32 addr)
eprom_send_bits_string(dev, read_cmd, 3);
eprom_send_bits_string(dev, addr_str, addr_len);
 
-   //keep chip pin D to low state while reading.
-   //I'm unsure if it is necessary, but anyway shouldn't hurt
+   /* keep chip pin D to low state while reading.
+* I'm unsure if it is necessary, but anyway shouldn't hurt */
eprom_w(dev, 0);
 
for (i = 0; i  16; i++) {
-   //eeprom needs a clk cycle between writing opcodeadr
-   //and reading data. (eeprom outs a dummy 0)
+   /* eeprom needs a clk cycle between writing opcodeadr
+* and reading data. (eeprom outs a dummy 0) */
eprom_ck_cycle(dev);
ret |= (eprom_r(dev)(15-i));
}
@@ -147,7 +147,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
eprom_cs(dev, 0);
eprom_ck_cycle(dev);
 
-   //disable EPROM programming
+   /* disable EPROM programming */
write_nic_byte_E(dev, EPROM_CMD,
   (EPROM_CMD_NORMALEPROM_CMD_OPERATING_MODE_SHIFT));
return ret;
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 7640386..f97019d 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -87,7 +87,7 @@ double __extendsfdf2(float a)
 #include r8190_rtl8256.h /* RTL8225 Radio frontend */
 #include r8180_93cx6.h   /* Card EEPROM */
 #include r8192U_wx.h
-#include r819xU_phy.h //added by WB 4.30.2008
+#include r819xU_phy.h
 #include r819xU_phyreg.h
 #include r819xU_cmdpkt.h
 #include r8192U_dm.h
@@ -95,13 +95,13 @@ double __extendsfdf2(float a)
 #include linux/slab.h
 #include linux/proc_fs.h
 #include linux/seq_file.h
-// FIXME: check if 2.6.7 is ok
+/* FIXME: check if 2.6.7 is ok */
 
 #include dot11d.h
-//set here to open your trace code. //WB
+/* set here to open your trace code. */
 u32 rt_global_debug_component = COMP_DOWN  |
COMP_SEC|
-   COMP_ERR; //always open err flags on
+   COMP_ERR; /* always open err flags on */
 
 #define TOTAL_CAM_ENTRY 32
 #define CAM_CONTENT_COUNT 8
@@ -132,7 +132,7 @@ MODULE_DEVICE_TABLE(usb, rtl8192_usb_id_tbl);
 MODULE_DESCRIPTION(Linux driver for Realtek RTL8192 USB WiFi cards);
 
 static char *ifname = wlan%d;
-static int hwwep = 1;  //default use hw. set 0 to use software security
+static int hwwep = 1;  /* default use hw. set 0 to use software security */
 static int channels = 0x3fff;
 
 
@@ -166,17 +166,17 @@ typedef struct _CHANNEL_LIST {
 } CHANNEL_LIST, *PCHANNEL_LIST;
 
 static CHANNEL_LIST ChannelPlan[] = {
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64, 
149, 153, 157, 161, 165}, 24}, //FCC
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11},  
//IC
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 
60, 64}, 21},  //ETSI
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},//Spain. Change 
to ETSI.
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},  //France. 
Change to ETSI.
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  //MKK   //MKK
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},//MKK1
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},  //Israel.
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  // For 11a , TELEC
-   {{1, 2, 3

[PATCH] staging: lustre: use NULL instead of 0 for non-integers

2014-08-03 Thread Martin Kepplinger
This fixes sparse errors where 0 is used for non-integers.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
applies to -next20140802

 drivers/staging/lustre/lnet/lnet/api-ni.c  |4 +-
 drivers/staging/lustre/lustre/fld/fld_request.c|2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c|2 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |2 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c  |   44 ++--
 drivers/staging/lustre/lustre/mgc/mgc_request.c|2 +-
 .../lustre/lustre/obdclass/linux/linux-module.c|2 +-
 drivers/staging/lustre/lustre/obdclass/llog_test.c |4 +-
 .../staging/lustre/lustre/obdclass/obd_config.c|4 +-
 .../staging/lustre/lustre/obdecho/echo_client.c|2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c|6 +--
 11 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index f4a2c65..b28734a 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1662,7 +1662,7 @@ lnet_destroy_ping_info(void)
 int
 lnet_ping_target_init(void)
 {
-   lnet_md_tmd = {0};
+   lnet_md_tmd = { NULL };
lnet_handle_me_t  meh;
lnet_process_id_t id;
intrc;
@@ -1770,7 +1770,7 @@ lnet_ping (lnet_process_id_t id, int timeout_ms, 
lnet_process_id_t *ids, int n_i
lnet_handle_eq_t eqh;
lnet_handle_md_t mdh;
lnet_event_t event;
-   lnet_md_t   md = {0};
+   lnet_md_t   md = { NULL };
int   which;
int   unlinked = 0;
int   replied = 0;
diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c 
b/drivers/staging/lustre/lustre/fld/fld_request.c
index 4efded9..8e512f9 100644
--- a/drivers/staging/lustre/lustre/fld/fld_request.c
+++ b/drivers/staging/lustre/lustre/fld/fld_request.c
@@ -168,7 +168,7 @@ struct lu_fld_hash fld_hash[] = {
.fh_scan_func = fld_rrb_scan
},
{
-   0,
+   NULL,
}
 };
 
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index e0d8f15..0367f5a 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -152,7 +152,7 @@ static void ll_free_sbi(struct super_block *sb)
 static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
struct vfsmount *mnt)
 {
-   struct inode *root = 0;
+   struct inode *root = NULL;
struct ll_sb_info *sbi = ll_s2sbi(sb);
struct obd_device *obd;
struct obd_capa *oc = NULL;
diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c 
b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 13586c5..77f68b5 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -843,7 +843,7 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
{ default_cookiesize, ll_defult_cookiesize_fops, NULL, 0 },
{ sbi_flags,ll_sbi_flags_fops, NULL, 0 },
{ xattr_cache,  ll_xattr_cache_fops, NULL, 0 },
-   { 0 }
+   { NULL }
 };
 
 #define MAX_STRING_SIZE 128
diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c 
b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index e6af825..f266e95 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -172,39 +172,39 @@ LPROC_SEQ_FOPS_RW_TYPE(mdc, import);
 LPROC_SEQ_FOPS_RW_TYPE(mdc, pinger_recov);
 
 static struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
-   { uuid,   mdc_uuid_fops, 0, 0 },
-   { ping,   mdc_ping_fops, 0, 0222 },
-   { connect_flags,  mdc_connect_flags_fops,0, 0 },
-   { blocksize,  mdc_blksize_fops,  0, 0 },
-   { kbytestotal,mdc_kbytestotal_fops,  0, 0 },
-   { kbytesfree, mdc_kbytesfree_fops,   0, 0 },
-   { kbytesavail,mdc_kbytesavail_fops,  0, 0 },
-   { filestotal, mdc_filestotal_fops,   0, 0 },
-   { filesfree,  mdc_filesfree_fops,0, 0 },
-   /*{ filegroups,  lprocfs_rd_filegroups,  0, 0 },*/
-   { mds_server_uuid, mdc_server_uuid_fops, 0, 0 },
-   { mds_conn_uuid,  mdc_conn_uuid_fops,0, 0 },
+   { uuid,   mdc_uuid_fops, NULL, 0 },
+   { ping,   mdc_ping_fops, NULL, 0222 },
+   { connect_flags,  mdc_connect_flags_fops,NULL, 0 },
+   { blocksize,  mdc_blksize_fops,  NULL, 0 },
+   { kbytestotal,mdc_kbytestotal_fops,  NULL, 0 },
+   { kbytesfree, mdc_kbytesfree_fops,   NULL, 0 },
+   { kbytesavail,mdc_kbytesavail_fops

[PATCH] scsi: use correct formats in printk()

2014-08-04 Thread Martin Kepplinger
Use %llu for u64 and %u for int. Not the other way round.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
applies to -next20140801

 drivers/scsi/u14-34f.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index 4e76fe8..d8dcf36 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -1006,7 +1006,7 @@ static int port_detect \
   sh[j]-irq, dma_name, sh[j]-sg_tablesize, sh[j]-can_queue);
 
if (sh[j]-max_id  8 || sh[j]-max_lun  8)
-  printk(%s: wide SCSI support enabled, max_id %u, max_lun %u.\n,
+  printk(%s: wide SCSI support enabled, max_id %u, max_lun %llu.\n,
  BN(j), sh[j]-max_id, sh[j]-max_lun);
 
for (i = 0; i = sh[j]-max_channel; i++)
@@ -1285,7 +1285,7 @@ static int u14_34f_queuecommand_lck(struct scsi_cmnd 
*SCpnt, void (*done)(struct
cpp-cpp_index = i;
SCpnt-host_scribble = (unsigned char *) cpp-cpp_index;
 
-   if (do_trace) printk(%s: qcomm, mbox %d, target %d.%d:%llu.\n,
+   if (do_trace) printk(%s: qcomm, mbox %d, target %d.%d:%u.\n,
 BN(j), i, SCpnt-device-channel, SCpnt-device-id,
 (u8)SCpnt-device-lun);
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-08-04 Thread Martin Kepplinger
remove dprintk() and replace it with dev_dbg() in order to
use the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
Thanks Dan. And since it continues to succeed if (dev == NULL),
differntiate if (dev) or not.

 drivers/staging/media/as102/as102_drv.c |   15 +++---
 drivers/staging/media/as102/as102_drv.h |7 ---
 drivers/staging/media/as102/as102_fe.c  |   73 ---
 drivers/staging/media/as102/as102_usb_drv.c |   41 ---
 4 files changed, 86 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/media/as102/as102_drv.c 
b/drivers/staging/media/as102/as102_drv.c
index 09d64cd..e0ee618 100644
--- a/drivers/staging/media/as102/as102_drv.c
+++ b/drivers/staging/media/as102/as102_drv.c
@@ -31,10 +31,6 @@
 #include as102_fw.h
 #include dvbdev.h
 
-int as102_debug;
-module_param_named(debug, as102_debug, int, 0644);
-MODULE_PARM_DESC(debug, Turn on/off debugging (default: off));
-
 int dual_tuner;
 module_param_named(dual_tuner, dual_tuner, int, 0644);
 MODULE_PARM_DESC(dual_tuner, Activate Dual-Tuner config (default: off));
@@ -74,7 +70,8 @@ static void as102_stop_stream(struct as102_dev_t *dev)
return;
 
if (as10x_cmd_stop_streaming(bus_adap)  0)
-   dprintk(debug, as10x_cmd_stop_streaming failed\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   as10x_cmd_stop_streaming failed\n);
 
mutex_unlock(dev-bus_adap.lock);
}
@@ -112,14 +109,16 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
int ret = -EFAULT;
 
if (mutex_lock_interruptible(dev-bus_adap.lock)) {
-   dprintk(debug, mutex_lock_interruptible(lock) failed !\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   amutex_lock_interruptible(lock) failed !\n);
return -EBUSY;
}
 
switch (onoff) {
case 0:
ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) pid);
-   dprintk(debug, DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
index, pid, ret);
break;
case 1:
@@ -131,7 +130,7 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
filter.pid = pid;
 
ret = as10x_cmd_add_PID_filter(bus_adap, filter);
-   dprintk(debug,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
ADD_PID_FILTER([%02d - %02d], 0x%04x) ret = %d\n,
index, filter.idx, filter.pid, ret);
break;
diff --git a/drivers/staging/media/as102/as102_drv.h 
b/drivers/staging/media/as102/as102_drv.h
index a06837d..49d0c42 100644
--- a/drivers/staging/media/as102/as102_drv.h
+++ b/drivers/staging/media/as102/as102_drv.h
@@ -27,17 +27,10 @@
 #define DRIVER_FULL_NAME Abilis Systems as10x usb driver
 #define DRIVER_NAME as10x_usb
 
-extern int as102_debug;
 #define debug  as102_debug
 extern struct usb_driver as102_usb_driver;
 extern int elna_enable;
 
-#define dprintk(debug, args...) \
-   do { if (debug) {   \
-   pr_debug(%s: , __func__); \
-   printk(args);   \
-   } } while (0)
-
 #define AS102_DEVICE_MAJOR 192
 
 #define AS102_USB_BUF_SIZE 512
diff --git a/drivers/staging/media/as102/as102_fe.c 
b/drivers/staging/media/as102/as102_fe.c
index b686b76..4c4c47d 100644
--- a/drivers/staging/media/as102/as102_fe.c
+++ b/drivers/staging/media/as102/as102_fe.c
@@ -46,7 +46,8 @@ static int as102_fe_set_frontend(struct dvb_frontend *fe)
/* send abilis command: SET_TUNE */
ret =  as10x_cmd_set_tune(dev-bus_adap, tune_args);
if (ret != 0)
-   dprintk(debug, as10x_cmd_set_tune failed. (err = %d)\n, ret);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   as10x_cmd_set_tune failed. (err = %d)\n, ret);
 
mutex_unlock(dev-bus_adap.lock);
 
@@ -82,10 +83,17 @@ static int as102_fe_get_tune_settings(struct dvb_frontend 
*fe,
struct dvb_frontend_tune_settings *settings) {
 
 #if 0
-   dprintk(debug, step_size= %d\n, settings-step_size);
-   dprintk(debug, max_drift= %d\n, settings-max_drift);
-   dprintk(debug, min_delay_ms = %d - %d\n, settings-min_delay_ms,
-   1000);
+   struct as102_dev_t *dev;
+
+   dev = (struct as102_dev_t *) fe-tuner_priv;
+   if (dev == NULL)
+   return -EINVAL;
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   step_size= %d\n, settings-step_size);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   max_drift= %d\n, settings-max_drift);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   min_delay_ms = %d - %d\n, settings-min_delay_ms, 1000);
 #endif
 
settings

[PATCHv3] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-08-04 Thread Martin Kepplinger
remove dprintk() and replace it with dev_dbg() or pr_debug()
in order to use the common kernel coding style.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
Thanks for looking at it. So this doesn't add anything and actually does
what it says. If I haven't understood what you meant, or if I should try
to add struct_device info, I'll look again in a few hours.

 drivers/staging/media/as102/as102_drv.c |   15 +-
 drivers/staging/media/as102/as102_drv.h |7 -
 drivers/staging/media/as102/as102_fe.c  |   25 +++-
 drivers/staging/media/as102/as102_usb_drv.c |   41 ---
 4 files changed, 41 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/media/as102/as102_drv.c 
b/drivers/staging/media/as102/as102_drv.c
index 09d64cd..e0ee618 100644
--- a/drivers/staging/media/as102/as102_drv.c
+++ b/drivers/staging/media/as102/as102_drv.c
@@ -31,10 +31,6 @@
 #include as102_fw.h
 #include dvbdev.h
 
-int as102_debug;
-module_param_named(debug, as102_debug, int, 0644);
-MODULE_PARM_DESC(debug, Turn on/off debugging (default: off));
-
 int dual_tuner;
 module_param_named(dual_tuner, dual_tuner, int, 0644);
 MODULE_PARM_DESC(dual_tuner, Activate Dual-Tuner config (default: off));
@@ -74,7 +70,8 @@ static void as102_stop_stream(struct as102_dev_t *dev)
return;
 
if (as10x_cmd_stop_streaming(bus_adap)  0)
-   dprintk(debug, as10x_cmd_stop_streaming failed\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   as10x_cmd_stop_streaming failed\n);
 
mutex_unlock(dev-bus_adap.lock);
}
@@ -112,14 +109,16 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
int ret = -EFAULT;
 
if (mutex_lock_interruptible(dev-bus_adap.lock)) {
-   dprintk(debug, mutex_lock_interruptible(lock) failed !\n);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   amutex_lock_interruptible(lock) failed !\n);
return -EBUSY;
}
 
switch (onoff) {
case 0:
ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) pid);
-   dprintk(debug, DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n,
index, pid, ret);
break;
case 1:
@@ -131,7 +130,7 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
filter.pid = pid;
 
ret = as10x_cmd_add_PID_filter(bus_adap, filter);
-   dprintk(debug,
+   dev_dbg(dev-bus_adap.usb_dev-dev,
ADD_PID_FILTER([%02d - %02d], 0x%04x) ret = %d\n,
index, filter.idx, filter.pid, ret);
break;
diff --git a/drivers/staging/media/as102/as102_drv.h 
b/drivers/staging/media/as102/as102_drv.h
index a06837d..49d0c42 100644
--- a/drivers/staging/media/as102/as102_drv.h
+++ b/drivers/staging/media/as102/as102_drv.h
@@ -27,17 +27,10 @@
 #define DRIVER_FULL_NAME Abilis Systems as10x usb driver
 #define DRIVER_NAME as10x_usb
 
-extern int as102_debug;
 #define debug  as102_debug
 extern struct usb_driver as102_usb_driver;
 extern int elna_enable;
 
-#define dprintk(debug, args...) \
-   do { if (debug) {   \
-   pr_debug(%s: , __func__); \
-   printk(args);   \
-   } } while (0)
-
 #define AS102_DEVICE_MAJOR 192
 
 #define AS102_USB_BUF_SIZE 512
diff --git a/drivers/staging/media/as102/as102_fe.c 
b/drivers/staging/media/as102/as102_fe.c
index b686b76..67e55b8 100644
--- a/drivers/staging/media/as102/as102_fe.c
+++ b/drivers/staging/media/as102/as102_fe.c
@@ -46,7 +46,8 @@ static int as102_fe_set_frontend(struct dvb_frontend *fe)
/* send abilis command: SET_TUNE */
ret =  as10x_cmd_set_tune(dev-bus_adap, tune_args);
if (ret != 0)
-   dprintk(debug, as10x_cmd_set_tune failed. (err = %d)\n, ret);
+   dev_dbg(dev-bus_adap.usb_dev-dev,
+   as10x_cmd_set_tune failed. (err = %d)\n, ret);
 
mutex_unlock(dev-bus_adap.lock);
 
@@ -81,13 +82,6 @@ static int as102_fe_get_frontend(struct dvb_frontend *fe)
 static int as102_fe_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings *settings) {
 
-#if 0
-   dprintk(debug, step_size= %d\n, settings-step_size);
-   dprintk(debug, max_drift= %d\n, settings-max_drift);
-   dprintk(debug, min_delay_ms = %d - %d\n, settings-min_delay_ms,
-   1000);
-#endif
-
settings-min_delay_ms = 1000;
 
return 0;
@@ -110,7 +104,8 @@ static int as102_fe_read_status(struct dvb_frontend *fe, 
fe_status_t *status)
/* send abilis command: GET_TUNE_STATUS */
ret = as10x_cmd_get_tune_status(dev-bus_adap, tstate);
if (ret  0

Re: [BUG] rc1 rc2 rc3 not bootable - black screen after kernel loading

2014-07-24 Thread Martin Kepplinger
Am 2014-06-30 12:39, schrieb Martin Kepplinger:
 back to aaeb2554337217dfa4eac2fcc90da7be540b9a73 as the first bad
 commit. why is this not revertable exactly? how can I show a complete
 list of commits this merge introduces?
 

It seems that _nobody_ is running a simple 32 bit i915 (acer) laptop.
rc6 is still unusable. Black screen directly after kernel-loading. no
change since rc1.

Seems like I won't be able to use 3.16. I'm happy to test patches and am
happy for any advice what to do, when time permits.

 martin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] rc1 rc2 rc3 not bootable - black screen after kernel loading

2014-07-25 Thread Martin Kepplinger
Am 2014-07-25 01:20, schrieb Hugh Dickins:
 On Thu, 24 Jul 2014, Martin Kepplinger wrote:
 Am 2014-06-30 12:39, schrieb Martin Kepplinger:
 back to aaeb2554337217dfa4eac2fcc90da7be540b9a73 as the first bad
 commit. why is this not revertable exactly? how can I show a complete
 list of commits this merge introduces?


 It seems that _nobody_ is running a simple 32 bit i915 (acer) laptop.
 rc6 is still unusable. Black screen directly after kernel-loading. no
 change since rc1.

 Seems like I won't be able to use 3.16. I'm happy to test patches and am
 happy for any advice what to do, when time permits.
 
 Martin, I know nothing about aaeb25543372 and why it should be relevant,
 but if you're having rc1..rc6 32-bit i915 black screens, please try this
 patch that Daniel Vetter put in his fixes queue on Monday, which I'm
 hoping will reach Linus for -rc7.
 
 Hugh
 
 [PATCH] drm/i915: fix freeze with blank screen booting highmem
 
 x86_64 boots and displays fine, but booting x86_32 with CONFIG_HIGHMEM
 has frozen with a blank screen throughout 3.16-rc on this ThinkPad T420s,
 with i915 generation 6 graphics.
 
 Fix 9d0a6fa6c5e6 (drm/i915: add render state initialization): kunmap()
 takes struct page * argument, not virtual address.  Which the compiler
 kindly points out, if you use the appropriate u32 *batch, instead of
 silencing it with a void *.
 
 Why did bisection lead decisively to nearby 229b0489aa75 (drm/i915:
 add null render states for gen6, gen7 and gen8)?  Because the u32
 deposited at that virtual address by the previous stub failed the
 PageHighMem test, and so caused no harm.
 
 Signed-off-by: Hugh Dickins hu...@google.com
 ---
 
  drivers/gpu/drm/i915/i915_gem_render_state.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 --- 3.16-rc/drivers/gpu/drm/i915/i915_gem_render_state.c  2014-06-16 
 00:28:52.384076465 -0700
 +++ linux/drivers/gpu/drm/i915/i915_gem_render_state.c2014-07-21 
 20:10:03.824481521 -0700
 @@ -31,7 +31,7 @@
  struct i915_render_state {
   struct drm_i915_gem_object *obj;
   unsigned long ggtt_offset;
 - void *batch;
 + u32 *batch;
   u32 size;
   u32 len;
  };
 @@ -80,7 +80,7 @@ free:
  
  static void render_state_free(struct i915_render_state *so)
  {
 - kunmap(so-batch);
 + kunmap(kmap_to_page(so-batch));
   i915_gem_object_ggtt_unpin(so-obj);
   drm_gem_object_unreference(so-obj-base);
   kfree(so);
 

yes! thanks Hugh. On top of linus' current tree, that finally fixes my
problem! I hope it'll be included soon!

  martin

p.s. linux-media removed from thread
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix log message about future removal of interface

2014-07-26 Thread Martin Kepplinger
If this is going away, it won't be in 2012.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
This just looked a little odd in the logs. Feel free to ignore or act
upon it differently. This applies to -next as well.

 drivers/platform/x86/acer-wmi.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index bbf78b2..cf2dda2 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1658,7 +1658,7 @@ static ssize_t show_bool_threeg(struct device *dev,
u32 result; \
acpi_status status;
 
-   pr_info(This threeg sysfs will be removed in 2012 - used by: %s\n,
+   pr_info(This threeg sysfs will be removed in 2014 - used by: %s\n,
current-comm);
status = get_u32(result, ACER_CAP_THREEG);
if (ACPI_SUCCESS(status))
@@ -1671,7 +1671,7 @@ static ssize_t set_bool_threeg(struct device *dev,
 {
u32 tmp = simple_strtoul(buf, NULL, 10);
acpi_status status = set_u32(tmp, ACER_CAP_THREEG);
-   pr_info(This threeg sysfs will be removed in 2012 - used by: %s\n,
+   pr_info(This threeg sysfs will be removed in 2014 - used by: %s\n,
current-comm);
if (ACPI_FAILURE(status))
return -EINVAL;
@@ -1683,7 +1683,7 @@ static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, 
show_bool_threeg,
 static ssize_t show_interface(struct device *dev, struct device_attribute 
*attr,
char *buf)
 {
-   pr_info(This interface sysfs will be removed in 2012 - used by: %s\n,
+   pr_info(This interface sysfs will be removed in 2014 - used by: %s\n,
current-comm);
switch (interface-type) {
case ACER_AMW0:
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2] staging: rtl8192u: checkpatch: do not use C99 // comments

2014-08-10 Thread Martin Kepplinger
Use the common kernel coding style, so don't use C99 // comments
in r8192U_core.c If too long, where reasonable, they are shortened
as well.

Some old internal comments about date and author of changes are
removed.

This provides a more consistent view and hopefully encourages to
look at it.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
Yes, there were changes in the meantime. This applies to -next20140808
and builds. thanks.

 drivers/staging/rtl8192u/r8192U_core.c |  757 +---
 1 file changed, 408 insertions(+), 349 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 7640386..f97019d 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -87,7 +87,7 @@ double __extendsfdf2(float a)
 #include r8190_rtl8256.h /* RTL8225 Radio frontend */
 #include r8180_93cx6.h   /* Card EEPROM */
 #include r8192U_wx.h
-#include r819xU_phy.h //added by WB 4.30.2008
+#include r819xU_phy.h
 #include r819xU_phyreg.h
 #include r819xU_cmdpkt.h
 #include r8192U_dm.h
@@ -95,13 +95,13 @@ double __extendsfdf2(float a)
 #include linux/slab.h
 #include linux/proc_fs.h
 #include linux/seq_file.h
-// FIXME: check if 2.6.7 is ok
+/* FIXME: check if 2.6.7 is ok */
 
 #include dot11d.h
-//set here to open your trace code. //WB
+/* set here to open your trace code. */
 u32 rt_global_debug_component = COMP_DOWN  |
COMP_SEC|
-   COMP_ERR; //always open err flags on
+   COMP_ERR; /* always open err flags on */
 
 #define TOTAL_CAM_ENTRY 32
 #define CAM_CONTENT_COUNT 8
@@ -132,7 +132,7 @@ MODULE_DEVICE_TABLE(usb, rtl8192_usb_id_tbl);
 MODULE_DESCRIPTION(Linux driver for Realtek RTL8192 USB WiFi cards);
 
 static char *ifname = wlan%d;
-static int hwwep = 1;  //default use hw. set 0 to use software security
+static int hwwep = 1;  /* default use hw. set 0 to use software security */
 static int channels = 0x3fff;
 
 
@@ -166,17 +166,17 @@ typedef struct _CHANNEL_LIST {
 } CHANNEL_LIST, *PCHANNEL_LIST;
 
 static CHANNEL_LIST ChannelPlan[] = {
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64, 
149, 153, 157, 161, 165}, 24}, //FCC
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11},  
//IC
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 
60, 64}, 21},  //ETSI
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},//Spain. Change 
to ETSI.
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},  //France. 
Change to ETSI.
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  //MKK   //MKK
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},//MKK1
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},  //Israel.
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  // For 11a , TELEC
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},//MIC
-   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 14}   
//For Global Domain. 1-11:active scan, 12-14 passive scan. 
//+YJ, 080626
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64, 
149, 153, 157, 161, 165}, 24}, /* FCC */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11},  
/* IC */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 
60, 64}, 21},  /* ETSI */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},  /* Spain. 
Change to ETSI. */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},  /* France. 
Change to ETSI. */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  /* MKK */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  /* MKK1 */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},  /* Israel. */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  /* For 11a , TELEC */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  /* MIC */
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 14}   /* For Global 
Domain. 1-11:active scan, 12-14 passive scan.*/
 };
 
 static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv)
@@ -196,7 +196,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct 
r8192_priv *priv)
case COUNTRY_CODE_MIC:
Dot11d_Init(ieee);
ieee-bGlobalDomain = false;
-   //actually 8225  8256 rf chips only support B,G,24N mode
+   /* actually

Re: [PATCH] misc: always assign miscdevice to file-private_data in open()

2014-10-16 Thread Martin Kepplinger
Am 2014-10-09 17:50, schrieb Greg KH:
 On Thu, Oct 09, 2014 at 03:10:21PM +0200, Martin Kepplinger wrote:
 Am 2014-10-08 15:43, schrieb Greg KH:
 On Wed, Oct 08, 2014 at 10:47:54AM +0200, Martin Kepplinger wrote:
 As of now, a miscdevice driver has to provide an implementation of
 the open() file operation if it wants to have misc_open() assign a
 pointer to struct miscdevice to file-private_data for other file
 operations to use (given the user calls open()).

 This leads to situations where a miscdevice driver that doesn't need
 internal operations during open() has to implement open() that only
 returns immediately, in order to use the data in private_data in other
 fops.

 Yeah, that's messy, do we have any in-kernel misc drivers that do this?

yes, at least drivers/video/fbdev/pxa3xx-gcu.c , maybe more and I don't
know if others do the work theirselves.

An audit if changing to always-set-private_data breaks drivers should be
doable in a reasonable timeframe. I don't think there would be a
problem; it'd be good if others take a look aswell though.


 This change provides consistent behaviour for miscdevice developers by
 always providing the pointer in private_data. A driver's open() fop would,
 of course, just overwrite it, when using private_data itself.

 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
 This is really only a question: Do I understand this correctly, and,
 could this change then hurt any existing driver?

 I don't know, take a look at the existing ones and see please.

 As a driver developer it took me a while to figure out what happens here,
 and in my situation it would have been nice to just have this feature as
 part of the miscdevice API. Possibly documented somewhere?

 Patches always accepted for documentation :)

 What would be a good place for this?
 Documentation/driver-model/device.txt or
 Documentation/filesystem/vfs.txt like so? I'm not sure.
 
 There's no documentation for misc devices?  If not, just put it in
 kerneldoc format in the misc .c file.
 
 From facd10cfa7539755e960dec8cc009934200e68ec Mon Sep 17 00:00:00 2001
 From: Martin Kepplinger mart...@posteo.de
 Date: Thu, 9 Oct 2014 14:54:28 +0200
 Subject: [PATCH] documentation: misc_open sets private_data for driver's
  open()

 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
  Documentation/filesystems/vfs.txt |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

 diff --git a/Documentation/filesystems/vfs.txt
 b/Documentation/filesystems/vfs.txt
 index 61d65cc..06df9d9 100644
 --- a/Documentation/filesystems/vfs.txt
 +++ b/Documentation/filesystems/vfs.txt
 @@ -869,7 +869,8 @@ otherwise noted.
  done the way it is because it makes filesystems simpler to
  implement. The open() method is a good place to initialize the
  private_data member in the file structure if you want to point
 -to a device structure
 +to a device structure. In the case of struct miscdevice, when
 +you implement open() this is done automatically.
 
 No, no one will notice this in the vfs.txt file, and the vfs doesn't
 care about misc devices.
 
 misc_open() is called in any case, on open(). As long as miscdevice drivers
 don't explicitly rely on private_data being NULL exactly IF they don't
 implement an open() fop (which I wouldn't imagine), this would make things
 even more convenient.

 I agree, but it would be great if you can audit the existing misc
 drivers to ensure we don't break anything with this change.  Can you do
 that please?


 I would grep -r struct miscdevice ./drivers/; and look at struct
 file_operations of these results, see how their open() looks like, and
 where they assign something to private_data.

 If you have an idea for a script that lists all relevant files for me,
 please tell me.
 
 You just came up with one there, that should be a good start.
 
 good luck,
 
 greg k-h
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] misc: always assign miscdevice to file-private_data in open()

2014-10-18 Thread Martin Kepplinger
Am 2014-10-09 17:50, schrieb Greg KH:
 On Thu, Oct 09, 2014 at 03:10:21PM +0200, Martin Kepplinger wrote:
 Am 2014-10-08 15:43, schrieb Greg KH:
 On Wed, Oct 08, 2014 at 10:47:54AM +0200, Martin Kepplinger wrote:
 As of now, a miscdevice driver has to provide an implementation of
 the open() file operation if it wants to have misc_open() assign a
 pointer to struct miscdevice to file-private_data for other file
 operations to use (given the user calls open()).

 This leads to situations where a miscdevice driver that doesn't need
 internal operations during open() has to implement open() that only
 returns immediately, in order to use the data in private_data in other
 fops.

 Yeah, that's messy, do we have any in-kernel misc drivers that do this?

 This change provides consistent behaviour for miscdevice developers by
 always providing the pointer in private_data. A driver's open() fop would,
 of course, just overwrite it, when using private_data itself.

 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
 This is really only a question: Do I understand this correctly, and,
 could this change then hurt any existing driver?

 I don't know, take a look at the existing ones and see please.

 As a driver developer it took me a while to figure out what happens here,
 and in my situation it would have been nice to just have this feature as
 part of the miscdevice API. Possibly documented somewhere?

 Patches always accepted for documentation :)

 What would be a good place for this?
 Documentation/driver-model/device.txt or
 Documentation/filesystem/vfs.txt like so? I'm not sure.
 
 There's no documentation for misc devices?  If not, just put it in
 kerneldoc format in the misc .c file.
 
 From facd10cfa7539755e960dec8cc009934200e68ec Mon Sep 17 00:00:00 2001
 From: Martin Kepplinger mart...@posteo.de
 Date: Thu, 9 Oct 2014 14:54:28 +0200
 Subject: [PATCH] documentation: misc_open sets private_data for driver's
  open()

 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
  Documentation/filesystems/vfs.txt |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

 diff --git a/Documentation/filesystems/vfs.txt
 b/Documentation/filesystems/vfs.txt
 index 61d65cc..06df9d9 100644
 --- a/Documentation/filesystems/vfs.txt
 +++ b/Documentation/filesystems/vfs.txt
 @@ -869,7 +869,8 @@ otherwise noted.
  done the way it is because it makes filesystems simpler to
  implement. The open() method is a good place to initialize the
  private_data member in the file structure if you want to point
 -to a device structure
 +to a device structure. In the case of struct miscdevice, when
 +you implement open() this is done automatically.
 
 No, no one will notice this in the vfs.txt file, and the vfs doesn't
 care about misc devices.
 
 misc_open() is called in any case, on open(). As long as miscdevice drivers
 don't explicitly rely on private_data being NULL exactly IF they don't
 implement an open() fop (which I wouldn't imagine), this would make things
 even more convenient.

 I agree, but it would be great if you can audit the existing misc
 drivers to ensure we don't break anything with this change.  Can you do
 that please?


applying said change to misc_open() core and removing open() from
video/fbdev/pxa3xx-gcu.c generates these warnings that I, at the moment,
don't fully understand. Do you konw what happens here?

In file included from arch/x86/vdso/vdso2c.c:161:0:
arch/x86/vdso/vdso2c.c: In function ‘main’:
arch/x86/vdso/vdso2c.h:118:6: warning: assuming signed overflow does not
occur when assuming that (X + c)  X is always false [-Wstrict-overflow]
In file included from arch/x86/vdso/vdso2c.c:165:0:
arch/x86/vdso/vdso2c.h:118:6: warning: assuming signed overflow does not
occur when assuming that (X + c)  X is always false [-Wstrict-overflow]


 I would grep -r struct miscdevice ./drivers/; and look at struct
 file_operations of these results, see how their open() looks like, and
 where they assign something to private_data.

 If you have an idea for a script that lists all relevant files for me,
 please tell me.
 
 You just came up with one there, that should be a good start.
 
 good luck,
 
 greg k-h
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


lguest: lguest_user.c is open() called by the user?

2014-10-18 Thread Martin Kepplinger
hi

Just a question for understanding: open() is not implemented in
lguest_user.c's miscdevice. The miscdevice core, in this case, does
_not_ set file-private_data on a user's open() call. Is open() called
by the user here? and do you here _depend_ on file-private_data being
NULL after open()? (could you even?)

Would the following force to NULL be necessary if the miscdevice core
_would_ set private_data?


diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 4263f4c..3d472ea 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -497,6 +497,12 @@ static int close(struct inode *inode, struct file
*file)
return 0;
 }

+static int open(struct inode *inode, struct file *file)
+{
+   /* assuming the miscdevice core sets private_data on open() */
+   file-private_data = NULL;
+}
+
 /*L:000
  * Welcome to our journey through the Launcher!
  *
@@ -514,6 +520,7 @@ static int close(struct inode *inode, struct file *file)
  */
 static const struct file_operations lguest_fops = {
.owner   = THIS_MODULE,
+   .open= open,
.release = close,
.write   = write,
.read= read,
-- 

thanks
   martin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] lguest: force file-private_data to be NULL on open()

2014-10-18 Thread Martin Kepplinger
if we depend on private_data being NULL in write() before initialize()
make sure it is NULL after open().

Signed-off-by: Martin Kepplinger mart...@posteo.de
---

I'm not completely sure if this patch is needed and am still investigating.
What do you think? open() could be called by the user I guess. Does
lguest_user.c depend on private_data being NULL on a first write()?


 drivers/lguest/lguest_user.c |7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 4263f4c..30251b7 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -497,6 +497,12 @@ static int close(struct inode *inode, struct file *file)
return 0;
 }
 
+static int open(struct inode *inode, struct file *file)
+{
+   /* the miscdevice core sets private_data on open() */
+   file-private_data = NULL;
+}
+
 /*L:000
  * Welcome to our journey through the Launcher!
  *
@@ -514,6 +520,7 @@ static int close(struct inode *inode, struct file *file)
  */
 static const struct file_operations lguest_fops = {
.owner   = THIS_MODULE,
+   .open= open,
.release = close,
.write   = write,
.read= read,
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] misc: always assign miscdevice to file-private_data in open()

2014-10-18 Thread Martin Kepplinger
As of now, a miscdevice driver has to provide an implementation of
the open() file operation if it wants to have misc_open() assign a
pointer to struct miscdevice to file-private_data for other file
operations to use (given the user calls open()).

This leads to situations where a miscdevice driver that doesn't need
internal operations during open() has to implement open() that only
returns immediately, in order to use the data in private_data in other
fops.

This provides consistent behaviour for miscdevice developers and will
always provide the pointer in private_data. A driver's open() fop would,
of course, just overwrite it, when using private_data itself.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---

The mentioned warning is appearently unrelated here, and happens on mainline
v3.17 awell -.- sorry for the confusion.

This applies to 3.17 and is a call for review and opinions. Especially on
the followup patches.


 drivers/char/misc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index ffa97d2..205ad4c 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -142,8 +142,8 @@ static int misc_open(struct inode * inode, struct file * 
file)
 
err = 0;
replace_fops(file, new_fops);
+   file-private_data = c;
if (file-f_op-open) {
-   file-private_data = c;
err = file-f_op-open(inode,file);
}
 fail:
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] fbdev: pxa3xx-gcu: remove redundant implementation of open()

2014-10-18 Thread Martin Kepplinger
the miscdevice core now does the work in any case.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/video/fbdev/pxa3xx-gcu.c |   10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 4df3657..7678a94 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -373,15 +373,6 @@ static inline struct pxa3xx_gcu_priv 
*to_pxa3xx_gcu_priv(struct file *file)
return container_of(dev, struct pxa3xx_gcu_priv, misc_dev);
 }
 
-/*
- * provide an empty .open callback, so the core sets file-private_data
- * for us.
- */
-static int pxa3xx_gcu_open(struct inode *inode, struct file *file)
-{
-   return 0;
-}
-
 static ssize_t
 pxa3xx_gcu_write(struct file *file, const char *buff,
 size_t count, loff_t *offp)
@@ -580,7 +571,6 @@ pxa3xx_gcu_free_buffers(struct device *dev,
 
 static const struct file_operations pxa3xx_gcu_miscdev_fops = {
.owner =THIS_MODULE,
-   .open = pxa3xx_gcu_open,
.write =pxa3xx_gcu_write,
.unlocked_ioctl =   pxa3xx_gcu_ioctl,
.mmap = pxa3xx_gcu_mmap,
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] lguest: force file-private_data to be NULL on open()

2014-10-20 Thread Martin Kepplinger
Am 2014-10-19 02:31, schrieb Martin Kepplinger:
 if we depend on private_data being NULL in write() before initialize()
 make sure it is NULL after open().
 
 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
 
 I'm not completely sure if this patch is needed and am still investigating.
 What do you think? open() could be called by the user I guess. Does
 lguest_user.c depend on private_data being NULL on a first write()?
 
 

Could it be that this patch is not needed indeed or did I ask not clear
enough here and caused a misunderstanding:


 Martin Kepplinger mart...@posteo.de writes:
 hi

 Just a question for understanding: open() is not implemented in
 lguest_user.c's miscdevice. The miscdevice core, in this case, does
 _not_ set file-private_data on a user's open() call. Is open() called
 by the user here? and do you here _depend_ on file-private_data being
 NULL after open()? (could you even?)

 Would the following force to NULL be necessary if the miscdevice core
 _would_ set private_data?

 Hi Martin!

 Yes, the private_data is NULL on a new file.  See
 get_empty_filp in fs/file_table.c, which does kmem_cache_zalloc
 (zeroing all the contents).

 So this isn't necessary here.

 Thanks!
 Rusty.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] rtl8192u: remove typedef

2014-09-07 Thread Martin Kepplinger
remove a typedef that is not even really used.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
builds in next-20140905.

 drivers/staging/rtl8192u/r8192U_core.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 3707d03..a4e1d6b 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -137,12 +137,12 @@ static struct usb_driver rtl8192_usb_driver = {
 };
 
 
-typedef struct _CHANNEL_LIST {
+struct CHANNEL_LIST {
u8  Channel[32];
u8  Len;
-} CHANNEL_LIST, *PCHANNEL_LIST;
+};
 
-static CHANNEL_LIST ChannelPlan[] = {
+static struct CHANNEL_LIST ChannelPlan[] = {
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64, 
149, 153, 157, 161, 165}, 24}, //FCC
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11},  
//IC
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 
60, 64}, 21},  //ETSI
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] misc: always assign miscdevice to file-private_data in open()

2014-10-08 Thread Martin Kepplinger
As of now, a miscdevice driver has to provide an implementation of
the open() file operation if it wants to have misc_open() assign a
pointer to struct miscdevice to file-private_data for other file
operations to use (given the user calls open()).

This leads to situations where a miscdevice driver that doesn't need
internal operations during open() has to implement open() that only
returns immediately, in order to use the data in private_data in other
fops.

This change provides consistent behaviour for miscdevice developers by
always providing the pointer in private_data. A driver's open() fop would,
of course, just overwrite it, when using private_data itself.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
This is really only a question: Do I understand this correctly, and,
could this change then hurt any existing driver?
As a driver developer it took me a while to figure out what happens here,
and in my situation it would have been nice to just have this feature as
part of the miscdevice API. Possibly documented somewhere?

misc_open() is called in any case, on open(). As long as miscdevice drivers
don't explicitly rely on private_data being NULL exactly IF they don't
implement an open() fop (which I wouldn't imagine), this would make things
even more convenient.

 drivers/char/misc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index ffa97d2..205ad4c 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -142,8 +142,8 @@ static int misc_open(struct inode * inode, struct file * 
file)
 
err = 0;
replace_fops(file, new_fops);
+   file-private_data = c;
if (file-f_op-open) {
-   file-private_data = c;
err = file-f_op-open(inode,file);
}
 fail:
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] misc: always assign miscdevice to file-private_data in open()

2014-10-09 Thread Martin Kepplinger
Am 2014-10-08 15:43, schrieb Greg KH:
 On Wed, Oct 08, 2014 at 10:47:54AM +0200, Martin Kepplinger wrote:
 As of now, a miscdevice driver has to provide an implementation of
 the open() file operation if it wants to have misc_open() assign a
 pointer to struct miscdevice to file-private_data for other file
 operations to use (given the user calls open()).

 This leads to situations where a miscdevice driver that doesn't need
 internal operations during open() has to implement open() that only
 returns immediately, in order to use the data in private_data in other
 fops.
 
 Yeah, that's messy, do we have any in-kernel misc drivers that do this?
 
 This change provides consistent behaviour for miscdevice developers by
 always providing the pointer in private_data. A driver's open() fop would,
 of course, just overwrite it, when using private_data itself.

 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
 This is really only a question: Do I understand this correctly, and,
 could this change then hurt any existing driver?
 
 I don't know, take a look at the existing ones and see please.
 
 As a driver developer it took me a while to figure out what happens here,
 and in my situation it would have been nice to just have this feature as
 part of the miscdevice API. Possibly documented somewhere?
 
 Patches always accepted for documentation :)

What would be a good place for this?
Documentation/driver-model/device.txt or
Documentation/filesystem/vfs.txt like so? I'm not sure.

From facd10cfa7539755e960dec8cc009934200e68ec Mon Sep 17 00:00:00 2001
From: Martin Kepplinger mart...@posteo.de
Date: Thu, 9 Oct 2014 14:54:28 +0200
Subject: [PATCH] documentation: misc_open sets private_data for driver's
 open()

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 Documentation/filesystems/vfs.txt |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/filesystems/vfs.txt
b/Documentation/filesystems/vfs.txt
index 61d65cc..06df9d9 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -869,7 +869,8 @@ otherwise noted.
done the way it is because it makes filesystems simpler to
implement. The open() method is a good place to initialize the
private_data member in the file structure if you want to point
-   to a device structure
+   to a device structure. In the case of struct miscdevice, when
+   you implement open() this is done automatically.

   flush: called by the close(2) system call to flush a file

-- 
1.7.10.4


 
 misc_open() is called in any case, on open(). As long as miscdevice drivers
 don't explicitly rely on private_data being NULL exactly IF they don't
 implement an open() fop (which I wouldn't imagine), this would make things
 even more convenient.
 
 I agree, but it would be great if you can audit the existing misc
 drivers to ensure we don't break anything with this change.  Can you do
 that please?
 

I would grep -r struct miscdevice ./drivers/; and look at struct
file_operations of these results, see how their open() looks like, and
where they assign something to private_data.

If you have an idea for a script that lists all relevant files for me,
please tell me.

I queue this up but can't tell at all when it actually gets scheduled in ;)

I guess some do this work on their own because they don't know that
misc_open() already does it for them. It would probably be too much to
check what drivers could then just drop their open(). Interesting though
;) But in the short term, I think the appended documentation would help.

  martin

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] char: documentation: more useful information about misc device

2014-10-09 Thread Martin Kepplinger
This might prevent code duplication in the future.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
This is a suggestion for a place to put this information. I think this
makes sense but there might be a more appropriate place elsewhere.

 drivers/char/misc.c |4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index ffa97d2..6a3d15b 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -171,6 +171,10 @@ static const struct file_operations misc_fops = {
  * The structure passed is linked into the kernel and may not be
  * destroyed until it has been unregistered.
  *
+ * If struct miscdevice's fops contain an implementation of open()
+ * the struct file's private data will be a pointer back to
+ * struct miscdevice.
+ *
  * A zero is returned on success and a negative errno code for
  * failure.
  */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] misc: always assign miscdevice to file-private_data in open()

2014-10-29 Thread Martin Kepplinger
As of now, a miscdevice driver has to provide an implementation of
the open() file operation if it wants to have misc_open() assign a
pointer to struct miscdevice to file-private_data for other file
operations to use (given the user calls open()).

This leads to situations where a miscdevice driver that doesn't need
internal operations during open() has to implement open() that only
returns immediately, in order to use the data in private_data in other
fops.

This provides consistent behaviour for miscdevice developers and will
always provide the pointer in private_data. A driver's open() fop would,
of course, just overwrite it, when using private_data itself.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/char/misc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index ffa97d2..205ad4c 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -142,8 +142,8 @@ static int misc_open(struct inode * inode, struct file * 
file)
 
err = 0;
replace_fops(file, new_fops);
+   file-private_data = c;
if (file-f_op-open) {
-   file-private_data = c;
err = file-f_op-open(inode,file);
}
 fail:
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/3] char: misc: assign file-private_data to miscdevice on open

2014-10-29 Thread Martin Kepplinger
This slightly changes the behaviour of miscdevice drivers at an open()
syscall. Not only if the driver happens to implement an open() fop itself,
but now just always file-private_data points to struct miscdevice, when
a user opens the device file.

This call for review once more: if anybody has an hour to kill:

Look for the only dangerous situation where a miscdevice driver _depends_ on
file-private_data being NULL when _not_ implementing an open() routine
itself. I didn't find anything.

The one section I was unsure about should be ok, see
http://marc.info/?l=linux-kernelm=141376535132316w=2

Bonus: one could look for drivers that _do_ implement open()
and do the (in any case) redundant work themselves.

Martin Kepplinger (3):
  misc: always assign miscdevice to file-private_data in open()
  fbdev: pxa3xx-gcu: remove redundant implementation of open()
  char: misc: document behaviour of open()

 drivers/char/misc.c  |6 --
 drivers/video/fbdev/pxa3xx-gcu.c |   10 --
 2 files changed, 4 insertions(+), 12 deletions(-)

-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] fbdev: pxa3xx-gcu: remove redundant implementation of open()

2014-10-29 Thread Martin Kepplinger
the miscdevice core now does the work in any case.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/video/fbdev/pxa3xx-gcu.c |   10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 4df3657..7678a94 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -373,15 +373,6 @@ static inline struct pxa3xx_gcu_priv 
*to_pxa3xx_gcu_priv(struct file *file)
return container_of(dev, struct pxa3xx_gcu_priv, misc_dev);
 }
 
-/*
- * provide an empty .open callback, so the core sets file-private_data
- * for us.
- */
-static int pxa3xx_gcu_open(struct inode *inode, struct file *file)
-{
-   return 0;
-}
-
 static ssize_t
 pxa3xx_gcu_write(struct file *file, const char *buff,
 size_t count, loff_t *offp)
@@ -580,7 +571,6 @@ pxa3xx_gcu_free_buffers(struct device *dev,
 
 static const struct file_operations pxa3xx_gcu_miscdev_fops = {
.owner =THIS_MODULE,
-   .open = pxa3xx_gcu_open,
.write =pxa3xx_gcu_write,
.unlocked_ioctl =   pxa3xx_gcu_ioctl,
.mmap = pxa3xx_gcu_mmap,
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] char: misc: document behaviour of open()

2014-10-29 Thread Martin Kepplinger
an open syscall now assignes file-private_data to a pointer to the
miscdevice structure. This reminds driver developers not to duplicate
code if they need this.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/char/misc.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 205ad4c..69a08a6 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -169,7 +169,9 @@ static const struct file_operations misc_fops = {
  * the minor number requested is used.
  *
  * The structure passed is linked into the kernel and may not be
- * destroyed until it has been unregistered.
+ * destroyed until it has been unregistered. By default, an open()
+ * syscall to the device sets file-private_data to point to the
+ * structure.
  *
  * A zero is returned on success and a negative errno code for
  * failure.
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fuse: don't check for file-private_data on open().

2014-11-12 Thread Martin Kepplinger
The miscdevice core now sets file-private_data to the struct miscdevice
so don't fail when this is not NULL.

Reported-by: Thierry Reding thierry.red...@gmail.com
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
This is a question: what does this check provide and does overwriting
file-private_data make any difference?

Is open() by the user not allowed here, if file-private_data is set?

thanks!!

 fs/fuse/inode.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 03246cd..562407e 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1092,9 +1092,6 @@ static int fuse_fill_super(struct super_block *sb, void 
*data, int silent)
}
 
mutex_lock(fuse_mutex);
-   err = -EINVAL;
-   if (file-private_data)
-   goto err_unlock;
 
err = fuse_ctl_add_conn(fc);
if (err)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] btrfs: Don't check for file-private_data on open(). It is set by the core.

2014-11-12 Thread Martin Kepplinger
The miscdevice core now sets file-private_data to the struct miscdevice
so don't fail when this is not NULL.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
This is a question: what does this check provide and does overwriting
file-private_data make any difference?

Is miscdevice's open() by the user not allowed here, if file-private_data
is set?

thanks!!

 fs/btrfs/ioctl.c |4 
 1 file changed, 4 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 4399f0c..066ce41 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3752,10 +3752,6 @@ static long btrfs_ioctl_trans_start(struct file *file)
if (!capable(CAP_SYS_ADMIN))
goto out;
 
-   ret = -EINPROGRESS;
-   if (file-private_data)
-   goto out;
-
ret = -EROFS;
if (btrfs_root_readonly(root))
goto out;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fuse: don't check for file-private_data on open().

2014-11-12 Thread Martin Kepplinger
Am 2014-11-12 um 17:31 schrieb Martin Kepplinger:
 The miscdevice core now sets file-private_data to the struct miscdevice
 so don't fail when this is not NULL.
 
 Reported-by: Thierry Reding thierry.red...@gmail.com
 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
 This is a question: what does this check provide and does overwriting
 file-private_data make any difference?
 
 Is open() by the user not allowed here, if file-private_data is set?
 
 thanks!!
 

if ok, please add

Reported-by: Giedrius Statkevicius giedriusw...@gmail.com

thanks
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] btrfs: Don't check for file-private_data on open(). It is set by the core.

2014-11-12 Thread Martin Kepplinger
Am 2014-11-12 um 18:59 schrieb Chris Mason:
 On Wed, Nov 12, 2014 at 11:38 AM, Martin Kepplinger mart...@posteo.de
 wrote:
 The miscdevice core now sets file-private_data to the struct miscdevice
 so don't fail when this is not NULL.

 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
 This is a question: what does this check provide and does overwriting
 file-private_data make any difference?

 Is miscdevice's open() by the user not allowed here, if
 file-private_data
 is set?

 thanks!!
 
 Btrfs uses this in the transaction start ioctl to record the transaction
 handle being started.  Ceph is the main user of the ioctl, and we could
 setup a hash table if needed.  But which call path in miscdevice is
 doing this?
 
 With your patch in place, btrfs would end up overwriting the miscdevice
 private_data field, which would probably cause problems.
 
 -chris
 

I think i was mistaken, sorry. misc_open() used to set
file-private_data _only_ if you use set .open in struct file_operations.

In current -next this changed and file-private_data is set to struct
miscdevice on a (userspace's) open call (misc_open()) just in any case.

You do set .open so this wouldn't affect you and this patch can be ignored.

martin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fuse: Don't check for file-private_data on open(). It is set by the core.

2014-11-12 Thread Martin Kepplinger
The miscdevice core now sets file-private_data to the struct miscdevice
so don't fail when this is not NULL.

Reported-by: Giedrius Statkevicius giedriusw...@gmail.com
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
sorry, I can't read ;) Is this a fix for your problem (instead of the first
patch)?

in case of fuse_ctl_add_conn(fc) failing things should proceed as before.

 fs/fuse/inode.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 03246cd..a97a475 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1092,9 +1092,6 @@ static int fuse_fill_super(struct super_block *sb, void 
*data, int silent)
}
 
mutex_lock(fuse_mutex);
-   err = -EINVAL;
-   if (file-private_data)
-   goto err_unlock;
 
err = fuse_ctl_add_conn(fc);
if (err)
@@ -1117,6 +1114,7 @@ static int fuse_fill_super(struct super_block *sb, void 
*data, int silent)
return 0;
 
  err_unlock:
+   file-private_data = NULL;
mutex_unlock(fuse_mutex);
  err_free_init_req:
fuse_request_free(init_req);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fuse: don't check for file-private_data on open().

2014-11-13 Thread Martin Kepplinger
Am 13. November 2014 10:40:38 MEZ, schrieb Miklos Szeredi mik...@szeredi.hu:
On Wed, Nov 12, 2014 at 5:31 PM, Martin Kepplinger mart...@posteo.de
wrote:
 The miscdevice core now sets file-private_data to the struct
miscdevice
 so don't fail when this is not NULL.

Does it?  Look:

static int misc_open(struct inode * inode, struct file * file)
{
...
if (file-f_op-open) {
file-private_data = c;
err = file-f_op-open(inode,file);
}

It only sets -private_data if the device provides an open method.
Fuse doesn't, so it's not clear what this patch is trying to fix.

Thanks,
Miklos



 Reported-by: Thierry Reding thierry.red...@gmail.com
 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
 This is a question: what does this check provide and does overwriting
 file-private_data make any difference?

 Is open() by the user not allowed here, if file-private_data is set?

 thanks!!

  fs/fuse/inode.c |3 ---
  1 file changed, 3 deletions(-)

 diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
 index 03246cd..562407e 100644
 --- a/fs/fuse/inode.c
 +++ b/fs/fuse/inode.c
 @@ -1092,9 +1092,6 @@ static int fuse_fill_super(struct super_block
*sb, void *data, int silent)
 }

 mutex_lock(fuse_mutex);
 -   err = -EINVAL;
 -   if (file-private_data)
 -   goto err_unlock;

 err = fuse_ctl_add_conn(fc);
 if (err)
 --
 1.7.10.4


In this week's -next this should have changed. My SSD broke down so i have to 
delay further work for a few days, i'm sorry.
-- 
Martin Kepplinger
http://martinkepplinger.com
sent from mobile
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fuse: don't check for file-private_data on open().

2014-11-13 Thread Martin Kepplinger
Am 13. November 2014 11:53:29 MEZ, schrieb Miklos Szeredi mik...@szeredi.hu:
On Thu, Nov 13, 2014 at 11:05 AM, Martin Kepplinger mart...@posteo.de
wrote:

 In this week's -next this should have changed. My SSD broke down so i
have to delay further work for a few days, i'm sorry.

Please be more careful with such patches.  Have you audited all of the
(ca. 200) misc drivers?  If not, this might be a good time to do so.
If it turns out to be too much, then consider not doing the change.
The gain might not be worth the cost.

NACK in this form.

Thanks,
Miklos

Definitely should have been more careful as I checked fs too late now. I 
totally unnecessarily broke -next.

But If fuse-devel is ok with a fix like the one i sent (still has to get tested 
too) i believe we're covered. I still call for independent review though.
-- 
Martin Kepplinger
http://martinkepplinger.com
sent from mobile
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/6] bitops.h: add sign_extend16 function

2014-12-15 Thread Martin Kepplinger
This adds sign_exten16 to sign extend any signed value shorter than 16 bits
to a s16.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 include/linux/bitops.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 3c2a539..70190f4 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -172,6 +172,17 @@ static inline __s8 sign_extend8(__u8 value, int index)
 }
 
 /**
+ * sign_extend16 - sign extend a 16-bit value using specified bit as sign-bit
+ * @value: value to sign extend
+ * @index: 0 based bit index (0=index16) to sign bit
+ */
+static inline __s16 sign_extend16(__u16 value, int index)
+{
+   __u8 shift = 15 - index;
+   return (__s16)(value  shift)  shift;
+}
+
+/**
  * sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit
  * @value: value to sign extend
  * @index: 0 based bit index (0=index32) to sign bit
-- 
2.1.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 6/6] media: stb0899: use sign_extend8 instead of manual work

2014-12-15 Thread Martin Kepplinger
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/media/dvb-frontends/stb0899_algo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/stb0899_algo.c 
b/drivers/media/dvb-frontends/stb0899_algo.c
index 93596e0..7bbcfde 100644
--- a/drivers/media/dvb-frontends/stb0899_algo.c
+++ b/drivers/media/dvb-frontends/stb0899_algo.c
@@ -19,6 +19,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include linux/bitops.h
 #include stb0899_drv.h
 #include stb0899_priv.h
 #include stb0899_reg.h
@@ -1490,9 +1491,7 @@ enum stb0899_status stb0899_dvbs2_algo(struct 
stb0899_state *state)
/* Store signal parameters  */
offsetfreq = STB0899_READ_S2REG(STB0899_S2DEMOD, CRL_FREQ);
 
-   /* sign extend 30 bit value before using it in calculations */
-   if (offsetfreq  (1  29))
-   offsetfreq |= -1  30;
+   offsetfreq = sign_extend32(offset_freq, 29);
 
offsetfreq = offsetfreq / ((1  30) / 1000);
offsetfreq *= (internal-master_clk / 100);
-- 
2.1.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


add sign-extend functions for 8 and 16 bit values

2014-12-15 Thread Martin Kepplinger
In short: If you want the first 2 changes, please merge them and notify 
me.

This adds sign_extend8() and sign_extend16() for the quite many cases
where this is needed, like sign_extend32().

Sign-extending is done in a few different ways throughout the kernel
and most of them look not very beautiful, adding non-obvious constant
values. This would simplify things.

I append four example changes for existing drivers. I'm aware that you
are not resposible for these, but I'd post them to the relevant
maintainers only if you want to apply to bitops.h.

While I would definitely move on moving drivers over to this, when I find
them, I can't guarantee I'd change every sign-extension out there myself.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/6] input: gtco: use bitops' sign_extend8

2014-12-15 Thread Martin Kepplinger
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/input/tablet/gtco.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 8580456..25b3834 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -59,7 +59,7 @@ Scott Hill sh...@gtcocalcomp.com
 #include asm/uaccess.h
 #include asm/unaligned.h
 #include asm/byteorder.h
-
+#include linux/bitops.h
 
 #include linux/usb/input.h
 
@@ -666,13 +666,8 @@ static void gtco_urb_callback(struct urb *urbinfo)
case 4:
/* Tilt */
 
-   /* Sign extend these 7 bit numbers.  */
-   if (device-buffer[6]  0x40)
-   device-buffer[6] |= 0x80;
-
-   if (device-buffer[7]  0x40)
-   device-buffer[7] |= 0x80;
-
+   device-buffer[6] = sign_extend8(device-buffer[6], 6);
+   device-buffer[7] = sign_extend8(device-buffer[6], 6);
 
valsigned = (device-buffer[6]);
input_report_abs(inputdev, ABS_TILT_X, (s32)valsigned);
-- 
2.1.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/6] hwmon: jc42: use bitops' sign_extend16

2014-12-15 Thread Martin Kepplinger
---
 drivers/hwmon/jc42.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
index 388f8bc..335a2de 100644
--- a/drivers/hwmon/jc42.c
+++ b/drivers/hwmon/jc42.c
@@ -31,6 +31,7 @@
 #include linux/hwmon-sysfs.h
 #include linux/err.h
 #include linux/mutex.h
+#include linux/bitops.h
 
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = {
@@ -215,9 +216,7 @@ static int jc42_temp_from_reg(s16 reg)
 {
reg = 0x1fff;
 
-   /* sign extend register */
-   if (reg  0x1000)
-   reg |= 0xf000;
+   reg = sign_extend16(reg, 12);
 
/* convert from 0.0625 to 0.001 resolution */
return reg * 125 / 2;
-- 
2.1.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/6] bitops.h: add sign_extend8 function

2014-12-15 Thread Martin Kepplinger
This adds a helper function that extends any signed value smaller than
8 bits to a s8.

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 include/linux/bitops.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 5d858e0..3c2a539 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -161,6 +161,17 @@ static inline __u8 ror8(__u8 word, unsigned int shift)
 }
 
 /**
+ * sign_extend8 - sign extend a 8-bit value using specified bit as sign-bit
+ * @value: value to sign extend
+ * @index: 0 based bit index (0=index8) to sign bit
+ */
+static inline __s8 sign_extend8(__u8 value, int index)
+{
+   __u8 shift = 7 - index;
+   return (__s8)(value  shift)  shift;
+}
+
+/**
  * sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit
  * @value: value to sign extend
  * @index: 0 based bit index (0=index32) to sign bit
-- 
2.1.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/6] rtc: use sign_extend8 instead of manual conversion

2014-12-15 Thread Martin Kepplinger
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/rtc/rtc-x1205.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c
index b1de58e..3ec0b95 100644
--- a/drivers/rtc/rtc-x1205.c
+++ b/drivers/rtc/rtc-x1205.c
@@ -22,6 +22,7 @@
 #include linux/rtc.h
 #include linux/delay.h
 #include linux/module.h
+#include linux/bitops.h
 
 #define DRV_VERSION 1.0.8
 
@@ -366,8 +367,7 @@ static int x1205_get_atrim(struct i2c_client *client, int 
*trim)
 * perform sign extension. The formula is
 * Catr = (atr * 0.25pF) + 11.00pF.
 */
-   if (atr  0x20)
-   atr |= 0xC0;
+   atr = sign_extend8(atr, 5);
 
dev_dbg(client-dev, %s: raw atr=%x (%d)\n, __func__, atr, atr);
 
-- 
2.1.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] bitops.h: add sign_extend64() function

2014-12-15 Thread Martin Kepplinger
This adds sign_exten64 to sign extend any signed value shorter than 64 bits
to a s64.

Signed-off-by: Martin Kepplinger mart...@posteo.de
Suggested-by: Christoph Muellner christoph.muell...@theobroma-systems.com
---
Without looking for it's users yet: This applies on top of it's 8 and 16 bit
friends.

This reminded me of giving credit for the initial idea. At least in one patch
I'd like to have him mentioned.


 include/linux/bitops.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 70190f4..9c31680 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -193,6 +193,17 @@ static inline __s32 sign_extend32(__u32 value, int index)
return (__s32)(value  shift)  shift;
 }
 
+/**
+ * sign_extend64 - sign extend a 64-bit value using specified bit as sign-bit
+ * @value: value to sign extend
+ * @index: 0 based bit index (0=index64) to sign bit
+ */
+static inline __s64 sign_extend64(__u64 value, int index)
+{
+   __u8 shift = 63 - index;
+   return (__s64)(value  shift)  shift;
+}
+
 static inline unsigned fls_long(unsigned long l)
 {
if (sizeof(l) == 4)
-- 
2.1.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/6] bitops.h: add sign_extend16 function

2014-12-15 Thread Martin Kepplinger
Am 2014-12-15 um 17:18 schrieb Martin Kepplinger:
 This adds sign_exten16 to sign extend any signed value shorter than 16 bits
 to a s16.
 
 Signed-off-by: Martin Kepplinger mart...@posteo.de
 ---
if you feel motivated, you can add this to the commit message:

Suggested-by: Christoph Muellner christoph.muell...@theobroma-systems.com

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] bitops.h: add sign_extend64() function

2014-12-15 Thread Martin Kepplinger
Am 2014-12-15 um 18:54 schrieb Martin Kepplinger:
 This adds sign_exten64 to sign extend any signed value shorter than 64 bits
 to a s64.
I'm sorry for this typo: sign_extend64()

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/6] hwmon: jc42: use bitops' sign_extend16

2014-12-15 Thread Martin Kepplinger
Am 2014-12-15 um 22:29 schrieb Guenter Roeck:
 On Mon, Dec 15, 2014 at 05:18:34PM +0100, Martin Kepplinger wrote:
 ---
 
 Some description would be nice. Also, please consider adding
 relevant subsystem mailing lists and maintainers to your patches.
 

I shouldn't have added the Signed-off-by line to some of them. Sorry.

The driver-patches are meant to be examples of what can be changed if
the sign_extend functions are added. I don't know if they are taken and
planned to post the driver patches (probably more) thereafter, and of
course to the relevant people.

  drivers/hwmon/jc42.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

 diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
 index 388f8bc..335a2de 100644
 --- a/drivers/hwmon/jc42.c
 +++ b/drivers/hwmon/jc42.c
 @@ -31,6 +31,7 @@
  #include linux/hwmon-sysfs.h
  #include linux/err.h
  #include linux/mutex.h
 +#include linux/bitops.h
  
  /* Addresses to scan */
  static const unsigned short normal_i2c[] = {
 @@ -215,9 +216,7 @@ static int jc42_temp_from_reg(s16 reg)
  {
  reg = 0x1fff;
  
 If I understand the code in sign_extend16 correctly, the above mask
 should no longer be necessary.

exactly. The mask would then be shifting. Thanks!

 
 Thanks,
 Guenter
 
 -/* sign extend register */
 -if (reg  0x1000)
 -reg |= 0xf000;
 +reg = sign_extend16(reg, 12);
  
  /* convert from 0.0625 to 0.001 resolution */
  return reg * 125 / 2;
 -- 
 2.1.3

 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] bitops.h: improve documentation for sign_extend32()

2015-01-20 Thread Martin Kepplinger
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 include/linux/bitops.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 5d858e0..336f22b 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -164,6 +164,8 @@ static inline __u8 ror8(__u8 word, unsigned int shift)
  * sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit
  * @value: value to sign extend
  * @index: 0 based bit index (0=index32) to sign bit
+ *
+ * Safe to use for sign extending to 8 and 16 bit data types aswell.
  */
 static inline __s32 sign_extend32(__u32 value, int index)
 {
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 0/2] bitops.h: add sign_extend64() API and improve doc

2015-01-20 Thread Martin Kepplinger

Thanks for reviewing. I propose the following additions instead.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] bitops.h: Add sign_extend64() API

2015-01-20 Thread Martin Kepplinger
Add sign_extend64() for sign extending any (hardware-)given signed value
greater than 32 bits to s64.

Suggested-by: Christoph Muellner christoph.muell...@theobroma-systems.com
Suggested-by: Peter Zijlstra pet...@infradead.org
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 include/linux/bitops.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 336f22b..2fd47c8 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -173,6 +173,17 @@ static inline __s32 sign_extend32(__u32 value, int index)
return (__s32)(value  shift)  shift;
 }
 
+/**
+ * sign_extend64 - sign extend a 64-bit value using specified bit as sign-bit
+ * @value: value to sign extend
+ * @index: 0 based bit index (0=index64) to sign bit
+ */
+static inline __s64 sign_extend64(__u64 value, int index)
+{
+   __u8 shift = 63 - index;
+   return (__s64)(value  shift)  shift;
+}
+
 static inline unsigned fls_long(unsigned long l)
 {
if (sizeof(l) == 4)
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC PATCH 0/4] Example changes using proposed sign_extend functions

2015-01-14 Thread Martin Kepplinger

These are 4 of probably many examples of what could be changed if the proposed
sign_extend8, 16 and 64 are added to bitops.h, now as real patches.

Again, keep in mind, only take them if PATCH v2 add sign_exted8, 16 and 64
is included first.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/4] rtc: use sign_extend8 instead of manual conversion

2015-01-14 Thread Martin Kepplinger
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/rtc/rtc-x1205.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c
index b1de58e..3ec0b95 100644
--- a/drivers/rtc/rtc-x1205.c
+++ b/drivers/rtc/rtc-x1205.c
@@ -22,6 +22,7 @@
 #include linux/rtc.h
 #include linux/delay.h
 #include linux/module.h
+#include linux/bitops.h
 
 #define DRV_VERSION 1.0.8
 
@@ -366,8 +367,7 @@ static int x1205_get_atrim(struct i2c_client *client, int 
*trim)
 * perform sign extension. The formula is
 * Catr = (atr * 0.25pF) + 11.00pF.
 */
-   if (atr  0x20)
-   atr |= 0xC0;
+   atr = sign_extend8(atr, 5);
 
dev_dbg(client-dev, %s: raw atr=%x (%d)\n, __func__, atr, atr);
 
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] input: gtco: use bitops' sign_extend8

2015-01-14 Thread Martin Kepplinger
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/input/tablet/gtco.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 8580456..25b3834 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -59,7 +59,7 @@ Scott Hill sh...@gtcocalcomp.com
 #include asm/uaccess.h
 #include asm/unaligned.h
 #include asm/byteorder.h
-
+#include linux/bitops.h
 
 #include linux/usb/input.h
 
@@ -666,13 +666,8 @@ static void gtco_urb_callback(struct urb *urbinfo)
case 4:
/* Tilt */
 
-   /* Sign extend these 7 bit numbers.  */
-   if (device-buffer[6]  0x40)
-   device-buffer[6] |= 0x80;
-
-   if (device-buffer[7]  0x40)
-   device-buffer[7] |= 0x80;
-
+   device-buffer[6] = sign_extend8(device-buffer[6], 6);
+   device-buffer[7] = sign_extend8(device-buffer[6], 6);
 
valsigned = (device-buffer[6]);
input_report_abs(inputdev, ABS_TILT_X, (s32)valsigned);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/4] hwmon: jc42: use bitops' sign_extend16

2015-01-14 Thread Martin Kepplinger
Signed-off-by: Martin Kepplinger mart...@posteo.de
Reviewed-by: Guenter Roeck li...@roeck-us.net
---
 drivers/hwmon/jc42.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
index 388f8bc..d0582a3 100644
--- a/drivers/hwmon/jc42.c
+++ b/drivers/hwmon/jc42.c
@@ -31,6 +31,7 @@
 #include linux/hwmon-sysfs.h
 #include linux/err.h
 #include linux/mutex.h
+#include linux/bitops.h
 
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = {
@@ -213,11 +214,7 @@ static u16 jc42_temp_to_reg(int temp, bool extended)
 
 static int jc42_temp_from_reg(s16 reg)
 {
-   reg = 0x1fff;
-
-   /* sign extend register */
-   if (reg  0x1000)
-   reg |= 0xf000;
+   reg = sign_extend16(reg, 12);
 
/* convert from 0.0625 to 0.001 resolution */
return reg * 125 / 2;
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/4] media: stb0899: use sign_extend8 instead of manual work

2015-01-14 Thread Martin Kepplinger
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 drivers/media/dvb-frontends/stb0899_algo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/stb0899_algo.c 
b/drivers/media/dvb-frontends/stb0899_algo.c
index 93596e0..7bbcfde 100644
--- a/drivers/media/dvb-frontends/stb0899_algo.c
+++ b/drivers/media/dvb-frontends/stb0899_algo.c
@@ -19,6 +19,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include linux/bitops.h
 #include stb0899_drv.h
 #include stb0899_priv.h
 #include stb0899_reg.h
@@ -1490,9 +1491,7 @@ enum stb0899_status stb0899_dvbs2_algo(struct 
stb0899_state *state)
/* Store signal parameters  */
offsetfreq = STB0899_READ_S2REG(STB0899_S2DEMOD, CRL_FREQ);
 
-   /* sign extend 30 bit value before using it in calculations */
-   if (offsetfreq  (1  29))
-   offsetfreq |= -1  30;
+   offsetfreq = sign_extend32(offset_freq, 29);
 
offsetfreq = offsetfreq / ((1  30) / 1000);
offsetfreq *= (internal-master_clk / 100);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC][PATCH] arch: sh: use sign_extend64() for sign extension

2015-02-12 Thread Martin Kepplinger
Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 arch/sh/kernel/traps_64.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
index 112ea11..4e04261 100644
--- a/arch/sh/kernel/traps_64.c
+++ b/arch/sh/kernel/traps_64.c
@@ -25,6 +25,7 @@
 #include linux/sysctl.h
 #include linux/module.h
 #include linux/perf_event.h
+#include linux/bitops.h
 #include asm/uaccess.h
 #include asm/io.h
 #include asm/alignment.h
@@ -101,7 +102,7 @@ static int generate_and_check_address(struct pt_regs *regs,
if (displacement_not_indexed) {
__s64 displacement;
displacement = (opcode  10)  0x3ff;
-   displacement = ((displacement  54)  54); /* sign extend */
+   displacement = sign_extend64(displacement, 9);
addr = (__u64)((__s64)base_address + (displacement  
width_shift));
} else {
__u64 offset;
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Example use of sign_extend64()

2015-02-12 Thread Martin Kepplinger
From a first look, there are quite some places in arch where sign extension
is done. I append one example for review although I didn't even build this.
Don't use it unreviewed!

I guess the doc-addition to sign_extend32() would be valuable for it to be
used more often in long term.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC][PATCH] arch: arm [mach-imx] use sign_extend32() for sign_extension

2015-02-19 Thread Martin Kepplinger
I didn't build the following change. It should be correct though. If you can
add it to a tree and build or even run it before offering it for-linus, feel
free to do so. Otherwise please ignore.

thanks,
   martin

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] arch: arm [mach-imx] use sign_extend32() for sign_extension

2015-02-19 Thread Martin Kepplinger
From: Martin Kepplinger martin.kepplin...@theobroma-systems.com

Signed-off-by: Martin Kepplinger mart...@posteo.de
---
 arch/arm/mach-imx/clk-pllv2.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/clk-pllv2.c b/arch/arm/mach-imx/clk-pllv2.c
index 20889d5..1bbd08c 100644
--- a/arch/arm/mach-imx/clk-pllv2.c
+++ b/arch/arm/mach-imx/clk-pllv2.c
@@ -5,6 +5,7 @@
 #include linux/delay.h
 #include linux/slab.h
 #include linux/err.h
+#include linux/bitops.h
 
 #include asm/div64.h
 
@@ -88,11 +89,10 @@ static unsigned long __clk_pllv2_recalc_rate(unsigned long 
parent_rate,
mfi = (mfi = 5) ? 5 : mfi;
mfd = dp_mfd  MXC_PLL_DP_MFD_MASK;
mfn = mfn_abs = dp_mfn  MXC_PLL_DP_MFN_MASK;
-   /* Sign extend to 32-bits */
-   if (mfn = 0x0400) {
-   mfn |= 0xFC00;
+
+   mfn = sign_extend32(mfn, 26);
+   if (mfn  0)
mfn_abs = -mfn;
-   }
 
ref_clk = 2 * parent_rate;
if (dbl != 0)
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   4   5   6   7   8   9   10   >